/* ===== Jetons de couleur ===== */
:root {
  --green: #8CC152;
  --green-dark: #4F8A2B;
  --green-darker: #3F7022;
  --brown: #613A15;
  --splash-bg: #0A0716;
  --splash-pill: #3F6E9E;

  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --surface-2: #F4F6F0;
  --text: #1E1F1B;
  --muted: #5B5E55;
  --border: #D5D9CE;
  --focus: #2F6FB0;
  --error: #B3261E;
  --error-bg: #FDECEA;
  --ok: #2E6B17;
  --ok-bg: #EDF6E4;
  --info: #5A3A14;
  --info-bg: #F7EFE4;
  --shadow: 0 2px 12px rgba(20, 24, 14, .08);

  --radius: 14px;
  --tap: 56px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121410;
    --surface: #1B1E18;
    --surface-2: #242820;
    --text: #ECEEE7;
    --muted: #A9AD9F;
    --border: #383D31;
    --focus: #7FB2E8;
    --error: #FFB4AB;
    --error-bg: #3B1A17;
    --ok: #B5E08C;
    --ok-bg: #1F2E15;
    --info: #F0D2AE;
    --info-bg: #33261A;
    --shadow: 0 2px 12px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #121410;
  --surface: #1B1E18;
  --surface-2: #242820;
  --text: #ECEEE7;
  --muted: #A9AD9F;
  --border: #383D31;
  --focus: #7FB2E8;
  --error: #FFB4AB;
  --error-bg: #3B1A17;
  --ok: #B5E08C;
  --ok-bg: #1F2E15;
  --info: #F0D2AE;
  --info-bg: #33261A;
  --shadow: 0 2px 12px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: Lato, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
}

body.is-splashing { overflow: hidden; background: var(--splash-bg); }

h1, h2, p { margin: 0; }

button, input { font: inherit; color: inherit; }

[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.muted { color: var(--muted); }

.icon { width: 24px; height: 24px; flex: none; }
.icon--xl { width: 48px; height: 48px; color: var(--muted); }

.stack { display: grid; gap: 12px; }

/* ===== Vues ===== */
.view {
  min-height: 100dvh;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.view--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}

.view--auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.view--app { display: flex; flex-direction: column; }

/* ===== Connexion ===== */
.auth-top {
  width: 100%;
  max-width: 440px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  display: grid;
  gap: 24px;
}

.logo-tile {
  background: #FFFFFF;
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  justify-content: center;
}

:root[data-theme="dark"] .logo-tile { box-shadow: var(--shadow); }

.logo { width: 100%; max-width: 280px; height: auto; display: block; }

.form { display: grid; gap: 16px; }
.form__title { font-size: 1.625rem; font-weight: 900; line-height: 1.2; }

.field { display: grid; gap: 6px; }
.field__label { font-weight: 700; }

.input {
  width: 100%;
  min-height: var(--tap);
  padding: 12px 16px;
  font-size: 1.125rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}
.input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 30%, transparent); }

.input-wrap { position: relative; display: block; }
.input-wrap .input { padding-right: calc(var(--tap) + 4px); }
.input-wrap__btn {
  position: absolute;
  top: 0; right: 0;
  width: var(--tap); height: 100%;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: var(--radius);
  color: var(--muted);
  cursor: pointer;
}
.input-wrap__btn .icon--hide { display: none; }
.input-wrap__btn[aria-pressed="true"] .icon--show { display: none; }
.input-wrap__btn[aria-pressed="true"] .icon--hide { display: block; }

/* ===== Boutons ===== */
.btn {
  min-height: var(--tap);
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 2px solid transparent;
  font-size: 1.1875rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  text-align: center;
  touch-action: manipulation;
}
.btn:disabled { opacity: .65; cursor: progress; }

.btn--primary { background: var(--green-dark); color: #FFFFFF; }
.btn--primary:hover:not(:disabled) { background: var(--green-darker); }

.btn--secondary { background: var(--surface); border-color: var(--border); }
.btn--secondary:hover:not(:disabled) { background: var(--surface-2); }

.btn--link {
  background: none;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 400;
  font-size: 1.0625rem;
}

.icon-btn {
  width: 48px; height: 48px;
  display: grid; place-items: center;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); }

.theme-icon { display: none; }
:root[data-theme="auto"] .theme-icon--auto,
:root[data-theme="light"] .theme-icon--light,
:root[data-theme="dark"] .theme-icon--dark { display: block; }

.lang-switch {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 12px;
}
.lang-switch__btn {
  min-width: 48px; min-height: 40px;
  padding: 0 12px;
  border: 0; border-radius: 9px;
  background: none;
  font-weight: 700;
  cursor: pointer;
}
.lang-switch__btn[aria-pressed="true"] { background: var(--green-dark); color: #FFFFFF; }

/* ===== Alertes, toast ===== */
.alert { padding: 12px 16px; border-radius: var(--radius); font-weight: 700; }
.alert--error { background: var(--error-bg); color: var(--error); }
.alert--ok { background: var(--ok-bg); color: var(--ok); }
.alert--info { background: var(--info-bg); color: var(--info); }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 440px);
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  box-shadow: var(--shadow);
  z-index: 50;
}

/* ===== Chargement, messages ===== */
.spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--green-dark);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.message-card {
  width: 100%;
  max-width: 440px;
  display: grid;
  justify-items: center;
  gap: 16px;
}
.message-card .stack { width: 100%; }

/* ===== Application ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.topbar__actions { display: flex; align-items: center; gap: 8px; }
.topbar__logo { flex: 0 1 140px; min-width: 64px; }
.logo-tile--small { padding: 6px 10px; }
.logo-tile--small .logo { width: 100%; }

.page {
  flex: 1;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 0;
  display: grid;
  align-content: start;
  gap: 16px;
}
.page__title { font-size: 1.75rem; font-weight: 900; line-height: 1.2; }

.badge {
  justify-self: start;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: .9375rem;
}

.card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
}
.card__title { font-size: 1.25rem; font-weight: 900; }

/* ===== Administration : salariés ===== */
.admin-section { display: grid; gap: 16px; margin-top: 8px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.section-head__title { font-size: 1.375rem; font-weight: 900; }

.list-state {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.emp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.emp {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.emp__main { display: grid; gap: 4px; min-width: 0; flex: 1 1 260px; }
.emp__name { font-weight: 900; font-size: 1.125rem; overflow-wrap: anywhere; }
.emp__you { font-weight: 400; color: var(--muted); font-size: .9375rem; }
.emp__email { color: var(--muted); overflow-wrap: anywhere; }
.emp__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: .9375rem; }
.emp__detail { color: var(--muted); }
.emp__detail--warn { color: var(--error); font-weight: 700; }
.emp__actions { display: flex; flex-wrap: wrap; gap: 8px; }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: .875rem;
  border: 1px solid transparent;
}
.pill--actif { background: var(--ok-bg); color: var(--ok); }
.pill--invite { background: var(--info-bg); color: var(--info); }
.pill--inactif { background: var(--surface-2); color: var(--muted); border-color: var(--border); }
.pill--admin { background: var(--surface-2); color: var(--text); border-color: var(--border); }

.former { border-top: 1px solid var(--border); padding-top: 8px; }
.former__summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  font-weight: 700;
  cursor: pointer;
}
.former[open] .former__summary { margin-bottom: 8px; }

/* ===== Fenêtres (dialog) ===== */
.dialog {
  width: min(calc(100% - 32px), 480px);
  max-height: calc(100dvh - 32px);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .3);
}
.dialog::backdrop { background: rgba(10, 7, 22, .55); }
.dialog__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.dialog__actions .btn { flex: 1 1 160px; }

.choice { border: 0; margin: 0; padding: 0; min-width: 0; }
.choice__options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.choice__option {
  flex: 1 1 140px;
  min-height: var(--tap);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.choice__option input { width: 22px; height: 22px; accent-color: var(--green-dark); }
.choice__option:has(input:checked) { border-color: var(--green-dark); font-weight: 700; }

.field__hint { color: var(--muted); font-size: .9375rem; }
.input--readonly { background: var(--surface-2); color: var(--muted); }

.btn--small { min-height: 48px; padding: 8px 16px; font-size: 1rem; }
.btn--danger { background: var(--error); color: var(--bg); }
.btn--ghost-danger { background: none; border-color: var(--border); color: var(--error); }
.btn--ghost-danger:hover:not(:disabled) { background: var(--error-bg); }
.btn[aria-busy="true"] { cursor: progress; }

/* ===== Documents ===== */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

.back-link { justify-self: start; min-height: 48px; padding-left: 0; }

.dossier-head { display: grid; gap: 4px; }
.dossier-head .section-head__title { overflow-wrap: anywhere; }

.doc-section { display: grid; gap: 12px; margin-top: 16px; }
.doc-section__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--green);
}

.year { display: grid; gap: 8px; margin-bottom: 12px; }
.year__title { margin: 0; font-size: 1.0625rem; font-weight: 700; color: var(--muted); }

.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.doc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.doc__main { display: grid; gap: 4px; min-width: 0; flex: 1 1 240px; }
.doc__title { font-weight: 700; overflow-wrap: anywhere; }
.doc__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .9375rem; color: var(--muted); }
.doc__cat { font-weight: 700; color: var(--info); }
:root[data-theme="dark"] .doc__cat { color: var(--info); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .doc__cat { color: var(--info); } }
.doc__status--new { color: var(--info); font-weight: 700; }
.doc__status--ok { color: var(--ok); font-weight: 700; }
.doc__actions { display: flex; flex-wrap: wrap; gap: 8px; }

select.input { appearance: auto; }

/* ===== Suivi mensuel ===== */
.suivi-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: end;
  gap: 12px;
}
.suivi-summary { display: flex; flex-wrap: wrap; gap: 8px; }
.suivi-stat {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--info-bg);
  color: var(--info);
  font-weight: 700;
  font-size: .9375rem;
}
.suivi-stat--ok { background: var(--ok-bg); color: var(--ok); }
.suivi-line { font-size: .9375rem; }
.suivi-line--none { color: var(--muted); }
.suivi-line--new { color: var(--info); font-weight: 700; }
.suivi-line--ok { color: var(--ok); font-weight: 700; }
.suivi-docs { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.suivi-doc {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  padding: 6px 0 0;
  border-top: 1px solid var(--border);
  font-size: .9375rem;
}
.suivi-doc__title { font-weight: 700; overflow-wrap: anywhere; }
.suivi-row .emp__actions { flex-direction: column; align-items: stretch; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.file-pick { position: relative; display: grid; }
.file-pick__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.file-pick__btn { width: 100%; border-style: dashed; }
.file-pick:focus-within .file-pick__btn { outline: 3px solid var(--focus); outline-offset: 2px; }
.file-info { margin-top: 6px; font-weight: 700; overflow-wrap: anywhere; }

.progress { display: grid; gap: 6px; }
.progress progress { width: 100%; height: 14px; accent-color: var(--green-dark); }

/* ===== Dépôt groupé ===== */
.dialog--wide { width: min(calc(100% - 32px), 760px); }

.drop-zone {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}
.drop-zone.is-over { border-color: var(--green-dark); background: var(--ok-bg); }
.drop-zone__hint { font-size: .9375rem; }
@media (hover: none) { .drop-zone__hint { display: none; } }

.bulk-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bulk-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 2px solid var(--border);
  border-left-width: 6px;
  border-radius: var(--radius);
  background: var(--surface);
}
.bulk-row--ok { border-left-color: var(--green-dark); }
.bulk-row--error { border-left-color: var(--error); }
.bulk-row--wait { border-left-color: var(--border); }
.bulk-row__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.bulk-row__file { font-weight: 700; overflow-wrap: anywhere; min-width: 0; }
.bulk-row__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.bulk-row__status { font-size: .9375rem; font-weight: 700; }
.bulk-row__status--ok { color: var(--ok); }
.bulk-row__status--error { color: var(--error); }
.bulk-row__status--wait { color: var(--muted); }
.icon-btn--small { width: 44px; height: 44px; flex: none; font-size: 1.5rem; line-height: 1; }

/* ===== PDF groupé ===== */
.split-body { display: grid; gap: 12px; }
.alert__detail { margin-top: 6px; font-weight: 400; }
.field__hint--error { color: var(--error); font-weight: 700; }
.spinner--small { width: 28px; height: 28px; border-width: 3px; }
#split-analysis { grid-template-columns: auto 1fr; align-items: center; }

.split-groups { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.split-group { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.split-group__name { font-weight: 700; }

.page-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.page-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px;
  border: 2px solid var(--border);
  border-left-width: 6px;
  border-radius: var(--radius);
  background: var(--surface);
}
.page-row--ok { border-left-color: var(--green-dark); }
.page-row--error { border-left-color: var(--error); }
.page-row--done { border-left-color: var(--border); opacity: .75; }
.page-row__thumb {
  flex: none;
  width: 72px;
  height: 102px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.page-row__main { flex: 1; min-width: 0; display: grid; gap: 6px; }
.page-row__title { font-weight: 700; }

/* ===== Espace salarié ===== */
.emp-space { display: grid; gap: 16px; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
}
.tab {
  min-height: var(--tap);
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  font-weight: 700;
  font-size: 1.0625rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  text-align: center;
}
.tab[aria-selected="true"] { background: var(--green-dark); color: #FFFFFF; }
.tab__badge {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--brown);
  color: #FFFFFF;
  font-size: .8125rem;
}
.tab[aria-selected="true"] .tab__badge { background: #FFFFFF; color: var(--green-darker); }

.emp-doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.emp-doc {
  width: 100%;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.emp-doc:hover { background: var(--surface-2); }
.emp-doc__main { flex: 1; min-width: 0; display: grid; gap: 4px; }
.emp-doc__title { font-weight: 700; font-size: 1.125rem; overflow-wrap: anywhere; }
.emp-doc__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .9375rem; color: var(--muted); }
.emp-doc__chevron { color: var(--muted); }
.badge-new {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brown);
  color: #FFFFFF;
  font-weight: 700;
  font-size: .875rem;
}
.badge-confirm {
  flex: none;
  padding: 2px 9px;
  border: 2px solid var(--info);
  border-radius: 999px;
  color: var(--info);
  font-weight: 700;
  font-size: .875rem;
}
.emp-doc__acked { color: var(--ok); font-weight: 700; }

/* ===== Visionneuse ===== */
.dialog--viewer {
  width: min(100vw, 980px);
  max-width: 100vw;
  height: min(100dvh, 1200px);
  max-height: 100dvh;
  padding: 0;
  overflow: hidden;
}
.dialog--viewer[open] { display: flex; flex-direction: column; }
@media (max-width: 700px) {
  .dialog--viewer { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
}

.viewer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(8px, env(safe-area-inset-top)) 12px 8px 16px;
  border-bottom: 1px solid var(--border);
}
.viewer__title { margin: 0; font-size: 1.0625rem; font-weight: 700; overflow-wrap: anywhere; }

.viewer__scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--surface-2);
  padding: 8px;
}
.viewer__content { width: max-content; min-width: 100%; }
.viewer__page,
.viewer__image {
  display: block;
  margin: 0 auto;
  background: #FFFFFF;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .25);
}
.viewer__image { max-width: none; height: auto; }
.viewer__state {
  display: grid;
  place-items: center;
  min-height: 200px;
  text-align: center;
  font-weight: 700;
  color: var(--muted);
}

.viewer__ack {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.viewer__ack-text { flex: 1 1 240px; margin: 0; font-size: .9375rem; }
.viewer__ack #viewer-ack-btn { flex: 1 1 240px; }
.viewer__ack--done { background: var(--ok-bg); }
.viewer__ack--done .viewer__ack-text { color: var(--ok); font-weight: 700; }

.viewer__tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding: 8px 12px max(8px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
.viewer__group { display: flex; align-items: center; gap: 6px; }
.viewer__label { min-width: 72px; text-align: center; font-weight: 700; }
.icon-btn:disabled { opacity: .4; cursor: default; }

.brand-foot {
  margin-top: auto;
  padding-top: 16px;
  text-align: center;
  font-size: .875rem;
  color: var(--muted);
}

@media (max-width: 380px) {
  .topbar__actions { gap: 6px; }
  .topbar .icon-btn { width: 44px; height: 44px; }
  .topbar .lang-switch__btn { min-width: 42px; padding: 0 8px; }
}

/* ===== Animation de démarrage ===== */
.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--splash-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: opacity .45s ease;
  -webkit-tap-highlight-color: transparent;
}
.splash.is-done { opacity: 0; pointer-events: none; }

.splash__stage {
  position: relative;
  width: min(86vw, 360px);
  height: 190px;
}

.cloud {
  position: absolute;
  left: 50%;
  top: 60%;
  width: var(--w);
  color: #FFFFFF;
  translate: calc(-50% + var(--x)) calc(-50% + var(--y));
  opacity: 0;
  will-change: transform, opacity, filter;
  animation:
    cloud-in .6s ease-out var(--d) forwards,
    cloud-out 1.1s ease-in 1s forwards;
}
.cloud svg { display: block; width: 100%; height: auto; }

.cloud--main {
  animation:
    cloud-in .6s ease-out var(--d) forwards,
    cloud-settle .9s ease-in-out 1.1s forwards;
}

@keyframes cloud-in {
  from { opacity: 0; transform: scale(.55); }
  to   { opacity: .95; transform: scale(1); }
}
@keyframes cloud-out {
  from { opacity: .95; transform: scale(1); filter: blur(0); }
  to   { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.5); filter: blur(14px); }
}
@keyframes cloud-settle {
  from { opacity: .95; transform: scale(1); }
  to   { opacity: 1; transform: translateY(-8%) scale(1.08); }
}

.splash__brand { display: grid; justify-items: center; gap: 12px; }

.splash__pill {
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--splash-pill);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: .02em;
  opacity: 0;
  animation: rise-in .5s ease-out 1.7s forwards;
}

.splash__powered {
  color: rgba(255, 255, 255, .7);
  font-size: .875rem;
  opacity: 0;
  animation: rise-in .5s ease-out 2.1s forwards;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cloud:not(.cloud--main) { display: none; }
  .cloud--main, .splash__pill, .splash__powered { animation: none; opacity: 1; }
  .splash { transition: none; }
  .spinner { animation-duration: 3s; }
}
