/* ==========================================================================
   Assistant cabinet — design system mobile (iOS / Android)
   Palette juridique sobre : bleu marine, ardoise, ambre et rouge réservés
   aux urgences. Cibles tactiles >= 48px, barre d'onglets basse sécurisée.
   ========================================================================== */

:root {
  --navy: #0f2a44;
  --navy-600: #17405f;
  --navy-100: #e8eef4;
  --slate: #3c4a57;
  --ink: #16212b;
  --muted: #5e6b77;
  --line: #dde4ea;
  --bg: #f4f7f9;
  --surface: #ffffff;

  --amber: #b0780b;
  --amber-soft: #fdf3df;
  --red: #a3222b;
  --red-soft: #fcecec;
  --green: #1c6b4c;
  --green-soft: #e7f3ed;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 10px 26px rgba(15, 42, 68, 0.08);
  --shadow-soft: 0 2px 8px rgba(15, 42, 68, 0.06);
  --tabbar-h: 62px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

img { max-width: 100%; height: auto; display: block; }

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

button { cursor: pointer; background: none; border: 0; }

h1, h2, h3, p { margin: 0; }

[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid rgba(15, 42, 68, 0.45);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ---------------------------------------------------------------- bannière */
.banner {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(8px + var(--safe-top)) 16px 10px;
  background: var(--amber-soft);
  color: #6d4a04;
  font-size: 13.5px;
  font-weight: 500;
  border-bottom: 1px solid #f0e0bf;
}

.banner__dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
}

.banner--online {
  background: var(--green-soft);
  color: var(--green);
  border-bottom-color: #cfe7dc;
}

.banner--online .banner__dot { background: var(--green); }

/* ------------------------------------------------------------------ topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(244, 247, 249, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(221, 228, 234, 0.8);
}

body:not(.has-banner) .topbar { padding-top: calc(10px + var(--safe-top)); }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand__logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
}

.brand__text { min-width: 0; }

.brand__eyebrow {
  display: block;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand__title {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: var(--navy);
  background: transparent;
}

.icon-btn:active { background: var(--navy-100); }

/* Bouton d'identite de l'avocat : ses initiales sur sa couleur, ou celle du cabinet. */
.icon-btn--avatar {
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: var(--navy);
  color: #fff;
}

.icon-btn--avatar:active { opacity: 0.86; background: var(--navy); }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--navy-100);
  color: var(--navy);
  white-space: nowrap;
}

.pill--queue { background: var(--amber-soft); color: #7a5306; }
.pill--mode { background: var(--navy-100); color: var(--navy-600); font-weight: 600; }

/* -------------------------------------------------------------------- main */
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 26px);
}

.view { display: block; animation: fade 0.22s ease; }

@keyframes fade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------- cartes */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.card--pad { padding: 16px; }

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

.block { margin-top: 22px; }

.block__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.block__title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--navy);
  text-transform: none;
}

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row--end { justify-content: flex-end; margin-top: 8px; }

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

@media (min-width: 480px) {
  .grid--2 { grid-template-columns: 1fr 1fr; }
}

/* --------------------------------------------------------------------- hero */
.hero {
  position: relative;
  border-radius: 22px;
  background: var(--navy);
  min-height: 170px;
  box-shadow: var(--shadow);
}

.hero__img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  /* La balance est placee a droite du visuel : on ancre le cadrage a droite
     pour ne jamais rogner les plateaux sur les ecrans etroits. */
  object-position: right center;
  opacity: 0.92;
}

.hero__overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px;
  background: linear-gradient(180deg, rgba(15, 42, 68, 0) 0%, rgba(11, 32, 52, 0.86) 58%, rgba(11, 32, 52, 0.96) 100%);
  color: #fff;
}

.hero__date {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.hero__greeting {
  margin-top: 4px;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.hero__sub {
  margin-top: 4px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.86);
}

/* --------------------------------------------------------------- actions rapides */
.quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.quick__item {
  min-height: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-soft);
  transition: transform 0.12s ease;
}

.quick__item:active { transform: scale(0.97); }

.quick__icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--navy-100);
  color: var(--navy);
}

/* --------------------------------------------------------------------- radar */
.disclaimer {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
}

.radar-item {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy);
}

.radar-item--CRITIQUE { border-left-color: var(--red); background: #fffafa; }
.radar-item--ELEVEE { border-left-color: var(--amber); background: #fffdf7; }

.radar-item__days {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 10px;
  background: var(--navy-100);
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
  padding: 6px 2px;
}

.radar-item--CRITIQUE .radar-item__days { background: var(--red-soft); color: var(--red); }
.radar-item--ELEVEE .radar-item__days { background: var(--amber-soft); color: #7a5306; }

.radar-item__days small { font-size: 10px; font-weight: 600; opacity: 0.75; }

.radar-item__body { min-width: 0; }

.radar-item__title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.radar-item__meta {
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--muted);
}

.radar-item__dossier {
  color: var(--navy-600);
  font-weight: 600;
}

/* ------------------------------------------------------------------- boutons */
.btn {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform 0.12s ease, opacity 0.2s ease;
}

.btn:active { transform: scale(0.985); }

.btn[disabled] { opacity: 0.55; pointer-events: none; }

.btn--primary { background: var(--navy); color: #fff; box-shadow: 0 8px 18px rgba(15, 42, 68, 0.22); }
.btn--accent { background: var(--amber); color: #fff; }
.btn--ghost { background: var(--surface); border-color: var(--line); color: var(--navy); }
.btn--danger { background: var(--red); color: #fff; }
.btn--block { width: 100%; margin-top: 14px; }
.btn--sm { min-height: 44px; padding: 0 14px; font-size: 14px; }

.link-btn {
  min-height: 44px;
  padding: 0 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--navy-600);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------- formulaires */
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.fieldset { border: 0; padding: 0; margin: 0 0 12px; }

.label {
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.input,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fbfcfd;
  color: var(--ink);
  font-size: 16px;
  appearance: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.textarea { min-height: 130px; resize: vertical; line-height: 1.55; }

.input:focus,
.textarea:focus {
  border-color: var(--navy-600);
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(23, 64, 95, 0.12);
}

select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%233c4a57' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.textarea__tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.note-field { margin-bottom: 14px; }

.hint {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}

/* Avertissement de transfert hors Union europeenne (secret professionnel). */
.hint--warn {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 12.5px;
  color: #7d1a21;
  background: var(--red-soft);
  border: 1px solid #f3cfd1;
}

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

.form-error {
  min-height: 20px;
  margin: 8px 0 0;
  font-size: 13.5px;
  color: var(--red);
  font-weight: 500;
}

/* --------------------------------------------------------------------- chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--slate);
  font-size: 14.5px;
  font-weight: 600;
}

.chip.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* ---------------------------------------------------------------- segmented */
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: #e9eef3;
}

.segmented__item {
  min-height: 44px;
  border-radius: 11px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--slate);
}

.segmented__item.is-active {
  background: var(--surface);
  color: var(--navy);
  box-shadow: var(--shadow-soft);
}

.panel__title {
  font-size: 17px;
  font-weight: 650;
  color: var(--navy);
  margin-bottom: 4px;
}

/* ----------------------------------------------------------------- recherche */
.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  margin-bottom: 12px;
}

.searchbar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-size: 16px;
  color: var(--ink);
}

.searchbar input:focus { outline: none; }

/* --------------------------------------------------------------- accordéon */
.accordion { margin-bottom: 14px; }

.accordion summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  font-weight: 650;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
}

.accordion summary::-webkit-details-marker { display: none; }

.accordion[open] summary { margin-bottom: 12px; }

/* --------------------------------------------------------------- dossier */
.dossier {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.dossier__name { font-size: 15.5px; font-weight: 650; color: var(--navy); }

.dossier__meta {
  grid-column: 1 / -1;
  font-size: 12.5px;
  color: var(--muted);
}

.dossier__badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--navy-100);
  color: var(--navy-600);
  white-space: nowrap;
}

.dossier__badge--CRITIQUE { background: var(--red-soft); color: var(--red); }
.dossier__badge--ELEVEE { background: var(--amber-soft); color: #7a5306; }
.dossier__badge--CLOS { background: #eef1f4; color: var(--muted); }

/* --------------------------------------------------------------- filepicker */
.filepicker {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin: 10px 0;
  border-radius: var(--radius-sm);
  border: 1.5px dashed #c3d0da;
  background: #fbfdfe;
  color: var(--navy-600);
  font-weight: 600;
  font-size: 14.5px;
}

.filepicker:active { background: var(--navy-100); }

/* ------------------------------------------------------------------- badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--navy-100);
  color: var(--navy);
}

.badge--CRITIQUE { background: var(--red-soft); color: var(--red); }
.badge--ELEVEE { background: var(--amber-soft); color: #7a5306; }
.badge--NORMALE { background: var(--green-soft); color: var(--green); }
.badge--soft { background: #eef1f4; color: var(--slate); font-weight: 600; }

/* ------------------------------------------------------------------- alertes */
.alert {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.45;
}

.alert--danger { background: var(--red-soft); color: #7d1a21; border: 1px solid #f3cfd1; }
.alert--warn { background: var(--amber-soft); color: #6d4a04; border: 1px solid #f0e0bf; }
.alert--info { background: var(--navy-100); color: var(--navy); border: 1px solid #d7e2ec; }

.alert strong { display: block; margin-bottom: 2px; }

/* --------------------------------------------------------------------- prose */
.prose { font-size: 15px; color: var(--ink); line-height: 1.6; }
.prose h1, .prose h2, .prose h3 { color: var(--navy); line-height: 1.3; }
.prose h1 { font-size: 18px; margin: 4px 0 10px; }
.prose h2 { font-size: 15.5px; margin: 16px 0 6px; }
.prose h3 { font-size: 14.5px; margin: 12px 0 4px; }
.prose p { margin: 0 0 10px; }
.prose ul, .prose ol { margin: 0 0 10px; padding-left: 20px; }
.prose li { margin-bottom: 4px; }
.prose strong { font-weight: 650; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  background: #eef2f6;
  padding: 1px 5px;
  border-radius: 5px;
}

.result-card { padding: 16px; }
.result-card + .result-card { margin-top: 12px; }

.section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 16px 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.draft-box {
  white-space: pre-wrap;
  font-size: 14.5px;
  line-height: 1.6;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: #f8fafb;
  border: 1px solid var(--line);
  color: var(--ink);
}

.taglist { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }

.taglist li {
  font-size: 12.5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2f6;
  color: var(--slate);
}

.taglist--warn li { background: var(--amber-soft); color: #6d4a04; }

.list-clean { margin: 6px 0 0; padding-left: 18px; font-size: 14.5px; line-height: 1.55; }
.list-clean li { margin-bottom: 4px; }

/* ------------------------------------------------------------------- états vides */
.empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 14px 22px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.empty__img { width: 220px; height: 138px; object-fit: contain; }

.empty--inline { padding: 14px; }

/* -------------------------------------------------------------------- loading */
.skeleton {
  border-radius: var(--radius-sm);
  background: linear-gradient(100deg, #e9eef3 20%, #f4f7fa 40%, #e9eef3 60%);
  background-size: 220% 100%;
  animation: shimmer 1.3s infinite linear;
}

.skeleton--card { height: 74px; }
.skeleton--line { height: 14px; margin-bottom: 8px; }

@keyframes shimmer {
  from { background-position: 180% 0; }
  to { background-position: -40% 0; }
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------- toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  transform: translateX(-50%) translateY(8px);
  max-width: min(92vw, 460px);
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(22, 33, 43, 0.95);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 60;
  pointer-events: none;
}

.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast--danger { background: rgba(163, 34, 43, 0.96); }
.toast--success { background: rgba(28, 107, 76, 0.96); }

/* --------------------------------------------------------------------- sheet */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet[hidden] { display: none; }

.sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 24, 38, 0.45);
  animation: fade 0.2s ease;
}

.sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.22);
  animation: slideUp 0.26s cubic-bezier(0.22, 0.8, 0.3, 1);
}

@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

.sheet__handle {
  width: 44px;
  height: 5px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: #cdd7df;
}

.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.sheet__title { font-size: 17px; font-weight: 650; color: var(--navy); }

.sheet__body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 24px;
}

/* --------------------------------------------------------------------- login */
.login {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(120% 100% at 50% 0%, #1d4567 0%, #0f2a44 45%, #0b2034 100%);
}

.login__card {
  width: min(100%, 380px);
  padding: 26px 22px;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.login__logo { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 18px; }
.login h2 { font-size: 20px; color: var(--navy); margin-bottom: 6px; }
.login .input { margin-top: 16px; text-align: center; letter-spacing: 0.1em; }
.login #loginAvocat, .login #loginCode { letter-spacing: 0; }

/* ------------------------------------------------------------------- tabbar */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--line);
}

.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 48px;
  font-size: 11px;
  font-weight: 600;
  color: #7b8894;
  transition: color 0.15s ease;
}

.tabbar__item.is-active { color: var(--navy); }

.tabbar__item.is-active svg {
  stroke-width: 2.1;
}

.tabbar__item:active { background: rgba(15, 42, 68, 0.05); }

/* ------------------------------------------------------------------ divers */
.diff {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface);
  font-size: 13.5px;
  line-height: 1.5;
}

.diff + .diff { margin-top: 8px; }
.diff__type { font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.diff__a { margin-top: 4px; color: #7d1a21; text-decoration: line-through; opacity: 0.8; }
.diff__b { margin-top: 4px; color: var(--green); }

.meter {
  height: 6px;
  border-radius: 999px;
  background: #e9eef3;
  overflow: hidden;
  margin-top: 6px;
}

.meter__fill { height: 100%; background: var(--navy); border-radius: 999px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (min-width: 768px) {
  main { padding-left: 24px; padding-right: 24px; }
  .hero__img { height: 220px; }
}

/* ------------------------------------------------- cadre mobile sur ordinateur */
/* Sur un ecran large avec souris, l'application est presentee comme sur un
   telephone : colonne de 460 px centree, ombre de cadre, onglets et feuillets
   alignes sur cette colonne. Les tablettes et telephones (tactile) gardent
   l'affichage plein ecran, y compris en paysage. */
@media (min-width: 900px) and (hover: hover) and (pointer: fine) {
  html {
    background:
      radial-gradient(120% 80% at 50% 0%, #eef2f6 0%, #dde5ec 60%, #d3dce5 100%);
    min-height: 100%;
  }

  body {
    width: 460px;
    margin: 0 auto;
    min-height: 100dvh;
    box-shadow:
      0 0 0 1px #cbd6e0,
      0 18px 50px rgba(11, 32, 52, 0.18),
      0 2px 8px rgba(11, 32, 52, 0.08);
  }

  main {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tabbar {
    left: 50%;
    right: auto;
    width: 460px;
    margin-left: -230px;
  }

  .sheet__panel {
    left: 50%;
    right: auto;
    width: 460px;
    margin-left: -230px;
  }

  .toast {
    max-width: 420px;
  }

  .hero__img { height: 190px; }

  .login {
    background: radial-gradient(120% 100% at 50% 0%, #eef2f6 0%, #dde5ec 60%, #d3dce5 100%);
  }

  .login__card {
    width: min(100%, 400px);
    border: 1px solid var(--line);
  }
}
