/* EHR TECH RIS — feuille de style
   Deux ambiances : « Accueil » (claire, lumière du jour) et « Salle de lecture » (sombre, écrans de diagnostic).
   Toutes les couleurs passent par les variables ci-dessous. */

@font-face { font-family: "Plex"; src: url(fonts/plex-sans-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url(fonts/plex-sans-ext-400.woff2) format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }
@font-face { font-family: "Plex"; src: url(fonts/plex-sans-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url(fonts/plex-sans-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex"; src: url(fonts/plex-sans-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url(fonts/plex-arabic-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url(fonts/plex-arabic-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url(fonts/plex-arabic-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Arabic"; src: url(fonts/plex-arabic-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Accueil */
  --bg: #f2f4f3;
  --surface: #ffffff;
  --surface-2: #f7f9f8;
  --text: #18232b;
  --muted: #5f6d76;
  --border: #dce2e4;
  --border-strong: #c3ccd0;
  --side: #102a2e;
  --side-2: #163a3f;
  --side-text: #b9cfd0;
  --side-active: #1f5258;
  --accent: #0b6e73;
  --accent-ink: #ffffff;
  --accent-soft: #e0f0ef;
  --accent-line: #9fcfcd;
  --info: #2f6fb0;   --info-soft: #e6eef8;
  --ok: #2e7d4f;     --ok-soft: #e3f2e8;
  --warn: #9a5c00;   --warn-soft: #fdf0d9;
  --danger: #b3261e; --danger-soft: #fbe8e6;
  --violet: #6a4bb5; --violet-soft: #efeafa;
  --shadow: 0 1px 2px rgba(16, 42, 46, .06);
  --shadow-pop: 0 18px 50px rgba(16, 42, 46, .22);
  --r-card: 12px;
  --r-ctl: 8px;
  --radius: var(--r-card);
  --font: "Plex", "Plex Arabic", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* Salle de lecture : contraste doux, aucune surface blanche qui éblouit */
:root[data-theme="dark"] {
  --bg: #0d1315;
  --surface: #141c1f;
  --surface-2: #19232680;
  --text: #dbe6e5;
  --muted: #8a9da0;
  --border: #243134;
  --border-strong: #33464a;
  --side: #0a1012;
  --side-2: #111a1d;
  --side-text: #9fb5b6;
  --side-active: #17393c;
  --accent: #4fb3ae;
  --accent-ink: #062224;
  --accent-soft: #15363a;
  --accent-line: #2c6a6b;
  --info: #7fb0e6;   --info-soft: #172a3d;
  --ok: #6cc28f;     --ok-soft: #14301f;
  --warn: #e5b45a;   --warn-soft: #33270f;
  --danger: #ef8a80; --danger-soft: #3a1714;
  --violet: #b49cf0; --violet-soft: #251d3b;
  --shadow: none;
  --shadow-pop: 0 18px 60px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html[dir="rtl"] { --font: "Plex Arabic", "Plex", Tahoma, sans-serif; font-family: var(--font); }
body { margin: 0; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.error { color: var(--danger); min-height: 1em; }
a { color: var(--accent); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ───────────────────────── Connexion ───────────────────────── */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(360px, 1fr); background: var(--surface); }
.login-visual { background: var(--side); color: #e3eeee; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.login-visual .brand { padding: 0; }
.login-visual h2 { font-size: 34px; line-height: 1.15; font-weight: 600; margin: 0; max-width: 14em; letter-spacing: -.01em; }
.login-visual p { color: var(--side-text); max-width: 32em; font-size: 15px; }
/* Bande « négatoscope » : les étapes d'un examen */
.lightbox { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.lightbox > span { border: 1px solid #2c5a5f; background: #12353a; border-radius: 6px; padding: 8px 12px; font-size: 13px; color: #cfe3e3; }
.lightbox > span b { display: block; font-size: 11px; color: #7fb7b5; font-weight: 500; }
.login-side { display: grid; place-items: center; padding: 32px; }
.login-card { width: min(360px, 100%); display: grid; gap: 16px; }
.login-card h1 { margin: 0; font-size: 22px; font-weight: 600; }
.login-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.brand { font-weight: 600; font-size: 17px; color: #fff; display: flex; align-items: center; gap: 10px; padding: 18px 18px 14px; }
.brand.big { color: var(--text); font-size: 20px; padding: 0; }
.logo { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 16px; }
.brand-logo { max-height: 36px; max-width: 120px; object-fit: contain; background: #fff; border-radius: 6px; padding: 2px; }
.brand.big .brand-logo { max-height: 52px; max-width: 160px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-company { font-size: 12px; font-weight: 400; opacity: .75; }

/* ───────────────────────── Structure ───────────────────────── */
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--side); color: var(--side-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
#nav { flex: 1; display: flex; flex-direction: column; padding: 4px 10px 10px; gap: 1px; overflow-y: auto; scrollbar-width: thin; }
#nav a { color: var(--side-text); text-decoration: none; padding: 8px 10px; border-radius: 8px; display: flex; gap: 11px; align-items: center; font-weight: 500; }
#nav a:hover { background: var(--side-2); color: #fff; }
#nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--accent-line); }
html[dir="rtl"] #nav a.active { box-shadow: inset -3px 0 0 var(--accent-line); }
#nav a .count { margin-inline-start: auto; background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
#nav .nav-sep { font-size: 12px; color: #6f9192; padding: 14px 10px 4px; font-weight: 500; }
.me { padding: 10px 12px 12px; border-top: 1px solid rgba(255,255,255,.07); display: grid; gap: 8px; }
.me-head { display: flex; align-items: center; gap: 6px; }
.me-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-decoration: none; color: inherit; padding: 4px; border-radius: 8px; }
.me-link:hover { background: var(--side-2); }
.me-link > span:last-child { display: grid; min-width: 0; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--side-active); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.me #meName { color: #fff; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me #meRole { color: var(--side-text); }
.me-icon { background: none; border: 0; color: var(--side-text); cursor: pointer; padding: 7px; border-radius: 8px; display: grid; place-items: center; }
.me-icon:hover { background: var(--side-2); color: #fff; }
.me-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.me-actions button { color: var(--side-text); font: inherit; font-size: 12.5px; background: none; border: 1px solid rgba(255,255,255,.14); border-radius: 7px; padding: 5px 8px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; }
.me-actions button:hover { color: #fff; border-color: rgba(255,255,255,.3); }
.me-actions button svg.i { width: 16px; height: 16px; }
main { min-width: 0; }
.topbar { display: flex; gap: 16px; align-items: center; padding: 14px 28px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 3; }
.topbar h1 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.005em; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pageActions { display: flex; gap: 8px; margin-inline-start: auto; }
.search-trigger { display: flex; align-items: center; gap: 8px; min-width: 260px; max-width: 420px; flex: 1 1 280px; margin-inline-start: 24px; padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface-2); color: var(--muted); font: inherit; cursor: text; text-align: start; }
.search-trigger:hover { border-color: var(--border-strong); }
.search-trigger span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { font: inherit; font-size: 11px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; color: var(--muted); background: var(--surface); }
.content { padding: 22px 28px 40px; display: grid; gap: 16px; align-content: start; }

/* ───────────────────────── Composants ───────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 18px; box-shadow: var(--shadow); }
.card h3 { margin: 0 0 12px; font-size: 15px; font-weight: 600; }
.card.error { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 14px 16px; color: inherit; text-decoration: none; }
a.kpi:hover { border-color: var(--accent-line); }
.kpi .v { font-size: 26px; font-weight: 600; margin-top: 2px; letter-spacing: -.01em; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters label { display: grid; gap: 4px; font-size: 12.5px; color: var(--muted); }
label { display: grid; gap: 5px; font-size: 13px; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-ctl); background: var(--surface); color: var(--text); min-width: 0; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--accent-soft); border-color: var(--accent); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; }
.btn { font: inherit; font-weight: 500; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); padding: 7px 13px; border-radius: var(--r-ctl); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; line-height: 1.3; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn.sm { padding: 3px 9px; font-size: 12.5px; border-radius: 7px; }
.btn.ghost { border-color: transparent; background: transparent; }
.icon { border: 0; background: none; cursor: pointer; font-size: 16px; color: var(--muted); border-radius: 6px; padding: 4px 6px; }
.icon:hover { background: var(--surface-2); color: var(--text); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 9px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 12.5px; font-weight: 500; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
tbody tr:hover { background: var(--surface-2); }
tr.clickable { cursor: pointer; }
td.actions { white-space: nowrap; }
td.actions .btn + .btn, td.actions .btn + a, td.actions a + .btn { margin-inline-start: 4px; }
.empty { padding: 36px 20px; text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }

/* Statuts : pastille + couleur sémantique (lisible aussi sans la couleur grâce au libellé) */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--surface-2); color: var(--muted); border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.mod { border-radius: 6px; font-weight: 600; letter-spacing: .02em; margin-inline-end: 3px; }
.badge.mod::before { display: none; }
.badge.Requested { background: var(--violet-soft); color: var(--violet); }
.badge.Scheduled, .badge.Pending, .badge.Received { background: var(--info-soft); color: var(--info); }
.badge.Arrived, .badge.Dictated, .badge.Transcribed, .badge.InRepair { background: var(--warn-soft); color: var(--warn); }
.badge.InProgress, .badge.Running, .badge.InReading { background: var(--accent-soft); color: var(--accent); }
.badge.Completed, .badge.Reported, .badge.Available { background: var(--ok-soft); color: var(--ok); }
.badge.Validated { background: var(--ok); color: #fff; }
.badge.Cancelled, .badge.Failed, .badge.Discontinued, .badge.off, .badge.OutOfOrder, .badge.OutOfService { background: var(--danger-soft); color: var(--danger); }
.badge.Draft, .badge.Disconnected { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.badge.Urgent { background: var(--danger); color: #fff; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 6px; vertical-align: middle; background: var(--muted); }
.money { font-variant-numeric: tabular-nums; }
.totals { display: flex; gap: 22px; justify-content: flex-end; flex-wrap: wrap; font-size: 14px; }
.totals b { font-size: 16px; }

.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.span2 { grid-column: span 2; }
.span3 { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: center; }
.bar { height: 8px; background: var(--accent); border-radius: 4px; }
.progress { height: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; border-radius: 999px; }
.perm-table td, .perm-table th { padding: 6px 10px; text-align: center; }
.perm-table td:first-child { text-align: start; font-weight: 600; }

dialog { border: 1px solid var(--border); border-radius: 14px; padding: 0; width: min(760px, 94vw); box-shadow: var(--shadow-pop); background: var(--surface); color: var(--text); }
dialog::backdrop { background: rgba(8, 22, 24, .5); backdrop-filter: blur(2px); }
dialog[open] { animation: pop .14s ease-out; }
@keyframes pop { from { transform: translateY(6px) scale(.99); opacity: 0; } }
dialog header, dialog footer { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; }
dialog header { border-bottom: 1px solid var(--border); }
dialog footer { border-top: 1px solid var(--border); justify-content: flex-end; gap: 8px; background: var(--surface-2); border-radius: 0 0 14px 14px; }
dialog h2 { margin: 0; font-size: 17px; font-weight: 600; }
#modalBody { padding: 18px 20px; display: grid; gap: 12px; max-height: 72vh; overflow-y: auto; }
dialog.wide { width: min(1100px, 96vw); }
#modalBody h3 { margin: 6px 0 0; font-size: 14px; }

#toast { position: fixed; bottom: 20px; inset-inline-end: 20px; display: grid; gap: 8px; z-index: 100; }
.toast { background: var(--text); color: var(--surface); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow-pop); max-width: 420px; animation: pop .16s ease-out; }
.toast.err { background: var(--danger); color: #fff; }

/* ───────────────────────── Recherche globale (Ctrl K) ───────────────────────── */
dialog.palette { width: min(640px, 94vw); margin-top: 12vh; }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.palette-input input { border: 0; outline: 0; flex: 1; font-size: 16px; padding: 4px 0; background: transparent; }
.palette-input input:focus { outline: 0; }
.palette-list { max-height: 56vh; overflow-y: auto; padding: 6px; }
.palette-group { font-size: 12px; color: var(--muted); padding: 10px 10px 4px; }
.palette-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; font: inherit; color: inherit; border: 0; background: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.palette-item .sub { color: var(--muted); font-size: 12.5px; }
.palette-item .end-meta { margin-inline-start: auto; color: var(--muted); font-size: 12.5px; }
.palette-item.sel, .palette-item:hover { background: var(--accent-soft); }
.palette-foot { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; background: var(--surface-2); border-radius: 0 0 14px 14px; }

/* ───────────────────────── Tableau de bord ───────────────────────── */
.hello { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hello h2 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.hello .muted { font-size: 14px; }
.todo { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.todo a { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-card); border: 1px solid var(--border); background: var(--surface); text-decoration: none; color: inherit; }
.todo a:hover { border-color: var(--accent-line); }
.todo .n { font-size: 26px; font-weight: 600; min-width: 1.6em; color: var(--accent); }
.todo a.zero .n { color: var(--muted); }
.todo .l { line-height: 1.25; }
.todo .l small { display: block; color: var(--muted); }
/* Journée des équipements : la bande « négatoscope » */
.daystrip { background: var(--side); border-radius: var(--r-card); padding: 16px 18px 12px; color: #d7e7e7; }
.daystrip h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: #fff; display: flex; justify-content: space-between; gap: 10px; }
.daystrip h3 span { font-weight: 400; color: #7fa9a9; font-size: 13px; }
.ds-grid { display: grid; grid-template-columns: 170px minmax(0, 1fr) 70px; gap: 8px 14px; align-items: center; margin-top: 10px; }
.ds-scale { position: relative; height: 16px; color: #6f9898; font-size: 11px; }
.ds-scale span { position: absolute; transform: translateX(-50%); }
html[dir="rtl"] .ds-scale span { transform: translateX(50%); }
.ds-name { min-width: 0; }
.ds-name b { display: block; color: #fff; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-name small { color: #7fa9a9; }
.ds-track { position: relative; height: 26px; border-radius: 6px; background: #0b1f22; border: 1px solid #1d4146; overflow: hidden; }
.ds-track.off { background: repeating-linear-gradient(45deg, #0b1f22, #0b1f22 6px, #162a2d 6px, #162a2d 12px); }
.ds-slot { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; background: var(--c, #4fb3ae); opacity: .9; min-width: 3px; }
.ds-slot.done { opacity: .45; }
.ds-slot.live { box-shadow: 0 0 0 2px #fff inset; }
.ds-now { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #ff8a7a; z-index: 2; }
.ds-pct { text-align: end; font-size: 13px; color: #cfe3e3; }
.ds-legend { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: #7fa9a9; flex-wrap: wrap; }
.ds-legend i { display: inline-block; width: 18px; height: 8px; border-radius: 3px; background: #4fb3ae; vertical-align: middle; margin-inline-end: 6px; }
.ds-legend i.done { opacity: .45; }
.ds-legend i.now { width: 2px; height: 12px; background: #ff8a7a; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.figures > div { padding: 14px 18px; border-inline-start: 1px solid var(--border); }
.figures > div:first-child { border-inline-start: 0; }
.figures .v { font-size: 22px; font-weight: 600; }
.figures .k { color: var(--muted); font-size: 12.5px; }

/* ───────────────────────── Divers (listes, formulaires) ───────────────────────── */
html[dir="rtl"] .pager { justify-content: flex-start; }
bdi[dir="ltr"], code { unicode-bidi: isolate; }
.lang-select { padding: 4px 8px; font-size: 13px; }
.lang-select.side { width: 100%; min-width: 0; font-size: 12.5px; background: transparent; color: var(--side-text); border-color: rgba(255,255,255,.14); }
.lang-select.side option { color: #18232b; }
.bulkbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 18px; background: var(--accent-soft); border-color: var(--accent-line); }
label.inline { display: flex; gap: 8px; align-items: center; }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
td.sel, th.sel { width: 32px; }
td.num, th.num { text-align: end; }
td.wrap { white-space: normal; min-width: 160px; max-width: 360px; }
.barrow { display: grid; grid-template-columns: 50px 1fr 50px; gap: 10px; align-items: center; margin: 6px 0; }
.small-bar { max-width: 120px; margin-top: 4px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between h3 { margin: 0; }
.end { align-self: end; }
.full { width: 100%; margin: 8px 0; }
.mt { margin-top: 8px; }
.pre { white-space: pre-wrap; }
details summary { cursor: pointer; margin: 8px 0; color: var(--accent); }
.brand-edit { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.logo-preview { width: 160px; height: 100px; border: 1px dashed var(--border-strong); border-radius: 10px; display: grid; place-items: center; background: #fff; }
.logo-preview img { max-width: 150px; max-height: 90px; object-fit: contain; }
.grow { flex: 1 1 360px; }
.ok-text { color: var(--ok); font-weight: 600; }
.danger-text { color: var(--danger); font-weight: 600; }
.notice { background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); color: var(--text); border-radius: var(--r-ctl); padding: 9px 12px; font-size: 13px; }
.notice.warn { border-color: var(--warn); }
.days { display: flex; flex-wrap: wrap; gap: 10px; }
.ttc { font-weight: 700; }

/* ───────────────────────── Planning ───────────────────────── */
.sched { display: grid; overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.sched-head { display: grid; position: sticky; top: 0; z-index: 1; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.sched-head > div { padding: 8px 10px; font-weight: 600; border-inline-start: 1px solid var(--border); min-width: 0; }
.sched-head .dev-name { display: flex; align-items: center; gap: 6px; }
.sched-body { display: grid; position: relative; }
.sched-times { position: relative; }
.sched-time { position: absolute; inset-inline-start: 0; width: 100%; font-size: 11px; color: var(--muted); padding: 0 6px; transform: translateY(-6px); }
.sched-time:first-child { transform: none; }
.sched-time:last-child { transform: translateY(-100%); }
.sched-col { position: relative; border-inline-start: 1px solid var(--border); }
.sched-col.off { background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 8px, var(--bg) 8px, var(--bg) 16px); }
.sched-cell { position: absolute; inset-inline: 0; border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent); cursor: pointer; }
.sched-cell.hour { border-top-color: var(--border); }
.sched-cell:hover { background: var(--accent-soft); }
.sched-col.off .sched-cell { cursor: not-allowed; }
.sched-col.off .sched-cell:hover { background: transparent; }
.booking { position: absolute; inset-inline: 3px; border-radius: 7px; padding: 3px 7px; font-size: 12px; overflow: hidden; color: #fff; cursor: pointer;
  border-inline-start: 4px solid rgba(0,0,0,.28); line-height: 1.25; }
.booking .t { font-weight: 600; }
.booking.Arrived { outline: 2px solid #f5b800; outline-offset: -2px; }
.booking.InProgress { background-image: linear-gradient(90deg, rgba(255,255,255,.18) 50%, transparent 50%); background-size: 12px 12px; }
.booking.Completed, .booking.Reported { opacity: .6; }
.block { position: absolute; inset-inline: 0; background: repeating-linear-gradient(-45deg, var(--danger-soft), var(--danger-soft) 6px, transparent 6px, transparent 12px);
  color: var(--danger); font-size: 11px; padding: 2px 6px; z-index: 0; }
.now-line { position: absolute; inset-inline: 0; height: 2px; background: var(--danger); z-index: 1; pointer-events: none; }

/* Créneaux et sélection */
.slots { display: flex; flex-wrap: wrap; gap: 6px; max-height: 220px; overflow-y: auto; }
.slot { font: inherit; font-size: 12.5px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); border-radius: 7px; padding: 5px 9px; cursor: pointer; }
.slot:hover, .slot.sel { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.order-line { border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px; display: grid; gap: 10px; background: var(--surface-2); }
.order-line .head { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.order-line .head label { flex: 1 1 220px; }
.picked { color: var(--ok); font-weight: 600; }
.patient-pick { display: grid; gap: 8px; }
.pick-list { display: grid; gap: 4px; max-height: 220px; overflow-y: auto; }
.pick-item { text-align: start; font: inherit; color: inherit; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-ctl); padding: 8px 10px; cursor: pointer; text-decoration: none; display: block; }
.pick-item:hover { border-color: var(--accent-line); background: var(--accent-soft); }
.pick-item.sel { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }

/* ───────────────────────── Compte rendu ───────────────────────── */
.report-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.editor-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--r-card) var(--r-card) 0 0; position: sticky; top: 63px; z-index: 1; }
.toolbar button { font: inherit; min-width: 32px; border: 1px solid transparent; background: transparent; color: var(--text); border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.toolbar button:hover { border-color: var(--border-strong); background: var(--surface); }
.toolbar .sep { width: 1px; background: var(--border); margin: 2px 4px; }
/* Feuille du compte rendu : toujours claire, comme le document imprimé */
.editor { min-height: 520px; padding: 28px 36px; outline: none; font-family: "Plex", "Plex Arabic", sans-serif; font-size: 15px; line-height: 1.65; background: #fff; color: #18232b; border-radius: 0 0 var(--r-card) var(--r-card); }
.editor:focus { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.editor[contenteditable="false"] { background: #fafbfb; }
.editor p { margin: 0 0 .6em; }
.editor h3 { font-size: 16px; margin: 1em 0 .4em; }
.side-panel { display: grid; gap: 14px; position: sticky; top: 78px; min-width: 0; }
.rec { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rec .timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--danger); }
.rec-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--danger); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
audio { width: 100%; }
.transcript { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 10px; max-height: 260px; overflow-y: auto; font-size: 13px; }
.tpl-list { display: grid; gap: 4px; max-height: 280px; overflow-y: auto; }
.report-head { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; }
.report-head b { font-size: 16px; }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 18px; }
.info-grid div span { display: block; font-size: 12px; color: var(--muted); }
.pdf-wrap { padding: 0; overflow: hidden; }
.pdf-frame { width: 100%; height: calc(100vh - 230px); min-height: 560px; border: 0; display: block; background: #525659; }

/* ───────────────────────── Écrans étroits ───────────────────────── */
@media (max-width: 1100px) {
  .report-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; }
  .search-trigger { min-width: 0; }
  .search-trigger span { display: none; }
}
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  #nav { flex-direction: row; flex-wrap: wrap; }
  #nav .nav-sep { display: none; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .content, .topbar { padding-left: 16px; padding-right: 16px; }
  .topbar { flex-wrap: wrap; }
  .search-trigger { margin-inline-start: 0; flex-basis: 100%; order: 3; max-width: none; }
  .ds-grid { grid-template-columns: 110px minmax(0, 1fr) 48px; }
}
@media print { .sidebar, .topbar, #toast { display: none !important; } .layout { display: block; } }

/* ───────────────────────── Caisse et facturation ───────────────────────── */
.badge.Unpaid { background: var(--warn-soft); color: var(--warn); }
.badge.PartiallyPaid, .badge.claim-Sent, .badge.claim-PartiallyPaid { background: var(--info-soft); color: var(--info); }
.badge.Paid, .badge.claim-Paid { background: var(--ok-soft); color: var(--ok); }
.badge.Open { background: var(--accent-soft); color: var(--accent); }
.badge.claim-Draft { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.badge.claim-Cancelled { background: var(--danger-soft); color: var(--danger); }
.neg { color: var(--danger); }
.pos { color: var(--ok); }
.cur { color: var(--muted); font-size: .85em; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; white-space: nowrap; }
tr.off td { color: var(--muted); }
tr.off td b { font-weight: 500; }

/* Tiroir-caisse : le seul élément sombre de la page, comme la journée des équipements */
.till { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) minmax(260px, 1.6fr); gap: 0;
  background: var(--side); color: #d7e7e7; border-radius: var(--r-card); overflow: hidden; }
.till > * { padding: 16px 20px; }
.till > * + * { border-inline-start: 1px solid #ffffff14; }
.till .small { color: #8fb3b3; margin-top: 6px; }
.till-name { display: flex; align-items: center; gap: 8px; font-size: 16px; color: #fff; }
.till-name .i { width: 20px; height: 20px; color: #7fd0cb; }
.till-name .badge.Open { background: #7fd0cb22; color: #9fe0dc; }
.till-drawer > span { font-size: 12.5px; color: #8fb3b3; }
.till-cash { font-size: 34px; font-weight: 600; color: #fff; letter-spacing: -.01em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: 2px; }
.till-cash small { font-size: 14px; font-weight: 500; color: #8fb3b3; }
.till-calc { font-size: 12.5px; color: #8fb3b3; margin-top: 4px; }
.till-methods { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px 16px; align-content: center; }
.till-methods > div { display: flex; flex-direction: column; }
.till-methods > div > span { font-size: 12px; color: #8fb3b3; }
.till-methods b, .till-methods b .money { font-size: 17px; color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.till-methods small { font-size: 11.5px; color: #6f9898; }
.till-methods .total b { color: #9fe0dc; }
.till.closed { grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.6fr); }
.till-open { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.till-open label { color: #8fb3b3; font-size: 12.5px; }
.till-open select, .till-open input { background: #ffffff10; border-color: #ffffff24; color: #fff; min-width: 160px; }
.till-open option { color: #18232b; }

.cash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.queue { display: grid; gap: 8px; margin-top: 8px; }
.queue-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface-2); }
.queue-item .small { margin-top: 3px; }
.queue-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; white-space: nowrap; }
.search-in input { min-width: 200px; padding-block: 6px; }

/* Récapitulatif d'une facture : lignes de montant, dernière ligne mise en avant */
.bill-sum { margin-inline-start: auto; max-width: 380px; display: grid; gap: 2px; font-size: 14px; }
.bill-sum > div { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; }
.bill-sum > div > span:first-child { color: var(--muted); }
.amt { white-space: nowrap; }
.bill-sum .due { border-top: 1px solid var(--border-strong); margin-top: 4px; padding-top: 8px; font-weight: 600; font-size: 15.5px; }
.bill-sum .due > span:first-child { color: var(--text); }
.rate { display: inline-flex; align-items: center; gap: 4px; }
.rate input { width: 78px; text-align: end; padding: 4px 6px; }

.pay-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-ctl); }
.pay-due { text-align: end; }
.pay-due span { display: block; font-size: 12px; color: var(--muted); }
.pay-due .money { font-size: 22px; font-weight: 600; }
.change { font-size: 15px; min-height: 1.4em; }
.change .money { font-size: 18px; }
.close-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; align-items: end; }
.close-grid > div span { display: block; font-size: 12px; color: var(--muted); }
.close-grid b { font-size: 18px; }
.rates-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 16px; }
.rates-grid label { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.visit-billing { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

@media (max-width: 980px) {
  .till, .till.closed { grid-template-columns: 1fr; }
  .till > * + * { border-inline-start: 0; border-top: 1px solid #ffffff14; }
  .cash-cols, .close-grid { grid-template-columns: 1fr; }
}

/* Choix de la caisse (plusieurs caisses attribuées au même compte) */
.reg-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.reg-pick button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--r-ctl);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.reg-pick button small { font-weight: 400; font-size: 11.5px; color: var(--muted); }
.reg-pick button.sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.by-user { display: flex; gap: 6px; flex-wrap: wrap; }

/* Facturation : remise et récapitulatif côte à côte */
.inv-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 20px; align-items: start; }
.inv-foot .bill-sum { margin: 0; max-width: none; }
fieldset.discount { border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 10px 12px 12px; margin: 0; }
fieldset.discount legend { padding: 0 6px; font-weight: 600; font-size: 13.5px; }
.disc-row { display: grid; grid-template-columns: 80px 120px minmax(0, 1fr); gap: 8px; }
label.check.cov { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }

/* Règles de prise en charge (mode, taux, plafond) */
.rule { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rule select { width: auto; min-width: 150px; }
.rule .rate input { width: 90px; }
.rule-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 0; }
.rule-line > span:first-child { display: flex; flex-direction: column; min-width: 140px; }
.rates-grid.wide { grid-template-columns: 1fr; gap: 0; }
.rates-grid.wide .rule-line + .rule-line { border-top: 1px solid var(--border); }
.user-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 16px; }

/* Remise de chèques */
.deposit-bar { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.deposit-bar .grow { flex: 1; min-width: 180px; }
.dep-sum { align-self: center; min-width: 170px; }

@media (max-width: 980px) {
  .inv-foot { grid-template-columns: 1fr; }
  .disc-row { grid-template-columns: 70px 1fr; }
  .disc-row input[name=discountReason] { grid-column: span 2; }
}

/* ───────────────────────── Éditeur de compte rendu ───────────────────────── */
/* La feuille reprend la largeur utile d'une page A4 : ce que l'on tape ressemble au PDF signé */
.rich { display: flex; flex-direction: column; }
.ed-tb { align-items: center; gap: 2px 6px; }
.ed-tb .tb-group { display: inline-flex; gap: 1px; padding-inline-end: 6px; border-inline-end: 1px solid var(--border); }
.ed-tb .tb-group:last-child, .ed-tb .tb-end { border: 0; }
.ed-tb .tb-end { margin-inline-start: auto; }
.ed-tb button { min-width: 30px; height: 30px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center; }
.ed-tb button .i { width: 17px; height: 17px; }
.ed-tb button.txt { font-size: 13px; }
.ed-tb .tb-block { width: auto; min-width: 128px; height: 30px; padding: 2px 8px; font-size: 13px; }
.tb-menu { position: relative; display: inline-flex; }
.tb-pop { display: none; position: absolute; top: calc(100% + 4px); inset-inline-start: 0; z-index: 20; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-ctl); box-shadow: var(--shadow-pop); padding: 10px; gap: 8px; min-width: 190px; }
.tb-pop.open { display: grid; }
.tb-pop label { font-size: 12.5px; }
.tb-pop.chars { grid-template-columns: repeat(6, auto); gap: 2px; min-width: 0; }
.tb-pop.chars button { min-width: 34px; font-size: 13px; }
.tb-pop.list { gap: 0; padding: 4px; }
.tb-pop.list button { justify-content: flex-start; width: 100%; padding: 6px 10px; }
.ed-sheet { background: var(--surface-2); padding: 18px; overflow: auto; }
.ed-sheet .editor { max-width: 794px; margin: 0 auto; border-radius: 4px; box-shadow: 0 1px 3px rgba(16, 42, 46, .12), 0 0 0 1px #e3e8ea; padding: 48px 56px; }
.editor h2 { font-size: 19px; margin: 1em 0 .4em; }
.editor h4 { font-size: 14.5px; margin: .9em 0 .3em; }
.editor blockquote { margin: .4em 0; padding: 2px 0 2px 14px; border-inline-start: 3px solid #cfd8da; color: #3b4a52; }
.editor table { border-collapse: collapse; margin: .5em 0; width: 100%; }
.editor td, .editor th { border: 1px solid #b8c2c6; padding: 4px 8px; vertical-align: top; min-width: 40px; }
.editor th { background: #f0f3f4; }
.editor hr { border: 0; border-top: 1px solid #b8c2c6; margin: 1em 0; }
.ed-status { display: flex; gap: 16px; padding: 7px 14px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); background: var(--surface); border-radius: 0 0 var(--r-card) var(--r-card); }
.ed-status .ed-state { margin-inline-start: auto; }
.rich.ed-full { position: fixed; inset: 0; z-index: 50; border-radius: 0; background: var(--surface-2); }
.rich.ed-full .toolbar { top: 0; border-radius: 0; }
.rich.ed-full .ed-sheet { flex: 1; }
.rich.ed-full .ed-sheet .editor { min-height: calc(100vh - 140px); }
body.ed-full-on { overflow: hidden; }
#modalBody .rich .ed-sheet { padding: 10px; }
#modalBody .rich .ed-sheet .editor { padding: 22px 26px; min-height: 140px; }
.prior-view { max-height: 56vh; overflow: auto; border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 20px 26px; }
.prior { display: grid !important; gap: 2px; text-align: start; }
.prior-concl { color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ph-item { display: flex; align-items: center; gap: 4px; }
.ph-item .pick-item { flex: 1; }
.ph-list { max-height: 220px; }
.prefix-in { display: flex; align-items: center; }
.prefix-in > span { padding: 0 8px; color: var(--muted); font-weight: 600; }
.btn-group { display: inline-flex; gap: 6px; }

/* Images clés (carte du compte rendu) */
.key-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 8px; }
.key-strip figure { margin: 0; }
.key-strip img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #000; border-radius: 4px; display: block; }
.key-strip figcaption { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.booklet-btn { display: inline-flex; gap: 4px; }
.booklet-btn select { width: auto; padding: 4px 6px; font-size: 12.5px; }

/* Choix des images dans le PACS : panneau sombre comme une console de lecture */
dialog.xl { width: min(1400px, 98vw); }
dialog.xl #modalBody { max-height: 84vh; }
.kp { display: grid; grid-template-columns: 210px minmax(0, 1fr) 420px; gap: 0; height: 58vh; min-height: 380px; background: #0d1315; border-radius: var(--r-ctl); overflow: hidden; color: #cfe0e0; }
.kp-series { overflow-y: auto; border-inline-end: 1px solid #ffffff14; padding: 6px; display: grid; gap: 4px; align-content: start; }
.kp-se { display: flex; gap: 8px; align-items: center; text-align: start; background: transparent; color: inherit; border: 1px solid transparent; border-radius: 6px; padding: 5px; font: inherit; cursor: pointer; }
.kp-se:hover { background: #ffffff0d; }
.kp-se.sel { border-color: #4fb3ae; background: #4fb3ae1a; }
.kp-se img { width: 56px; height: 56px; object-fit: contain; background: #000; border-radius: 3px; flex: none; }
.kp-se small { display: block; color: #8fb3b3; font-size: 11.5px; }
.kp-se .badge.mod { background: #ffffff14; color: #cfe0e0; }
.kp-grid { overflow-y: auto; padding: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; align-content: start; }
.kp-th { position: relative; padding: 0; border: 2px solid transparent; border-radius: 4px; background: #000; cursor: pointer; aspect-ratio: 1; }
.kp-th img { width: 100%; height: 100%; object-fit: contain; display: block; }
.kp-th span { position: absolute; bottom: 2px; inset-inline-end: 4px; font-size: 10.5px; color: #cfe0e0; text-shadow: 0 0 3px #000; }
.kp-th.sel { border-color: #4fb3ae; }
.kp-th.key::after { content: "✓"; position: absolute; top: 2px; inset-inline-start: 4px; font-size: 12px; font-weight: 700; color: #0d1315; background: #9fe0dc; border-radius: 999px; width: 17px; height: 17px; display: grid; place-items: center; }
.kp-view { border-inline-start: 1px solid #ffffff14; padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto; }
.kp-view label { color: #8fb3b3; font-size: 12.5px; }
.kp-view input, .kp-view select { background: #ffffff10; border-color: #ffffff24; color: #fff; }
.kp-view option { color: #18232b; }
.kp-view .muted { color: #6f9898; }
.kp-img { position: relative; background: #000; border-radius: 4px; aspect-ratio: 1; display: grid; place-items: center; }
.kp-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.kp-nav { position: absolute; bottom: 6px; inset-inline: 6px; display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.kp-nav .btn { background: #000a; color: #fff; border-color: #ffffff30; }
.kp-strip { border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 10px; }
.kp-strip-head { margin-bottom: 8px; }
.kp-keys { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.kp-keys figure { margin: 0; flex: 0 0 150px; display: grid; gap: 4px; }
.kp-keys img { width: 150px; height: 150px; object-fit: contain; background: #000; border-radius: 4px; }
.kp-keys input { font-size: 12px; padding: 4px 6px; }
.kp-key-tools { display: flex; align-items: center; justify-content: space-between; gap: 2px; font-size: 12px; }
@media (max-width: 1100px) {
  .kp { grid-template-columns: 160px minmax(0, 1fr); height: auto; }
  .kp-view { grid-column: span 2; border-inline-start: 0; border-top: 1px solid #ffffff14; }
}
