/* Salon de tri : charte « néon arcade » (thème sombre unique). Page du salon et page de connexion.
   Jetons validés le 22 octobre (design-reference) ; aucune police ni ressource externe ; icônes en masques SVG. */

:root {
  --bg: #0b0d17;
  --pan: #121628;
  --pan2: #171c33;
  --pan3: #1d2340;
  --bar: #0e1122;
  --line: #262c4a;
  --line-hi: #3a4372;
  --txt: #e7ecff;
  --mut: #8a93b8;

  --cy: #22e3d4;   /* sélection, actions principales, « auto » */
  --pk: #ff4fa3;   /* compteurs */
  --vi: #8b6cff;   /* groupes, À traiter */
  --ye: #ffd25a;   /* missions, séries */
  --rd: #ff5a6e;   /* urgent, corbeille */
  --or: #ff9f43;   /* hors ligne */
  --ink: #06121a;  /* texte sur fond néon */

  /* Teintes des groupes (groups.js, GROUP_COLORS), version néon */
  --g-violet: #8b6cff; --g-aqua: #22e3d4; --g-orange: #ff9f43; --g-magenta: #ff4fa3;
  --g-green: #4be3a0; --g-blue: #5b8cff; --g-yellow: #ffd25a; --g-red: #ff5a6e;

  --r-btn: 8px;
  --r-tile: 10px;
  --r-pan: 12px;
  --r-row: 14px;
  --r-pill: 99px;

  --glow-cy: 0 0 0 1px var(--cy), 0 0 22px -6px var(--cy);
  --glow-rd: 0 0 18px -6px var(--rd);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --bar-h: 0px;

  color-scheme: dark;
}

/* --- Base --- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--txt);
  font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-weight: 500; margin: 0; }
a { color: var(--cy); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(34, 227, 212, .3); }

:focus-visible { outline: 2px solid var(--cy); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50; padding: 10px 14px; border-radius: var(--r-btn);
  background: var(--cy); color: var(--ink); font-weight: 500;
}
.skip:focus { top: 12px; text-decoration: none; }

/* Sans JavaScript : le message remplace la page. */
.no-js .app { display: none; }
.noscript {
  min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; gap: 10px;
  padding: 24px 16px; text-align: center;
}
.noscript-title { margin: 14px 0 0; font-size: 18px; font-weight: 500; }
.noscript-line { margin: 0; color: var(--mut); }

/* --- Logo --- */
.logo { font-weight: 500; letter-spacing: .14em; font-size: 15px; white-space: nowrap; user-select: none; }
.logo .dot { color: var(--cy); text-shadow: 0 0 10px rgba(34, 227, 212, .7); }
.logo-lg { font-size: 22px; }

/* --- Icônes (masques SVG : la couleur suit currentColor) --- */
.ic {
  display: inline-block; flex: none; width: 18px; height: 18px; background-color: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat;
}
.ic-inbox { --ic: url("/static/icons/inbox.svg?v=80dbe136e8"); }
.ic-chevron, .ic-chevron-down { --ic: url("/static/icons/chevron-down.svg?v=d509e26a3e"); }
.ic-search { --ic: url("/static/icons/search.svg?v=c6b371fac0"); }
.ic-settings { --ic: url("/static/icons/settings.svg?v=54f538e225"); }
.ic-refresh { --ic: url("/static/icons/refresh.svg?v=252a231ead"); }
.ic-mailbox { --ic: url("/static/icons/mailbox.svg?v=18dee881a0"); }
.ic-locker { --ic: url("/static/icons/locker.svg?v=f0d6c45d49"); }
.ic-trash { --ic: url("/static/icons/trash.svg?v=89feecd73e"); }
.ic-mail { --ic: url("/static/icons/mail.svg?v=8357baa52a"); }
.ic-mail-open { --ic: url("/static/icons/mail-open.svg?v=0812fc6b05"); }
.ic-check { --ic: url("/static/icons/check.svg?v=dcde218d9e"); }
.ic-alert { --ic: url("/static/icons/alert.svg?v=9ff2203440"); }
.ic-reply { --ic: url("/static/icons/reply.svg?v=6e2bddfa13"); }
.ic-star { --ic: url("/static/icons/star.svg?v=dd23741bbe"); }
.ic-close { --ic: url("/static/icons/close.svg?v=5a1da59d83"); }
.ic-edit { --ic: url("/static/icons/edit.svg?v=6de5cc098a"); }
.ic-merge { --ic: url("/static/icons/merge.svg?v=78915cc6a4"); }
.ic-sparkles { --ic: url("/static/icons/sparkles.svg?v=7b05357ebc"); }
.ic-chevron-right { --ic: url("/static/icons/chevron-right.svg?v=d637c024f4"); }
.ic-scale { --ic: url("/static/icons/scale.svg?v=a6912c778f"); }
.ic-play { --ic: url("/static/icons/play.svg?v=330d7e6e4d"); }
.ic-pause { --ic: url("/static/icons/pause.svg?v=3256cdf2de"); }
.ic-plus { --ic: url("/static/icons/plus.svg?v=392889d759"); }
.ic-devices { --ic: url("/static/icons/devices.svg?v=0030aafdc2"); }
.ic-logout { --ic: url("/static/icons/logout.svg?v=59bc05aa27"); }
.ic-scan { --ic: url("/static/icons/scan.svg?v=7ee7f81c87"); }
.ic-flame { --ic: url("/static/icons/flame.svg?v=13d6568bf5"); }
.ic-calendar { --ic: url("/static/icons/calendar.svg?v=95f58986d8"); }
.ic-bolt { --ic: url("/static/icons/bolt.svg?v=76cf88406c"); }
.ic-lock { --ic: url("/static/icons/lock.svg?v=e210d21a6e"); }
.ic-trophy { --ic: url("/static/icons/trophy.svg?v=ccc9f8b1e0"); }
.ic-chart { --ic: url("/static/icons/chart.svg?v=5f6cfd477a"); }
.ic-target { --ic: url("/static/icons/target.svg?v=eeda6c1b9c"); }
.ic-diamond { --ic: url("/static/icons/diamond.svg?v=e9e39eec08"); }

/* --- Boutons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 0 14px; border-radius: var(--r-btn); border: 1px solid var(--line);
  background: var(--pan2); color: var(--txt); font-weight: 500; white-space: nowrap;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease);
}
.btn:hover { border-color: var(--line-hi); background: var(--pan3); text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn .ic { width: 16px; height: 16px; }
.btn-primary { background: var(--cy); border-color: var(--cy); color: var(--ink); }
.btn-primary:hover { background: #4ff0e3; border-color: #4ff0e3; box-shadow: 0 0 22px -6px var(--cy); }
.btn-ghost { background: transparent; color: var(--cy); border-color: rgba(34, 227, 212, .35); }
.btn-ghost:hover { background: rgba(34, 227, 212, .08); border-color: var(--cy); }
.btn-sm { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.btn.is-busy .ic { animation: spin .9s linear infinite; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-btn);
  color: var(--mut); border: 1px solid transparent;
  transition: color .15s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease);
}
.icon-btn:hover { color: var(--cy); background: var(--pan2); border-color: var(--line); text-decoration: none; }
.icon-btn:active { transform: scale(.95); }

/* --- Page --- */
.app { max-width: 1320px; margin: 0 auto; padding: 14px 20px 40px; }

/* --- Barre du haut --- */
.topbar {
  position: sticky; top: 10px; z-index: 20;
  display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 8px 10px 8px 16px; border-radius: var(--r-pan);
  background: rgba(18, 22, 40, .92); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px -18px #000;
}
.spacer { flex: 1 1 auto; }

.acct-pill {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 280px;
  height: 36px; padding: 0 10px 0 12px; border-radius: var(--r-pill);
  background: var(--pan2); border: 1px solid var(--line); color: var(--cy); cursor: pointer;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.acct-pill:hover { border-color: var(--line-hi); }
.acct-pill:focus-within { border-color: var(--cy); box-shadow: var(--glow-cy); }
.acct-pill select {
  -webkit-appearance: none; appearance: none; min-width: 0; flex: 1 1 auto; height: 100%;
  border: 0; background: transparent; color: var(--txt); font-size: 14px; font-weight: 500;
  padding: 0 22px 0 0; margin-right: -22px; text-overflow: ellipsis; cursor: pointer;
}
.acct-pill select:focus { outline: none; }
.acct-pill option { background: var(--pan); color: var(--txt); }
.acct-pill .ic-chevron { width: 14px; height: 14px; color: var(--mut); pointer-events: none; }

.chip-arb {
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 6px 0 12px; border-radius: var(--r-pill);
  border: 1px solid rgba(139, 108, 255, .55); color: var(--txt); font-size: 13px; font-weight: 500; white-space: nowrap;
  box-shadow: 0 0 18px -8px var(--vi);
}
.chip-arb:hover { border-color: var(--vi); text-decoration: none; background: rgba(139, 108, 255, .08); }
.chip-count, .tab-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--vi); color: #fff; font-size: 12px; font-variant-numeric: tabular-nums;
}

.status { display: flex; align-items: center; gap: 16px; min-width: 0; }
.refresh { display: inline-flex; align-items: center; gap: 8px; color: var(--mut); font-size: 13px; white-space: nowrap; }
.refresh-text { font-variant-numeric: tabular-nums; }
.refresh-short, .check-short { display: none; }
.check { display: inline-flex; align-items: center; gap: 10px; color: var(--mut); font-size: 13px; min-width: 0; }
.check-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tools { display: flex; gap: 2px; }

/* Anneau de rafraîchissement : se remplit pendant les 12 s, tourne pendant la requête, orange hors ligne. */
.ring { width: 20px; height: 20px; flex: none; overflow: visible; }
.ring-track { fill: none; stroke: var(--line); stroke-width: 2.5; }
.ring-fill {
  fill: none; stroke: var(--cy); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: 100;
  transform: rotate(-90deg); transform-origin: 50% 50%; transform-box: fill-box;
  filter: drop-shadow(0 0 3px rgba(34, 227, 212, .55));
}
.ring.is-filling .ring-fill { animation: ring-fill var(--fill-ms, 12000ms) linear forwards; }
.refresh[data-status="loading"] .ring { animation: spin .8s linear infinite; }
.refresh[data-status="loading"] .ring-fill { stroke-dashoffset: 72; animation: none; }
.refresh[data-status="offline"] { color: var(--or); }
.refresh[data-status="offline"] .ring-fill { stroke: var(--or); filter: drop-shadow(0 0 3px rgba(255, 159, 67, .6)); }
.refresh[data-status="offline"] .ring-track { stroke: rgba(255, 159, 67, .25); }
@keyframes ring-fill { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Onglets (iPhone) */
.tabs { display: none; }

/* --- Salon : boîtes aux lettres à gauche, casiers à droite --- */
.salon { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.panel { min-width: 0; background: var(--pan); border: 1px solid var(--line); border-radius: var(--r-pan); padding: 16px; }
.panel:focus { outline: none; }
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; margin-bottom: 14px; }
.panel-head h2 {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mut);
}
.count {
  display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: var(--r-pill);
  background: rgba(255, 79, 163, .14); color: var(--pk); font-size: 12px; letter-spacing: 0; font-variant-numeric: tabular-nums;
}
.count-vi { background: rgba(139, 108, 255, .16); color: #b7a6ff; }

.filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--bg); border: 1px solid var(--line); }
.seg button {
  min-height: 28px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: transparent;
  color: var(--mut); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease);
}
.seg button:hover { color: var(--txt); }
.seg button[aria-pressed="true"] { background: var(--pan2); color: var(--cy); box-shadow: inset 0 0 0 1px rgba(34, 227, 212, .45); }

.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--mut); cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui {
  position: relative; width: 32px; height: 18px; border-radius: var(--r-pill); background: var(--bg); border: 1px solid var(--line-hi);
  transition: background-color .15s var(--ease), border-color .15s var(--ease);
}
.toggle-ui::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--mut);
  transition: transform .18s var(--ease), background-color .15s var(--ease);
}
.toggle input:checked + .toggle-ui { background: rgba(34, 227, 212, .18); border-color: var(--cy); }
.toggle input:checked + .toggle-ui::after { transform: translateX(14px); background: var(--cy); box-shadow: 0 0 8px var(--cy); }
.toggle:has(input:checked) { color: var(--txt); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--cy); outline-offset: 2px; }

/* Données en cours de rechargement (filtre changé) */
.is-stale { opacity: .55; transition: opacity .15s var(--ease); }

/* --- Boîtes aux lettres --- */
.mb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
.mb {
  --st: #c9d1f5;
  position: relative; display: grid; justify-items: center; align-content: start; gap: 2px; min-width: 0;
  padding: 16px 10px 12px; border-radius: var(--r-tile); border: 1px solid var(--line); background: var(--pan2);
  color: var(--txt); text-align: center; text-decoration: none; cursor: pointer;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease), background-color .15s var(--ease), opacity .15s var(--ease);
}
.mb.is-new { animation: rise .24s var(--ease) both; }
.mb.is-open { border-color: rgba(34, 227, 212, .55); background: var(--pan3); }
.mb:hover { border-color: var(--line-hi); background: var(--pan3); transform: translateY(-2px); text-decoration: none; }
.mb:active { transform: translateY(0) scale(.98); }
.mb.is-urgent, .mb.is-vip { --st: var(--rd); border-color: rgba(255, 90, 110, .7); box-shadow: var(--glow-rd); }
.mb.is-todo { --st: var(--vi); border-color: rgba(139, 108, 255, .55); }
.mb.is-read { --st: #4a5382; }
.mb.is-read .mb-name { color: var(--mut); }
.mb.is-selected { --st: var(--cy); border-color: var(--cy); box-shadow: var(--glow-cy); }

.mb-art { width: 52px; height: 46px; margin-bottom: 6px; overflow: visible; }
:is(.mb-art, .dr-art) .mb-body { fill: var(--pan); stroke: var(--st); stroke-width: 1.6; }
:is(.mb-art, .dr-art) .mb-door { fill: none; stroke: var(--st); stroke-width: 1.6; opacity: .75; }
:is(.mb-art, .dr-art) .mb-slot { stroke: var(--st); stroke-width: 1.6; stroke-linecap: round; opacity: .8; }
:is(.mb-art, .dr-art) .mb-post { fill: var(--line-hi); }
:is(.mb-art, .dr-art) .mb-flag { fill: var(--pk); }
:is(.mb-art, .dr-art) .mb-pole { stroke: var(--mut); stroke-width: 1.4; stroke-linecap: round; }
.mb.is-urgent .mb-art .mb-flag, .mb.is-vip .mb-art .mb-flag { fill: var(--rd); }
:is(.mb-art, .dr-art) .mb-flag.is-down { fill: var(--line-hi); }

.mb-badge {
  position: absolute; top: 8px; right: 8px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--pk); color: #2a0618; font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 14px -4px var(--pk);
}
.mb.is-urgent .mb-badge, .mb.is-vip .mb-badge { background: var(--rd); box-shadow: 0 0 14px -4px var(--rd); }
.mb-name { max-width: 100%; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-line { max-width: 100%; font-size: 13px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb.is-urgent .mb-line, .mb.is-vip .mb-line { color: #ff9aa7; }
.mb.is-todo .mb-line { color: #b7a6ff; }

.mb-more {
  display: grid; place-content: center; gap: 4px; min-height: 120px; border-radius: var(--r-tile);
  border: 1px dashed var(--line-hi); background: transparent; color: var(--mut); font-size: 14px; font-weight: 500;
  justify-items: center;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.mb-more:hover { color: var(--cy); border-color: var(--cy); }

/* --- Casiers --- */
.lk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.locker {
  --gc: var(--vi);
  position: relative; display: grid; gap: 2px; align-content: start; min-width: 0;
  padding: 12px 28px 12px 14px; border-radius: var(--r-tile); border: 1px solid var(--line); background: var(--pan2);
  color: var(--txt); text-align: left; cursor: pointer; width: 100%;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease), transform .15s var(--ease);
}
.locker.is-new { animation: rise .24s var(--ease) both; }
.locker:active { transform: scale(.98); }
.locker.is-open { border-color: rgba(34, 227, 212, .55); background: var(--pan3); }
.locker:hover { border-color: var(--line-hi); background: var(--pan3); }
.locker::after {   /* poignée de la porte du casier */
  content: ""; position: absolute; right: 11px; top: 50%; width: 4px; height: 26px; margin-top: -13px;
  border-radius: var(--r-pill); background: var(--line-hi);
}
.locker.is-target { border-color: var(--cy); box-shadow: var(--glow-cy); }
.locker-head { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.locker-head .locker-dot, .locker-head .ic { margin-top: 4px; }
.locker-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--gc); box-shadow: 0 0 10px -1px var(--gc); }
/* Nom entier : sur deux lignes au besoin (jamais « Comman… »). */
.locker-name {
  min-width: 0; font-size: 14px; font-weight: 500; line-height: 1.3; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.locker-row { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.locker-auto {
  flex: none; padding: 1px 7px; border-radius: var(--r-pill); border: 1px solid rgba(34, 227, 212, .5);
  color: var(--cy); font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
}
.locker-count { font-size: 26px; line-height: 1.15; font-weight: 500; font-variant-numeric: tabular-nums; }
.locker-detail { display: block; font-size: 13px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.locker.is-trash { border-color: rgba(255, 90, 110, .5); }
.locker.is-trash:hover { border-color: var(--rd); box-shadow: var(--glow-rd); }
.locker.is-trash .ic-trash { color: var(--rd); width: 16px; height: 16px; }
.locker.is-trash::after { background: rgba(255, 90, 110, .45); }

.g-violet { --gc: var(--g-violet); } .g-aqua { --gc: var(--g-aqua); } .g-orange { --gc: var(--g-orange); } .g-magenta { --gc: var(--g-magenta); }
.g-green { --gc: var(--g-green); } .g-blue { --gc: var(--g-blue); } .g-yellow { --gc: var(--g-yellow); } .g-red { --gc: var(--g-red); }

/* --- Chargement et états vides --- */
.tile-sk, .locker-sk {
  border-radius: var(--r-tile); border: 1px solid var(--line);
  background: linear-gradient(100deg, var(--pan2) 30%, var(--pan3) 50%, var(--pan2) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.tile-sk { min-height: 128px; }
.locker-sk { min-height: 96px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.empty { grid-column: 1 / -1; display: grid; justify-items: center; gap: 6px; padding: 34px 16px 30px; text-align: center; }
.empty .ic { width: 34px; height: 34px; color: var(--line-hi); margin-bottom: 6px; }
.empty-title { margin: 0; font-size: 15px; font-weight: 500; }
.empty-line { margin: 0; font-size: 13px; color: var(--mut); max-width: 36ch; }
.empty .btn { margin-top: 10px; }
.empty.is-offline .ic { color: var(--or); }

/* --- Messages (toasts) --- */
.toasts {
  position: fixed; z-index: 40; left: 50%; bottom: calc(20px + var(--bar-h) + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none;
}
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-radius: var(--r-pan);
  background: var(--pan2); border: 1px solid var(--line-hi); box-shadow: 0 14px 40px -16px #000; font-size: 14px;
  pointer-events: auto; animation: rise .2s var(--ease) both;
}
.toast .ic { margin-top: 1px; }
.toast.is-ok .ic { color: var(--cy); }
.toast.is-error { border-color: rgba(255, 90, 110, .6); }
.toast.is-error .ic { color: var(--rd); }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s var(--ease), transform .2s var(--ease); }

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

/* --- Grand écran étroit (768 à 1180 px) : barre compacte, rien de coupé au milieu d'un mot ---
   Boîte au nom court (main.js), « courrier · 18 min », Vérifier en icône, recherche en icône qui s'ouvre au focus. */
@media (min-width: 768px) and (max-width: 1180px) {
  .topbar { gap: 10px; }
  .acct-pill { max-width: 190px; }
  .check-text { overflow: visible; }
  .check-now { width: 36px; padding: 0; }
  .check-now .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@media (min-width: 768px) and (max-width: 960px) {
  .refresh-text { display: none; }
  .refresh-short { display: inline; }
}

/* --- iPhone (< 768 px, référence 375 × 812) --- */
@media (max-width: 767px) {
  :root { --line: #2a3152; --txt: #eef1ff; --mut: #a3acd1; --bar-h: 146px; }

  .app { padding: 0 0 calc(var(--bar-h) + 16px + env(safe-area-inset-bottom, 0px)); }

  /* En-tête : deux lignes compactes. 1 : logo, anneau « à jour », vérifier (icône), recherche, réglages.
     2 : boîte mail affichée, « courrier dans 18 min ». */
  .topbar {
    position: sticky; top: 0; flex-wrap: wrap; gap: 6px 4px; border-radius: 0;
    padding: calc(4px + env(safe-area-inset-top, 0px)) 6px 8px 16px; border-width: 0 0 1px;
    box-shadow: none;
  }
  .logo { order: 1; font-size: 16px; }
  .spacer { order: 2; }
  .chip-arb { display: none; }
  .status, .check { display: contents; }
  .refresh { order: 3; gap: 6px; margin-right: 2px; }
  .refresh-text, .check-text { display: none; }
  .refresh-short { display: inline; }
  .check-now { order: 4; width: 44px; min-height: 44px; padding: 0; border-color: transparent; color: var(--mut); }
  .check-now:hover { color: var(--cy); }
  .check-now .ic { width: 18px; height: 18px; }
  .check-now .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tools { order: 5; }
  .icon-btn { width: 44px; height: 44px; }
  .acct-pill { order: 6; flex: 1 1 60%; min-width: 170px; max-width: none; height: 40px; }
  .acct-pill select { font-size: 16px; }
  .check-short { order: 7; display: inline; flex: none; margin: 0 10px 0 6px; color: var(--mut); font-size: 13px; white-space: nowrap; }
  .btn-sm { min-height: 36px; }

  .tabs { display: flex; gap: 8px; padding: 12px 16px 0; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab {
    display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 36px; padding: 0 14px;
    border-radius: var(--r-pill); border: 1px solid var(--line); color: var(--mut); font-size: 14px; font-weight: 500;
  }
  .tab:hover { text-decoration: none; color: var(--txt); }
  .tab.is-active { color: var(--txt); border-color: var(--cy); box-shadow: var(--glow-cy); }

  .salon { display: block; margin: 0; padding: 12px 16px 0; }
  .panel.mailboxes { background: transparent; border: 0; padding: 0; }
  .panel-head { margin-bottom: 12px; }
  .filters { width: 100%; justify-content: space-between; }

  /* Une ligne par boîte aux lettres */
  .mb-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .mb {
    grid-template-columns: 40px minmax(0, 1fr) auto; grid-template-rows: auto auto; justify-items: start; align-items: center;
    column-gap: 12px; row-gap: 1px; min-height: 64px; padding: 10px 12px; border-radius: var(--r-row); text-align: left;
  }
  .mb:hover { transform: none; }
  .mb-art { grid-row: 1 / span 2; width: 40px; height: 36px; margin: 0; }
  .mb-name { font-size: 16px; }
  .mb-line { font-size: 13px; }
  .mb-badge { position: static; grid-column: 3; grid-row: 1 / span 2; min-width: 30px; height: 30px; font-size: 14px; }
  .mb-more { min-height: 52px; border-radius: var(--r-row); }
  .tile-sk { min-height: 64px; border-radius: var(--r-row); }

  /* Casiers : barre fixe en bas, défilement horizontal */
  .panel.lockers {
    position: fixed; z-index: 25; left: 0; right: 0; bottom: 0; height: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
    padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); border-radius: 0; border-width: 1px 0 0;
    background: var(--bar); box-shadow: 0 -12px 30px -18px #000;
  }
  .lockers .panel-head { margin: 0 16px 8px; }
  .lockers .panel-head h2 { font-size: 13px; }
  .lk-grid {
    display: flex; gap: 8px; padding: 0 16px 2px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; scrollbar-width: none;
  }
  .lk-grid::-webkit-scrollbar { display: none; }
  .locker { flex: 0 0 auto; width: auto; min-width: 112px; max-width: 176px; padding: 9px 22px 9px 12px; scroll-snap-align: start; }
  .locker::after { right: 9px; height: 22px; margin-top: -11px; }
  .locker-row { margin-top: 2px; }
  .locker-count { font-size: 20px; }
  .locker-auto { font-size: 13px; padding: 0 6px; letter-spacing: .02em; }
  .locker-sk { flex: 0 0 132px; min-height: 80px; }
  .lk-grid .empty { padding: 8px 0; justify-items: start; text-align: left; }
  .lk-grid .empty .ic { display: none; }
}

/* --- Page de connexion --- */
.login-page {
  display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(700px 420px at 15% -10%, rgba(34, 227, 212, .09), transparent 70%),
    radial-gradient(600px 420px at 100% 110%, rgba(255, 79, 163, .07), transparent 70%),
    var(--bg);
}
.login-card {
  width: min(400px, 100%); padding: 34px 28px 26px; border-radius: var(--r-row);
  background: var(--pan); border: 1px solid var(--line);
  box-shadow: 0 30px 80px -40px #000, 0 0 0 1px rgba(34, 227, 212, .05);
  animation: rise .3s var(--ease) both;
}
.login-tag { margin: 8px 0 24px; color: var(--mut); }
.login-form { display: grid; gap: 8px; }
.login-form label { font-size: 13px; color: var(--mut); }
.login-form input {
  height: 46px; padding: 0 14px; border-radius: var(--r-btn); border: 1px solid var(--line);
  background: var(--bar); color: var(--txt); font-size: 16px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.login-form input:hover { border-color: var(--line-hi); }
.login-form input:focus { outline: none; border-color: var(--cy); box-shadow: var(--glow-cy); }
.login-form .btn { margin-top: 10px; min-height: 46px; font-size: 15px; }
.login-error {
  display: flex; gap: 8px; margin: 0 0 18px; padding: 10px 12px; border-radius: var(--r-btn);
  background: rgba(255, 90, 110, .1); border: 1px solid rgba(255, 90, 110, .45); color: #ffc2ca; font-size: 14px;
}
.login-foot { margin: 22px 0 0; font-size: 13px; color: var(--mut); text-align: center; }

/* --- Mouvement réduit : tout est coupé --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
  .ring.is-filling .ring-fill, .refresh[data-status="idle"] .ring-fill { animation: none; stroke-dashoffset: 0; }
  .refresh[data-status="loading"] .ring { animation: none; }
  .tile-sk, .locker-sk { animation: none; }
  .mb:hover { transform: none; }
}

/* ======================================================================
   Tâche 8 : tiroirs, lettres, sélection, bulle de portée, glisser-déposer
   ====================================================================== */

kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 4px;
  border: 1px solid var(--line-hi); background: var(--bg); color: var(--mut);
  font: 500 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.hint-touch { display: none; }
@media (hover: none) {
  .hint-desk { display: none; }
  .hint-touch { display: inline; }
}
.mb-hint { margin: -4px 0 12px; font-size: 13px; color: var(--mut); }
.mb-hint kbd { margin: 0 2px; }
.mb-more-n { font-size: 20px; color: var(--txt); }

/* --- Grand écran : boîtes (ou tiroir) à gauche, bandeau de sélection dessous, casiers collants à droite --- */
@media (min-width: 768px) {
  .salon { grid-template-areas: "main side" "sel side"; grid-template-rows: auto 1fr; }
  .mailboxes, .drawer { grid-area: main; }
  .selbar { grid-area: sel; }
  .lockers { grid-area: side; position: sticky; top: 82px; max-height: calc(100vh - 96px); overflow-y: auto; scrollbar-width: thin; }
  .salon.has-drawer .mailboxes { display: none; }
}

/* Casiers prêts à recevoir la sélection */
.lockers.is-armed .locker { border-color: rgba(34, 227, 212, .3); }
.lockers.is-armed .locker:hover, .lockers.is-armed .locker:focus-visible { border-color: var(--cy); box-shadow: var(--glow-cy); background: var(--pan3); }
.lockers.is-armed .locker.is-trash:hover { border-color: var(--rd); box-shadow: 0 0 0 1px var(--rd), 0 0 22px -6px var(--rd); }
.locker.is-target { border-color: var(--cy); box-shadow: var(--glow-cy); background: var(--pan3); }
.locker.is-trash.is-target { border-color: var(--rd); box-shadow: 0 0 0 1px var(--rd), 0 0 22px -6px var(--rd); }
.locker.is-busy { opacity: .7; }
.locker.is-hit { animation: hit .3s var(--ease); }
@keyframes hit {
  40% { transform: scale(1.04); box-shadow: 0 0 0 2px var(--cy), 0 0 30px -4px var(--cy); }
  100% { transform: none; }
}
.lk-help { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--cy); font-size: 13px; }
.lk-help .btn { flex: none; }
@media (min-width: 768px) { .lk-help { display: none !important; } }

/* --- Bandeau de la sélection --- */
.selbar {
  position: sticky; bottom: 12px; z-index: 15; display: flex; align-items: center; gap: 12px; min-width: 0;
  padding: 10px 10px 10px 12px; border-radius: var(--r-pan);
  background: rgba(18, 22, 40, .96); border: 1px solid rgba(34, 227, 212, .6);
  box-shadow: 0 0 0 1px rgba(34, 227, 212, .12), 0 0 26px -10px var(--cy), 0 18px 40px -22px #000;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: rise .2s var(--ease) both;
}
.selbar-ic {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: var(--r-btn);
  background: rgba(34, 227, 212, .12); color: var(--cy);
}
.selbar-ic .ic { width: 20px; height: 20px; }
.selbar-text { flex: 1 1 auto; min-width: 0; }
.selbar-title { margin: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selbar-line { display: flex; align-items: center; gap: 8px; margin: 1px 0 0; font-size: 13px; color: var(--mut); white-space: nowrap; }
.selbar-help { display: flex; align-items: center; gap: 6px; flex: 0 1 300px; margin: 0; color: var(--cy); font-size: 13px; line-height: 1.35; }
.selbar-help .ic { width: 16px; height: 16px; }
@media (max-width: 1100px) { .selbar-help { display: none; } }

/* --- Pastilles --- */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: var(--r-pill);
  border: 1px solid var(--line-hi); color: var(--mut); font-size: 12px; font-weight: 500; white-space: nowrap;
}
.pill.is-urgent { color: #ffc2ca; border-color: rgba(255, 90, 110, .6); background: rgba(255, 90, 110, .12); }
.pill.is-todo { color: #c9bcff; border-color: rgba(139, 108, 255, .6); background: rgba(139, 108, 255, .12); }
.pill.is-vip { color: #ffb3d6; border-color: rgba(255, 79, 163, .55); }
.pill.is-auto { color: var(--cy); border-color: rgba(34, 227, 212, .45); }
.pill.is-unsure, .pill.is-suspect { color: #ffc994; border-color: rgba(255, 159, 67, .55); }
.pill.is-done { color: #9ff0c9; border-color: rgba(75, 227, 160, .5); }
.pill.is-group { color: var(--txt); }
.pill-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gc); box-shadow: 0 0 8px -1px var(--gc); }
.pill.is-group :last-child { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }

/* --- Tiroir --- */
.drawer { padding: 0; display: flex; flex-direction: column; animation: drawer-in .22s var(--ease) both; }
@keyframes drawer-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.dr-head {
  position: sticky; top: 66px; z-index: 3; display: flex; align-items: center; gap: 12px;
  padding: 14px 12px 14px 16px; border-bottom: 1px solid var(--line);
  background: var(--pan); border-radius: var(--r-pan) var(--r-pan) 0 0;
}
.dr-back { display: none; }
.dr-id { flex: 1 1 auto; display: flex; align-items: center; gap: 12px; min-width: 0; border-radius: var(--r-tile); }
.dr-art { --st: var(--cy); flex: none; width: 44px; height: 40px; overflow: visible; }
.dr-art-ic { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-tile); background: var(--pan2); border: 1px solid var(--line); }
.dr-art-ic .locker-dot { width: 14px; height: 14px; }
.dr-art-ic.is-trash { color: var(--rd); border-color: rgba(255, 90, 110, .5); }
.dr-art-ic.is-read { color: var(--g-aqua); border-color: rgba(34, 227, 212, .45); }
.dr-titles { min-width: 0; }
.dr-title { font-size: 18px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-title:focus { outline: none; }
.dr-title:focus-visible { outline: 2px solid var(--cy); outline-offset: 3px; border-radius: 4px; }
.dr-sub { margin: 1px 0 0; font-size: 13px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-close { flex: none; }
.dr-tabs { align-self: flex-start; margin: 12px 16px 0; }
.dr-body { display: grid; gap: 10px; padding: 14px 16px 16px; min-width: 0; }
.dr-body > .empty { padding: 40px 16px; }
.dr-foot {
  display: flex; justify-content: flex-end; gap: 10px; padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.dr-whole.is-selected, .dr-whole[aria-pressed="true"] { background: rgba(34, 227, 212, .12); border-color: var(--cy); box-shadow: var(--glow-cy); }
.dr-id.is-selected .dr-art { filter: drop-shadow(0 0 6px rgba(34, 227, 212, .6)); }
.dr-loading { display: grid; gap: 10px; }
.letter-sk {
  height: 104px; border-radius: var(--r-tile); border: 1px solid var(--line);
  background: linear-gradient(100deg, var(--pan2) 30%, var(--pan3) 50%, var(--pan2) 70%) 0 0 / 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

/* --- Paquets par type de mail --- */
.packet { border: 1px solid var(--line); border-radius: var(--r-pan); background: rgba(11, 13, 23, .35); min-width: 0; }
.packet.is-open { background: rgba(11, 13, 23, .55); }
.pk-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; padding: 5px 6px 5px 4px; border-radius: var(--r-pan);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: box-shadow .15s var(--ease), background-color .15s var(--ease);
}
.pk-head.is-selected { box-shadow: var(--glow-cy); background: rgba(34, 227, 212, .06); }
.pk-toggle {
  flex: 1 1 220px; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 40px; padding: 0 8px;
  border: 0; border-radius: var(--r-btn); background: transparent; color: var(--txt); text-align: left;
  transition: background-color .15s var(--ease);
}
.pk-toggle:hover { background: var(--pan2); }
.pk-chev .ic { width: 16px; height: 16px; color: var(--mut); transition: transform .18s var(--ease); }
.packet:not(.is-open) .pk-chev .ic { transform: rotate(-90deg); }
.pk-label { min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-label.is-untyped { color: var(--mut); }
.pk-count {
  flex: none; display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 7px; border-radius: var(--r-pill);
  background: rgba(255, 79, 163, .14); color: var(--pk); font-size: 12px; font-variant-numeric: tabular-nums;
}
.pk-age { flex: none; margin-left: auto; font-size: 13px; color: var(--mut); white-space: nowrap; }
.pk-tools { display: flex; flex-wrap: wrap; gap: 2px; }
.pk-tool {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: var(--r-btn);
  border: 1px solid transparent; background: transparent; color: var(--mut); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: color .15s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease);
}
.pk-tool .ic { width: 15px; height: 15px; }
.pk-tool:hover { color: var(--txt); background: var(--pan2); border-color: var(--line); }
.pk-tool.is-primary { color: var(--cy); }
.pk-tool.is-primary:hover { border-color: rgba(34, 227, 212, .45); background: rgba(34, 227, 212, .08); }
.pk-tool.is-claude { color: #b7a6ff; }
.pk-tool.is-claude:hover { border-color: rgba(139, 108, 255, .5); background: rgba(139, 108, 255, .1); }
.pk-tool.is-busy .ic { animation: spin .9s linear infinite; }
.pk-tool:disabled { opacity: .6; cursor: default; }
.pk-letters { display: grid; gap: 8px; padding: 2px 10px 10px; }
.pk-form { display: grid; gap: 6px; margin: 0 10px 10px; padding: 10px 12px; border-radius: var(--r-tile); background: var(--pan2); border: 1px solid var(--line); animation: rise .18s var(--ease) both; }
.pk-form-label { font-size: 13px; color: var(--mut); }
.pk-form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pk-form-row .field { flex: 1 1 200px; }
.pk-form-help { margin: 0; font-size: 13px; color: var(--mut); }

/* --- Lettres --- */
.letter {
  position: relative; display: grid; gap: 4px; min-width: 0; padding: 12px 14px; border-radius: var(--r-tile);
  border: 1px solid var(--line); background: var(--pan2); cursor: pointer;
  -webkit-user-select: none; user-select: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease), opacity .24s var(--ease), transform .24s var(--ease);
}
.letter:hover { border-color: var(--line-hi); background: var(--pan3); }
.letter:focus-visible { outline: 2px solid var(--cy); outline-offset: 2px; }
.letter.is-new { animation: rise .24s var(--ease) both; }
.letter.is-urgent { border-color: rgba(255, 90, 110, .55); box-shadow: var(--glow-rd); }
.letter.is-urgent::before, .letter.is-todo::before {
  content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--rd);
}
.letter.is-todo::before { background: var(--vi); }
.letter.is-done { opacity: .72; }
.letter.is-selected { border-color: var(--cy); box-shadow: var(--glow-cy); background: var(--pan3); }
.letter.is-leaving { opacity: 0; transform: translateX(18px) scale(.98); pointer-events: none; }
.lt-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; font-size: 13px; color: var(--mut); }
.lt-from { min-width: 0; font-weight: 500; color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.letter.is-unread .lt-from::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; vertical-align: 1px;
  background: var(--pk); box-shadow: 0 0 8px var(--pk);
}
.lt-date { flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lt-subject { margin: 0; font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
/* Objet et résumé sélectionnables à la souris (copier un numéro de commande) ; le reste de la lettre sert à la saisir. */
.lt-subject, .lt-summary { -webkit-user-select: text; user-select: text; cursor: text; }
@media (hover: none) {
  .letter { -webkit-touch-callout: none; }
  .lt-subject, .lt-summary { -webkit-user-select: none; user-select: none; cursor: pointer; }
}
.letter.is-unread .lt-subject { font-weight: 500; }
.lt-summary {
  margin: 0; font-size: 13px; color: var(--mut); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.letter.is-selected .lt-summary { -webkit-line-clamp: 6; line-clamp: 6; }
.lt-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.lt-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lt-act {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: var(--r-btn);
  border: 1px solid var(--line); background: transparent; color: var(--mut); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: color .15s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease), transform .1s var(--ease);
}
.lt-act .ic { width: 15px; height: 15px; }
.lt-act:hover { color: var(--txt); border-color: var(--line-hi); background: var(--pan); text-decoration: none; }
.lt-act:active { transform: scale(.96); }
.lt-act:disabled { opacity: .55; cursor: default; }
.lt-act.is-busy .ic { animation: spin .9s linear infinite; }
.lt-act.is-primary { color: var(--cy); border-color: rgba(34, 227, 212, .4); }
.lt-act.is-primary:hover { background: rgba(34, 227, 212, .08); border-color: var(--cy); }
.lt-act.is-on { color: var(--pk); border-color: rgba(255, 79, 163, .5); }
.lt-act.is-danger:hover { color: var(--rd); border-color: rgba(255, 90, 110, .6); background: rgba(255, 90, 110, .08); }

/* --- Réglages d'un casier --- */
.field {
  width: 100%; min-height: 40px; padding: 8px 12px; border-radius: var(--r-btn); border: 1px solid var(--line);
  background: var(--bar); color: var(--txt); font-size: 15px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.field:hover { border-color: var(--line-hi); }
.field:focus { outline: none; border-color: var(--cy); box-shadow: var(--glow-cy); }
textarea.field { resize: vertical; min-height: 76px; line-height: 1.45; }
select.field { -webkit-appearance: none; appearance: none; }
.dr-body.is-form { gap: 0; }
.lk-form { display: grid; gap: 18px; max-width: 560px; }
.lk-field { display: grid; gap: 6px; }
.lk-field > label, .lk-label, .lk-colors legend { margin: 0; font-size: 13px; color: var(--mut); font-weight: 500; }
.lk-help-line { display: block; margin: 0; font-size: 13px; color: var(--mut); }
.lk-colors { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; border: 0; }
.lk-colors legend { padding: 0; margin-bottom: 8px; }
.swatch { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.swatch-ui {
  width: 28px; height: 28px; border-radius: 50%; background: var(--gc); border: 2px solid transparent;
  box-shadow: inset 0 0 0 2px var(--pan); transition: transform .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.swatch:hover .swatch-ui { transform: scale(1.08); }
.swatch input:checked + .swatch-ui { border-color: var(--txt); box-shadow: inset 0 0 0 3px var(--pan), 0 0 14px -2px var(--gc); }
.swatch input:focus-visible + .swatch-ui { outline: 2px solid var(--cy); outline-offset: 2px; }
.lk-toggle { align-items: flex-start; gap: 12px; color: var(--txt); font-size: 14px; }
.lk-toggle .toggle-ui { flex: none; margin-top: 2px; }
.lk-toggle-title { display: block; font-weight: 500; }
.lk-days-row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.field-days { width: 110px; }
.lk-rules { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.lk-rule {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 6px 6px 10px; border-radius: var(--r-btn);
  background: var(--pan2); border: 1px solid var(--line); font-size: 13px; transition: opacity .2s var(--ease);
}
.lk-rule.is-empty { padding: 10px 12px; color: var(--mut); }
.lk-rule.is-leaving { opacity: 0; }
.lk-rule-kind { flex: none; padding: 1px 8px; border-radius: var(--r-pill); background: rgba(139, 108, 255, .16); color: #c9bcff; font-size: 12px; }
.lk-rule-value { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lk-rule-type { color: var(--mut); }
.btn.is-danger { color: var(--mut); border-color: transparent; }
.btn.is-danger:hover { color: var(--rd); border-color: rgba(255, 90, 110, .5); background: rgba(255, 90, 110, .08); }
.lk-actions { display: flex; gap: 10px; }

/* --- Bulle de portée --- */
.bubble {
  position: fixed; z-index: 45; width: 316px; max-width: calc(100vw - 24px); padding: 14px; border-radius: var(--r-pan);
  background: var(--pan2); border: 1px solid var(--cy);
  box-shadow: 0 0 0 1px rgba(34, 227, 212, .18), 0 0 34px -12px var(--cy), 0 26px 60px -24px #000;
  animation: pop .16s var(--ease) both;
}
.bubble.is-trash { border-color: var(--rd); box-shadow: 0 0 0 1px rgba(255, 90, 110, .18), 0 0 34px -12px var(--rd), 0 26px 60px -24px #000; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.bubble.is-above { animation-name: pop-up; }
@keyframes pop-up { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
.bubble-kicker { margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); }
.bubble-title { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; font-size: 16px; }
.bubble-title .ic { color: var(--rd); }
.bubble-sel { margin: 2px 0 0; font-size: 13px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble-count { margin: 2px 0 0; font-size: 13px; font-weight: 600; color: var(--txt); }
.bubble-opts { display: grid; gap: 6px; margin-top: 12px; }
.bubble-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; padding: 6px 12px;
  border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--pan); color: var(--txt); font-size: 14px; text-align: left;
  transition: color .12s var(--ease), border-color .12s var(--ease), background-color .12s var(--ease);
}
.bubble-opt-label { min-width: 0; }
.bubble-opt.is-default { border-color: rgba(34, 227, 212, .45); }
.bubble-opt:hover, .bubble-opt:focus-visible { border-color: var(--cy); color: var(--cy); background: rgba(34, 227, 212, .07); outline: none; }
.bubble.is-trash .bubble-opt:hover, .bubble.is-trash .bubble-opt:focus-visible { border-color: var(--rd); color: #ffc2ca; background: rgba(255, 90, 110, .08); }
.bubble-opt kbd { flex: none; }
.bubble-note { margin: 10px 0 0; font-size: 13px; color: var(--mut); }
.bubble-cancel {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 36px; margin-top: 8px; padding: 0 12px;
  border: 0; border-radius: var(--r-btn); background: transparent; color: var(--mut); font-size: 13px;
}
.bubble-cancel:hover { color: var(--txt); background: var(--pan); }

/* --- Glisser-déposer et vol vers le casier --- */
body.is-dragging, body.is-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.is-dragged { opacity: .45; }
.drag-ghost {
  position: fixed; left: 0; top: 0; z-index: 60; display: flex; align-items: center; gap: 8px; max-width: 280px;
  padding: 8px 12px; border-radius: var(--r-tile); pointer-events: none;
  background: var(--pan2); border: 1px solid var(--cy); color: var(--txt); font-size: 13px; font-weight: 500;
  box-shadow: var(--glow-cy), 0 18px 40px -16px #000;
}
.drag-ghost .ic { color: var(--cy); }
.drag-ghost-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fly {
  position: fixed; z-index: 60; display: grid; place-items: center; width: 36px; height: 28px; border-radius: var(--r-btn);
  background: var(--cy); color: var(--ink); box-shadow: 0 0 18px var(--cy); pointer-events: none;
}
.fly .ic { width: 18px; height: 18px; }

/* --- iPhone : tiroirs plein écran (actions en bas), aide de rangement dans la barre des casiers --- */
@media (max-width: 767px) {
  .selbar { display: none !important; }
  .mb-hint { margin: 0 0 10px; }
  body.drawer-open { overflow: hidden; }
  .drawer {
    position: fixed; inset: 0; z-index: 30; border: 0; border-radius: 0; background: var(--bg);
    animation: sheet-in .24s var(--ease) both;
  }
  @keyframes sheet-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
  .dr-head { position: static; padding: calc(6px + env(safe-area-inset-top, 0px)) 6px 10px 6px; border-radius: 0; background: var(--pan); gap: 8px; }
  .dr-back {
    display: inline-flex; align-items: center; gap: 2px; flex: none; min-height: 44px; padding: 0 8px 0 2px; border: 0; border-radius: var(--r-btn);
    background: transparent; color: var(--cy); font-size: 15px; font-weight: 500;
  }
  .dr-back .ic { transform: rotate(180deg); width: 20px; height: 20px; }
  .dr-close { display: none; }
  .dr-art { width: 36px; height: 32px; }
  .dr-title { font-size: 17px; }
  .dr-tabs { margin: 10px 16px 0; }
  .dr-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; align-content: start; padding: 12px 12px 16px; }
  .dr-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--bar); }
  .dr-foot .btn { flex: 1 1 0; min-height: 48px; font-size: 15px; }
  .dr-whole { flex-grow: 2 !important; }

  /* Pendant un rangement, la barre des casiers passe au-dessus du tiroir. */
  body.has-selection .panel.lockers { z-index: 35; border-top-color: rgba(34, 227, 212, .6); box-shadow: 0 -12px 30px -14px rgba(34, 227, 212, .35); }
  .lockers.is-armed .panel-head h2 { display: none; }
  .lk-help { flex: 1 1 auto; justify-content: space-between; min-width: 0; }
  .lk-help span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lk-help .btn { min-height: 32px; }
  .lockers .panel-head { min-height: 32px; }

  .pk-head { padding: 4px; }
  .pk-toggle { flex-basis: 100%; min-height: 48px; }
  .pk-tools { width: 100%; padding: 0 4px 4px; gap: 6px; }
  .pk-tool { min-height: 44px; border-color: var(--line); flex: 1 1 auto; justify-content: center; }
  .pk-letters { padding: 2px 6px 8px; }
  .pk-form { margin: 0 6px 8px; }
  .pk-form-row .btn { min-height: 44px; }

  .letter { padding: 12px; border-radius: var(--r-row); }
  .lt-head { font-size: 13px; }
  .lt-subject { font-size: 16px; }
  .lt-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
  /* Cinq actions ou plus : rangées de trois, libellés entiers. */
  .lt-actions:has(> :nth-child(5)) { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lt-act { flex-direction: column; justify-content: center; gap: 2px; min-height: 52px; padding: 4px 2px; font-size: 13px; }
  .lt-act span:not(.ic) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .lt-act .ic { width: 18px; height: 18px; }

  .field { font-size: 16px; min-height: 44px; }
  .swatch { width: 44px; height: 44px; }
  .lk-actions .btn { flex: 1 1 0; min-height: 48px; }
  .lk-rule .btn { min-height: 40px; }

  .bubble.is-sheet {
    left: 8px; right: 8px; top: auto; width: auto; max-width: none;
    bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px) + 8px);
    animation-name: sheet-in;
  }
  .bubble.is-sheet .bubble-opt { min-height: 48px; font-size: 15px; }
  .bubble.is-sheet .bubble-opt kbd, .bubble.is-sheet .bubble-cancel kbd { display: none; }
  .bubble.is-sheet .bubble-cancel { min-height: 44px; justify-content: center; }
}

/* --- Mouvement réduit (tâche 8) --- */
@media (prefers-reduced-motion: reduce) {
  .letter-sk { animation: none; }
  .letter.is-leaving { transform: none; }
  .locker.is-hit { animation: none; box-shadow: var(--glow-cy); }
  .fly { display: none; }
}

/* ======================================================================
   Tâche 9 : bandeau des analyses, écrans (À arbitrer, Recherche), recherche de la barre du haut
   ====================================================================== */

/* Pastille À arbitrer (bouton) et onglets (boutons) */
.chip-arb { background: transparent; font-family: inherit; cursor: pointer; transition: border-color .15s var(--ease), background-color .15s var(--ease), box-shadow .15s var(--ease); }
.chip-arb.is-active { border-color: var(--vi); background: rgba(139, 108, 255, .14); box-shadow: 0 0 0 1px var(--vi), 0 0 22px -6px var(--vi); }
.tab { background: transparent; font-family: inherit; cursor: pointer; }
.icon-btn { background: transparent; cursor: pointer; }
.icon-btn.is-active { color: var(--cy); background: var(--pan2); border-color: rgba(34, 227, 212, .45); }

/* Recherche de la barre du haut (grand écran) */
.search {
  position: relative; display: flex; align-items: center; flex: 0 1 220px; min-width: 130px; height: 36px;
  border-radius: var(--r-pill); background: var(--bar); border: 1px solid var(--line); color: var(--mut);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), flex-basis .2s var(--ease);
}
.search:hover { border-color: var(--line-hi); }
.search:focus-within { border-color: var(--cy); box-shadow: var(--glow-cy); flex-basis: 280px; color: var(--cy); }
.search .ic { position: absolute; left: 11px; width: 16px; height: 16px; pointer-events: none; }
.search input {
  width: 100%; height: 100%; min-width: 0; padding: 0 30px 0 34px; border: 0; border-radius: inherit;
  background: transparent; color: var(--txt); font-size: 14px;
}
.search input::placeholder { color: var(--mut); }
.search input:focus { outline: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search-kbd { position: absolute; right: 9px; pointer-events: none; }
.search:focus-within .search-kbd, .search:has(input:not(:placeholder-shown)) .search-kbd { display: none; }
.search-open { display: none; }
/* Barre compacte : la recherche est une icône ; au focus, le champ s'ouvre vers la gauche par-dessus la barre. */
@media (min-width: 768px) and (max-width: 1180px) {
  .search { flex: none; width: 38px; height: 38px; border: 0; background: transparent; }
  .search:hover { background: var(--pan2); }
  .search:focus-within { flex-basis: auto; box-shadow: none; }
  .search .ic { left: auto; right: 11px; z-index: 1; }
  .search input {
    position: absolute; right: 0; top: 0; width: 38px; height: 38px; padding: 0 0 0 38px; border: 1px solid transparent;
    border-radius: var(--r-btn); background: transparent; color: transparent; cursor: pointer;
    transition: width .2s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease);
  }
  .search input::placeholder { color: transparent; }
  .search:focus-within input {
    width: min(300px, 46vw); padding: 0 36px 0 14px; border-color: var(--cy); box-shadow: var(--glow-cy);
    background: var(--bar); color: var(--txt); cursor: text; z-index: 1;
  }
  .search:focus-within input::placeholder { color: var(--mut); }
  .search:focus-within .ic { z-index: 2; }
  .search-kbd { display: none; }
}

/* --- Bandeau des analyses --- */
.runs {
  display: flex; align-items: center; gap: 12px; min-width: 0; margin-top: 12px; padding: 10px 10px 10px 12px;
  border-radius: var(--r-pan); background: var(--pan); border: 1px solid var(--line);
  animation: rise .2s var(--ease) both;
}
.rb-ic { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-btn); background: var(--pan2); color: var(--mut); }
.rb-ic .ic { width: 18px; height: 18px; }
.rb-text { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; }
.rb-label { margin: 0; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rb-detail { margin: 0; font-size: 13px; color: var(--mut); overflow-wrap: anywhere; }
.rb-actions { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.rb-bar { position: relative; height: 6px; margin-top: 6px; border-radius: var(--r-pill); background: var(--bar); overflow: hidden; }
.rb-fill {
  position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); border-radius: inherit;
  background: linear-gradient(90deg, rgba(34, 227, 212, .65), var(--cy)); box-shadow: 0 0 12px -2px var(--cy);
  transition: width .3s var(--ease);
}
.runs:is([data-kind="idle"], [data-kind="busy"]) { padding-block: 6px; background: transparent; border-style: dashed; }
.runs:is([data-kind="idle"], [data-kind="busy"]) .rb-ic { width: 28px; height: 28px; background: transparent; color: var(--cy); }
.runs:is([data-kind="idle"], [data-kind="busy"]) .rb-label { font-weight: 400; color: var(--mut); }
.runs[data-kind="busy"] { min-height: 46px; }
.runs[data-tone="error"] { border-color: rgba(255, 90, 110, .5); border-style: solid; }
.runs[data-tone="error"] .rb-ic { color: var(--rd); }
.runs[data-kind="running"] { border-color: rgba(34, 227, 212, .5); box-shadow: 0 0 24px -14px var(--cy); }
.runs[data-kind="running"] .rb-ic { color: var(--cy); background: rgba(34, 227, 212, .1); }
.runs[data-kind="running"] .rb-ic .ic { animation: scan 1.6s ease-in-out infinite; }
@keyframes scan { 50% { opacity: .35; } }
.runs[data-kind="paused"] { border-color: rgba(255, 210, 90, .5); }
.runs[data-kind="paused"] .rb-ic { color: var(--ye); background: rgba(255, 210, 90, .1); }
.runs[data-kind="paused"] .rb-fill { background: var(--ye); box-shadow: none; }
.runs[data-kind="next"] { border-color: rgba(255, 79, 163, .45); }
.runs[data-kind="next"] .rb-ic { color: var(--pk); background: rgba(255, 79, 163, .1); }
/* Vérifier maintenant : déjà dans la barre du haut sur grand écran. */
@media (min-width: 768px) { .rb-act[data-action="verifier"] { display: none; } }

/* --- Écrans : même cadre que les tiroirs --- */
@media (min-width: 768px) { .salon.has-screen .mailboxes { display: none; } }
.sc-art .ic { width: 20px; height: 20px; }
.sc-art.is-vi { color: #b7a6ff; border-color: rgba(139, 108, 255, .5); }
.sc-art.is-cy { color: var(--cy); border-color: rgba(34, 227, 212, .45); }
.sc-body { gap: 18px; }
.sc-section { display: grid; gap: 10px; min-width: 0; }
.sc-section-head h3 {
  display: flex; align-items: center; gap: 10px; margin: 0;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mut);
}
.sc-section-line { margin: 4px 0 0; font-size: 13px; color: var(--mut); max-width: 70ch; }
.sc-letters { display: grid; gap: 8px; min-width: 0; }
.empty.is-calm .ic { color: var(--cy); filter: drop-shadow(0 0 8px rgba(34, 227, 212, .5)); }
.sc-q { display: none; }

/* Cartes des casiers proposés */
.sg-list { display: grid; gap: 10px; }
.sg-card {
  display: grid; gap: 10px; min-width: 0; padding: 14px; border-radius: var(--r-pan);
  background: var(--pan2); border: 1px solid rgba(139, 108, 255, .35);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), opacity .22s var(--ease), transform .22s var(--ease);
  animation: rise .22s var(--ease) both;
}
.sg-card.is-open { border-color: var(--vi); box-shadow: 0 0 0 1px rgba(139, 108, 255, .4), 0 0 26px -12px var(--vi); }
.sg-card.is-leaving { opacity: 0; transform: translateX(18px); pointer-events: none; }
.sg-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sg-head .locker-dot { width: 12px; height: 12px; }
.sg-titles { flex: 1 1 auto; min-width: 0; }
.sg-kicker { margin: 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #b7a6ff; }
.sg-title { margin: 1px 0 0; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.sg-desc { margin: 0; font-size: 14px; color: var(--mut); }
.sg-examples { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.sg-ex {
  display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr) auto; align-items: baseline; gap: 10px;
  padding: 7px 10px; border-radius: var(--r-btn); background: rgba(11, 13, 23, .45); border: 1px solid var(--line); font-size: 13px;
}
.sg-ex-from { max-width: 18ch; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-ex-subject { color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-ex-age { color: var(--mut); white-space: nowrap; font-variant-numeric: tabular-nums; }
.sg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-form.lk-form { max-width: none; padding-top: 4px; border-top: 1px solid var(--line); gap: 14px; }
.sg-form.pk-form { margin: 0; }

/* --- iPhone : bandeau compact, écrans plein écran, recherche dans l'écran --- */
@media (max-width: 767px) {
  .search { display: none; }
  .search-open { display: inline-grid; }
  .runs { margin: 10px 16px 0; flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
  .runs[data-kind="idle"] { padding: 6px 8px 6px 10px; }
  .rb-text { flex: 1 1 200px; }
  .rb-label { white-space: normal; }
  .rb-actions { width: 100%; justify-content: stretch; }
  .rb-act { flex: 1 1 0; min-height: 44px; }
  .runs[data-kind="idle"] .rb-actions { width: auto; flex: 1 1 100%; }
  body.screen-open { overflow: hidden; }
  .sc-q {
    position: relative; display: flex; align-items: center; color: var(--mut);
  }
  .sc-q .ic { position: absolute; left: 12px; width: 18px; height: 18px; pointer-events: none; }
  .sc-q-input { padding-left: 40px; border-radius: var(--r-pill); }
  .sc-q:focus-within { color: var(--cy); }
  .sg-card { padding: 12px; border-radius: var(--r-row); }
  .sg-ex { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0; }
  .sg-ex-from { grid-column: 1; max-width: none; }
  .sg-ex-age { grid-column: 2; grid-row: 1; }
  .sg-ex-subject { grid-column: 1 / -1; }
  .sg-actions .btn { flex: 1 1 0; min-height: 48px; }
  .sg-form .pk-form-row .btn { min-height: 44px; }
  .tab { min-height: 44px; }
  .empty .btn { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .runs[data-kind="running"] .rb-ic .ic { animation: none; }
  .sg-card.is-leaving { transform: none; }
  .search { transition: none; }
}

/* ======================================================================
   Tâche 10 : écran Réglages, page d'ajout d'une boîte
   ====================================================================== */

.btn-danger { background: var(--rd); border-color: var(--rd); color: #2a0610; }
.btn-danger:hover { background: #ff7a8a; border-color: #ff7a8a; box-shadow: 0 0 22px -6px var(--rd); }
.btn.is-muted { color: var(--mut); }

.st-jumps { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: -2px 0 0; }
.st-jumps::-webkit-scrollbar { display: none; }
.st-jump {
  flex: none; min-height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line);
  background: transparent; color: var(--mut); font-size: 13px; font-weight: 500;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.st-jump:hover { color: var(--cy); border-color: rgba(34, 227, 212, .45); }
.st-section { padding-top: 4px; scroll-margin-top: 140px; }
.st-section h3:focus { outline: none; }
.st-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.st-row {
  display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; min-width: 0;
  padding: 12px 14px; border-radius: var(--r-tile); background: var(--pan2); border: 1px solid var(--line);
}
.st-row.is-empty { color: var(--mut); font-size: 14px; }
.st-row.is-editing { display: block; border-color: rgba(34, 227, 212, .45); box-shadow: 0 0 24px -14px var(--cy); }
.st-row.is-editing .lk-form { max-width: none; }
.st-row.is-trash { border-color: rgba(255, 90, 110, .4); }
.st-row.is-trash .st-row-title .ic { color: var(--rd); width: 16px; height: 16px; }
.st-row-main { flex: 1 1 280px; min-width: 0; display: grid; gap: 3px; }
.st-row-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
.st-name { min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.st-line { margin: 0; font-size: 13px; color: var(--mut); overflow-wrap: anywhere; }
.st-line.is-error { color: #ff9aa7; }
.st-desc { color: var(--txt); opacity: .8; }
.st-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.st-add { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.st-help { margin: 0; font-size: 13px; color: var(--mut); }
.st-help.is-error { color: #ffc2ca; }

.st-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--mut); }
.st-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mut); }
.st-status.is-ok { color: #9ff0c9; } .st-status.is-ok .st-status-dot { background: var(--g-green); box-shadow: 0 0 8px var(--g-green); }
.st-status.is-error { color: #ffc2ca; } .st-status.is-error .st-status-dot { background: var(--rd); box-shadow: 0 0 8px var(--rd); }
.st-status.is-pause { color: #ffe39b; } .st-status.is-pause .st-status-dot { background: var(--ye); }
.st-account.is-error { border-color: rgba(255, 90, 110, .45); }
.st-account.is-pause { opacity: .85; }

.st-rule {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-width: 0; padding: 8px 8px 8px 12px;
  border-radius: var(--r-btn); background: var(--pan2); border: 1px solid var(--line); font-size: 14px;
}
.st-rule-value { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.st-rule-target { display: inline-flex; align-items: center; gap: 6px; color: var(--txt); font-size: 13px; }
.st-rule-target::before { content: "→"; color: var(--mut); margin-right: 2px; }
.st-rule-target.is-trash { color: #ffc2ca; }
.st-rule-target.is-trash .ic { width: 14px; height: 14px; color: var(--rd); }
.lk-rule-kind.is-vip { background: rgba(255, 79, 163, .16); color: #ffb3d6; }
.st-star { color: var(--pk); }
.st-vip-form { display: flex; flex-wrap: wrap; gap: 8px; }
.st-vip-form .st-vip-kind { flex: 0 0 150px; }
.st-vip-form input { flex: 1 1 220px; }

.st-confirm {
  flex: 1 1 100%; display: grid; gap: 10px; padding: 12px; border-radius: var(--r-btn);
  background: rgba(255, 90, 110, .08); border: 1px solid rgba(255, 90, 110, .5); animation: rise .18s var(--ease) both;
}
.st-confirm-text { display: flex; gap: 8px; margin: 0; font-size: 14px; color: #ffd6dc; }
.st-confirm-text .ic { color: var(--rd); margin-top: 1px; }
.st-confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.st-logout { margin-left: auto; }

/* Page d'ajout d'une boîte (formulaires serveur) */
.add-page {
  background:
    radial-gradient(700px 420px at 15% -10%, rgba(34, 227, 212, .08), transparent 70%),
    radial-gradient(600px 420px at 100% 110%, rgba(255, 79, 163, .06), transparent 70%),
    var(--bg);
}
.add-wrap { width: min(620px, 100%); margin: 0 auto; padding: 18px 16px 48px; }
.add-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.add-top .btn { min-height: 44px; }
.add-top .logo { order: 0; }
.add-title { font-size: 24px; }
.add-lead { margin: 6px 0 22px; color: var(--mut); }
.add-card {
  margin-top: 14px; padding: 22px 20px; border-radius: var(--r-row); background: var(--pan); border: 1px solid var(--line);
  box-shadow: 0 30px 80px -50px #000; scroll-margin-top: 16px;
}
.add-card:target { border-color: rgba(34, 227, 212, .55); box-shadow: 0 0 0 1px rgba(34, 227, 212, .2), 0 0 30px -14px var(--cy); }
.add-card h2 { font-size: 17px; }
.add-help { margin: 6px 0 16px; font-size: 14px; color: var(--mut); }
.add-form .btn { min-height: 46px; }
.add-flash { margin: 0 0 8px; padding: 12px 14px; border-radius: var(--r-btn); font-size: 14px; }
.add-flash p { margin: 0; }
.add-flash.is-ok { background: rgba(34, 227, 212, .08); border: 1px solid rgba(34, 227, 212, .45); }
.add-flash.is-error { background: rgba(255, 90, 110, .1); border: 1px solid rgba(255, 90, 110, .45); color: #ffc2ca; }
.add-next { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.add-next form { margin: 0; }

@media (max-width: 767px) {
  .st-row { padding: 12px; border-radius: var(--r-row); }
  .st-actions, .st-confirm-actions { width: 100%; }
  .st-actions .btn, .st-confirm-actions .btn { flex: 1 1 0; min-height: 44px; }
  .st-add .btn { flex: 1 1 100%; min-height: 48px; }
  .st-rule .btn { min-height: 44px; margin-left: auto; }
  .st-vip-form .st-vip-kind { flex: 1 1 100%; }
  .st-vip-form .btn { flex: 1 1 100%; min-height: 48px; }
  .st-jump { min-height: 44px; }
  .st-logout { margin-left: 0; width: 100%; }
  .st-logout .btn { width: 100%; }
  .st-section { scroll-margin-top: 8px; }
}

/* ======================================================================
   Lot 2 : jauges, humeur, série, missions du jour, écran « Moi »
   ====================================================================== */

:root {
  --gr: #4be3a0;   /* vert des jauges pleines, humeur sereine */
  --n-grad: linear-gradient(90deg, #ff5a6e 0%, #ff8a4c 22%, #ffd25a 48%, #9be86a 72%, #4be3a0 88%, #22e3d4 100%);
  /* Courbes du graphique (une teinte par jauge, l'humeur en blanc épais) */
  --c-proprete: #5b8cff; --c-urgents: #ff5a6e; --c-reste: #8b6cff; --c-non_lus: #ff4fa3;
  --c-non_analyses: #22e3d4; --c-rangement: #ff9f43; --c-humeur: #f4f6ff;
}
.c-proprete { --sc: var(--c-proprete); } .c-urgents { --sc: var(--c-urgents); } .c-reste { --sc: var(--c-reste); }
.c-non_lus { --sc: var(--c-non_lus); } .c-non_analyses { --sc: var(--c-non_analyses); } .c-rangement { --sc: var(--c-rangement); }
.c-humeur { --sc: var(--c-humeur); }
.count-ye { background: rgba(255, 210, 90, .14); color: var(--ye); }
.sc-art.is-ye { color: var(--ye); border-color: rgba(255, 210, 90, .5); box-shadow: 0 0 18px -8px var(--ye); }

/* --- Losange d'humeur et flamme --- */
.diamond { --md: var(--mut); width: 18px; height: 18px; flex: none; overflow: visible; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--md) 70%, transparent)); }
.diamond.is-sereine { --md: var(--gr); }
.diamond.is-tendue { --md: var(--ye); }
.diamond.is-debordee { --md: var(--rd); }
.diamond.is-big { width: 56px; height: 56px; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--md) 60%, transparent)); }
.dm-body { fill: var(--md); }
.dm-facet { fill: #fff; opacity: .2; }
.dm-top { stroke: rgba(6, 18, 26, .3); stroke-width: .8; }
.dm-shine { stroke: #fff; stroke-width: 1.4; stroke-linecap: round; opacity: .75; }

.flame { width: 18px; height: 18px; flex: none; overflow: visible; transform-origin: 50% 90%; }
.flame .fl-outer { fill: var(--line-hi); }
.flame .fl-inner { fill: var(--mut); opacity: .35; }
.flame.is-lit { filter: drop-shadow(0 0 5px rgba(255, 159, 67, .7)); animation: flicker 2.4s ease-in-out infinite; }
.flame.is-lit .fl-outer { fill: #ff9f43; }
.flame.is-lit .fl-inner { fill: var(--ye); opacity: 1; }
.flame.is-big { width: 56px; height: 56px; }
.flame.is-big.is-lit { filter: drop-shadow(0 0 14px rgba(255, 159, 67, .6)); }
@keyframes flicker { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.04, .97); } 60% { transform: scale(.98, 1.03); } }

/* --- Pastille de la barre du haut (humeur · série) --- */
.moi-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px 0 9px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--pan2); color: var(--txt); font-size: 13px; font-weight: 500; white-space: nowrap; flex: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
.moi-chip:hover { border-color: rgba(255, 210, 90, .55); background: var(--pan3); }
.moi-chip.is-active { border-color: var(--ye); box-shadow: 0 0 0 1px var(--ye), 0 0 22px -6px var(--ye); }
.moi-mood, .moi-flame { display: inline-flex; }
.moi-chip[data-tone="sereine"] .moi-label { color: #9ff0c9; }
.moi-chip[data-tone="tendue"] .moi-label { color: #ffe39b; }
.moi-chip[data-tone="debordee"] .moi-label { color: #ffb0ba; }
.moi-sep { width: 1px; height: 16px; background: var(--line-hi); }
.moi-streak { color: var(--ye); font-variant-numeric: tabular-nums; min-width: 1ch; }

/* La barre du haut porte l'humeur et la série : la recherche part plus étroite (elle s'élargit au focus). */
@media (min-width: 1181px) { .search { flex-basis: 176px; } }
/* Barre compacte (768 à 1180 px) : losange et flamme sans le libellé (il reste en title et pour les lecteurs d'écran) ;
   la recherche en icône ne garde plus les 130 px de min-width du grand écran (le bouton Vérifier était écrasé). */
@media (min-width: 768px) and (max-width: 1180px) {
  .moi-label, .moi-sep { display: none; }
  .search { min-width: 38px; }
  .check-now { flex: none; }
}

/* --- Bas de page (grand écran) : jauges et missions --- */
.dash { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; align-items: start; }
.dash > .missions:only-child { grid-column: 2; }
body.moi-open .dash { display: none; }

/* --- Panneau des jauges --- */
.needs { display: grid; gap: 14px; }
.nd-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.nd-head .diamond { width: 30px; height: 30px; }
.nd-titles { flex: 1 1 auto; min-width: 0; }
.nd-kicker { margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); font-weight: 500; }
.nd-title { margin: 1px 0 0; font-size: 16px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nd-mood {
  flex: none; display: inline-flex; align-items: baseline; gap: 8px; margin: 0; padding: 4px 12px; border-radius: var(--r-pill);
  border: 1px solid var(--line-hi); font-size: 14px; font-weight: 500;
}
.nd-mood-value { font-variant-numeric: tabular-nums; color: var(--mut); font-size: 13px; }
.nd-mood.is-sereine { color: #9ff0c9; border-color: rgba(75, 227, 160, .5); background: rgba(75, 227, 160, .08); }
.nd-mood.is-tendue { color: #ffe39b; border-color: rgba(255, 210, 90, .5); background: rgba(255, 210, 90, .08); }
.nd-mood.is-debordee { color: #ffb0ba; border-color: rgba(255, 90, 110, .55); background: rgba(255, 90, 110, .08); }

.nd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 18px; margin: 0; padding: 0; list-style: none; }
.nd { --tone: var(--gr); display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start; min-width: 0; padding: 10px 12px; border-radius: var(--r-tile); background: var(--pan2); border: 1px solid var(--line); }
.nd.is-mid { --tone: var(--ye); }
.nd.is-low { --tone: var(--rd); border-color: rgba(255, 90, 110, .35); }
.nd.is-stale { --tone: var(--mut); border-style: dashed; border-color: var(--line-hi); }
.nd-ic {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-tile);
  color: var(--tone); background: color-mix(in srgb, var(--tone) 12%, transparent); border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent);
}
.nd-ic .ic { width: 18px; height: 18px; }
.nd-main { display: grid; gap: 6px; min-width: 0; }
.nd-line { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.nd-label { font-size: 14px; font-weight: 500; }
.nd-pct { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--tone); font-weight: 500; white-space: nowrap; }
.nd.is-stale .nd-pct { color: var(--mut); font-weight: 400; font-style: italic; }
/* Barre : dégradé néon fixé sur toute la piste, découpé à la valeur (une barre pleine finit dans le vert). */
.nd-bar { position: relative; height: 10px; border-radius: var(--r-pill); background: var(--bar); box-shadow: inset 0 0 0 1px var(--line); }
.nd-fill { position: absolute; inset: 0; border-radius: inherit; filter: drop-shadow(0 0 5px color-mix(in srgb, var(--tone) 75%, transparent)); }
.nd-fill::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--n-grad);
  clip-path: inset(0 calc(100% - var(--w, 0%)) 0 0 round 99px); transition: clip-path .8s var(--ease);
}
.nd.is-stale .nd-bar { background: transparent; box-shadow: none; border: 1px dashed var(--line-hi); }
.nd.is-stale .nd-fill { filter: none; }
.nd.is-stale .nd-fill::before { background: repeating-linear-gradient(90deg, rgba(163, 172, 209, .35) 0 6px, transparent 6px 12px); clip-path: none; }
.nd-advice { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 10px; margin-top: 2px; }
.nd-tip { display: inline-flex; align-items: flex-start; gap: 6px; min-width: 0; font-size: 13px; color: var(--txt); opacity: .85; }
.nd-tip .ic { width: 14px; height: 14px; margin-top: 2px; color: var(--ye); }
.nd-act { flex: none; }

/* --- Carte « Mission du jour » --- */
.missions { display: grid; gap: 12px; border-color: rgba(255, 210, 90, .3); box-shadow: 0 0 34px -22px var(--ye); }
.missions.is-complete { border-color: rgba(75, 227, 160, .45); box-shadow: 0 0 34px -18px var(--gr); }
.mc-head { display: flex; align-items: center; gap: 10px; }
.mc-head-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r-btn); background: rgba(255, 210, 90, .12); color: var(--ye); }
.mc-head-ic .ic { width: 18px; height: 18px; }
.mc-kicker { flex: 1 1 auto; margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--ye); font-weight: 500; }
.mc-count { padding: 1px 9px; border-radius: var(--r-pill); background: rgba(255, 210, 90, .14); color: var(--ye); font-size: 13px; font-variant-numeric: tabular-nums; }
.mc-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mission {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-width: 0;
  padding: 10px 10px 10px 12px; border-radius: var(--r-tile); background: var(--pan2); border: 1px solid var(--line);
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.mission.is-done { border-color: rgba(75, 227, 160, .35); background: rgba(75, 227, 160, .05); }
.mc-check { width: 28px; height: 28px; overflow: visible; }
.mc-ring { fill: none; stroke: var(--line-hi); stroke-width: 1.6; transition: fill .2s var(--ease), stroke .2s var(--ease); }
.mc-tick { fill: none; stroke: var(--ink); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.mission.is-done .mc-ring { fill: var(--gr); stroke: var(--gr); }
.mission.is-done .mc-tick { stroke-dashoffset: 0; }
.mission.is-done .mc-check { filter: drop-shadow(0 0 6px rgba(75, 227, 160, .6)); }
.mission.is-just-done .mc-check { animation: check-pop .5s var(--ease) both; }
.mission.is-just-done .mc-tick { animation: check-draw .45s .12s var(--ease) both; }
.mission.is-just-done { animation: mission-glow 1.2s var(--ease) both; }
@keyframes check-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.18); } 100% { transform: none; } }
@keyframes check-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes mission-glow { 0% { box-shadow: 0 0 0 1px var(--gr), 0 0 30px -4px var(--gr); } 100% { box-shadow: none; } }
.mc-main { display: grid; gap: 6px; min-width: 0; }
.mc-title { margin: 0; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.mission.is-done .mc-title { color: var(--mut); }
.mc-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mc-bar { position: relative; flex: 1 1 auto; height: 6px; border-radius: var(--r-pill); background: var(--bar); overflow: hidden; }
.mc-fill {
  position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: inherit;
  background: linear-gradient(90deg, rgba(255, 210, 90, .7), var(--ye)); box-shadow: 0 0 10px -2px var(--ye); transition: width .7s var(--ease);
}
.mission.is-done .mc-fill { background: var(--gr); box-shadow: 0 0 10px -2px var(--gr); }
.mc-prog { flex: none; font-size: 13px; color: var(--mut); font-variant-numeric: tabular-nums; }
.mc-gain { flex: none; padding: 0 7px; border-radius: var(--r-pill); border: 1px solid rgba(75, 227, 160, .45); color: #9ff0c9; font-size: 13px; font-variant-numeric: tabular-nums; }
.mc-gain-unit { color: var(--mut); }
.mc-act { flex: none; }
.mc-empty { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 12px; border-radius: var(--r-tile); background: var(--pan2); font-size: 14px; color: var(--mut); }
.mc-empty .ic { color: var(--gr); }
.mc-foot { margin: 0; font-size: 13px; color: var(--mut); }

/* --- Écran « Moi » --- */
.moi-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 10px; }
.mh-card {
  display: flex; align-items: center; gap: 16px; min-width: 0; padding: 16px; border-radius: var(--r-pan);
  background: radial-gradient(260px 140px at 0% 50%, rgba(255, 255, 255, .03), transparent 70%), var(--pan2); border: 1px solid var(--line);
}
.mh-mood.is-sereine { border-color: rgba(75, 227, 160, .4); background: radial-gradient(260px 140px at 0% 50%, rgba(75, 227, 160, .12), transparent 70%), var(--pan2); }
.mh-mood.is-tendue { border-color: rgba(255, 210, 90, .4); background: radial-gradient(260px 140px at 0% 50%, rgba(255, 210, 90, .1), transparent 70%), var(--pan2); }
.mh-mood.is-debordee { border-color: rgba(255, 90, 110, .45); background: radial-gradient(260px 140px at 0% 50%, rgba(255, 90, 110, .12), transparent 70%), var(--pan2); }
.mh-streak.is-lit { border-color: rgba(255, 159, 67, .4); background: radial-gradient(260px 140px at 0% 50%, rgba(255, 159, 67, .12), transparent 70%), var(--pan2); }
.mh-text { min-width: 0; display: grid; gap: 2px; }
.mh-kicker { margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mut); }
.mh-value { display: flex; align-items: baseline; gap: 8px; margin: 0; font-size: 26px; line-height: 1.15; font-weight: 500; }
.mh-num { font-size: 15px; color: var(--mut); font-variant-numeric: tabular-nums; }
.mh-unit { font-size: 14px; color: var(--mut); font-weight: 400; }
.mh-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 2px 0 0; font-size: 13px; color: var(--mut); }
.mh-joker { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: var(--r-pill); border: 1px solid rgba(255, 210, 90, .45); color: #ffe39b; }
.mh-joker .ic { width: 13px; height: 13px; }
.mh-joker.is-used { border-color: var(--line-hi); color: var(--mut); }
/* Pas de défilement ici : dans la grille de l'écran, un conteneur défilant serait écrasé à 0 de haut. */
.moi-seg { justify-self: start; max-width: 100%; flex-wrap: wrap; border-radius: var(--r-tile); }
.moi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.moi-grid .panel { padding: 14px; }
.moi-grid .nd-list { grid-template-columns: minmax(0, 1fr); }

/* Graphique des 30 jours */
.ch-frame { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 6px; }
.ch-y { position: relative; height: 200px; }
.ch-y span { position: absolute; right: 2px; transform: translateY(-50%); font-size: 13px; color: var(--mut); font-variant-numeric: tabular-nums; }
.ch-y-100 { top: 0; } .ch-y-75 { top: 25%; } .ch-y-40 { top: 60%; } .ch-y-0 { top: 100%; }
.ch-area { min-width: 0; }
.ch-plot {
  display: block; width: 100%; height: 200px; overflow: visible; border-radius: var(--r-btn); cursor: crosshair; touch-action: pan-y;
  background: linear-gradient(180deg, rgba(255, 255, 255, .015), transparent);
}
.ch-band.is-high { fill: rgba(75, 227, 160, .05); }
.ch-band.is-mid { fill: rgba(255, 210, 90, .035); }
.ch-band.is-low { fill: rgba(255, 90, 110, .05); }
.ch-grid { fill: none; stroke: var(--line-hi); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.ch-line { fill: none; stroke: var(--sc); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; opacity: .85; }
.ch-line.is-mood { stroke-width: 3.6; opacity: 1; filter: drop-shadow(0 0 4px rgba(231, 236, 255, .5)); }
.ch-cursor { fill: none; stroke: rgba(34, 227, 212, .6); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.ch-dot { fill: none; stroke: var(--c-humeur); stroke-width: 10; stroke-linecap: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px rgba(34, 227, 212, .9)); }
.ch-x { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--mut); }
.ch-read { display: grid; gap: 6px; min-height: 64px; padding: 10px 12px; border-radius: var(--r-tile); background: var(--pan2); border: 1px solid var(--line); }
.ch-read-day { margin: 0; font-size: 14px; font-weight: 500; }
.ch-read-none { margin: 0; font-size: 13px; color: var(--mut); }
.ch-read-list { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--mut); }
.ch-read-item { display: inline-flex; align-items: center; gap: 6px; }
.ch-read-item b { color: var(--txt); font-weight: 500; font-variant-numeric: tabular-nums; }
.ch-read-item.c-humeur b { color: var(--txt); }
.ch-read-item.is-off { opacity: .45; }
.ch-swatch { flex: none; width: 14px; height: 4px; border-radius: var(--r-pill); background: var(--sc); box-shadow: 0 0 6px -1px var(--sc); }
.c-humeur .ch-swatch, .ch-key.is-mood .ch-swatch { height: 6px; }
.ch-legend { display: flex; flex-wrap: wrap; gap: 6px; }
.ch-plot:focus { outline: none; }
.ch-plot:focus-visible { outline: 2px solid var(--cy); outline-offset: 3px; }
.ch-plot:focus-visible .ch-cursor { stroke: var(--cy); stroke-dasharray: none; }
.moi-stale {
  display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 8px 12px; border-radius: var(--r-btn);
  background: rgba(255, 159, 67, .08); border: 1px solid rgba(255, 159, 67, .45); color: #ffd3a8; font-size: 13px;
}
.moi-stale .ic { width: 16px; height: 16px; margin-top: 1px; color: var(--or); }
.ch-key {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: transparent; color: var(--txt); font-size: 13px; font-weight: 500;
  transition: color .15s var(--ease), border-color .15s var(--ease), opacity .15s var(--ease);
}
.ch-key:hover { border-color: var(--line-hi); }
.ch-key[aria-pressed="true"] { border-color: color-mix(in srgb, var(--sc) 45%, transparent); }
.ch-key[aria-pressed="false"] { color: var(--mut); }
.ch-key[aria-pressed="false"] .ch-swatch { background: transparent; box-shadow: inset 0 0 0 1px var(--sc); }

/* Calendrier de la série */
.cal { display: grid; gap: 6px; max-width: 420px; }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-wd { text-align: center; font-size: 13px; color: var(--mut); }
.cal-cell {
  position: relative; display: grid; place-items: center; aspect-ratio: 1; min-height: 36px; border-radius: var(--r-btn);
  border: 1px dashed var(--line-hi); color: var(--mut); font-size: 13px; font-variant-numeric: tabular-nums;
}
.cal-cell.is-blank { border: 0; }
.cal-cell.is-sereine { border: 1px solid rgba(75, 227, 160, .6); background: rgba(75, 227, 160, .16); color: #c9f7e2; box-shadow: 0 0 14px -6px var(--gr); }
.cal-cell.is-tendue { border: 1px solid rgba(255, 210, 90, .5); background: rgba(255, 210, 90, .12); color: #ffe9b0; }
.cal-cell.is-debordee { border: 1px solid rgba(255, 90, 110, .55); background: rgba(255, 90, 110, .13); color: #ffc2ca; }
.cal-cell.is-joker { border: 1px dashed rgba(255, 210, 90, .7); background: rgba(255, 210, 90, .05); color: #ffe39b; }
.cal-cell.is-today { outline: 2px solid var(--cy); outline-offset: 2px; color: var(--txt); }
.cal-joker { position: absolute; top: 3px; right: 3px; display: inline-flex; color: var(--ye); }
.cal-joker .ic { width: 10px; height: 10px; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--mut); }
.cal-legend li { display: inline-flex; align-items: center; gap: 6px; }
.cal-dot { width: 12px; height: 12px; border-radius: 3px; border: 1px dashed var(--line-hi); }
.cal-dot.is-sereine { border: 0; background: var(--gr); box-shadow: 0 0 8px -1px var(--gr); }
.cal-dot.is-tendue { border: 0; background: var(--ye); }
.cal-dot.is-debordee { border: 0; background: var(--rd); }
.cal-dot.is-joker { border-color: var(--ye); }

/* Succès */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.ach {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: start; min-width: 0; padding: 12px;
  border-radius: var(--r-tile); background: var(--pan2); border: 1px solid var(--line);
}
.ach-medal { position: relative; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; }
.ach-medal > .ic { width: 22px; height: 22px; }
.ach.is-unlocked { border-color: rgba(255, 210, 90, .5); box-shadow: 0 0 26px -14px var(--ye); }
.ach.is-unlocked .ach-medal {
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--ye) 45%, #ff9f43 100%); color: #3a2400;
  box-shadow: 0 0 0 3px rgba(255, 210, 90, .18), 0 0 20px -4px var(--ye);
}
.ach.is-locked .ach-medal { background: var(--bar); border: 1px dashed var(--line-hi); color: var(--line-hi); }
.ach-lock {
  position: absolute; right: -3px; bottom: -3px; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  background: var(--pan); border: 1px solid var(--line-hi); color: var(--mut);
}
.ach-lock .ic { width: 12px; height: 12px; }
.ach-text { display: grid; gap: 3px; min-width: 0; }
.ach-name { margin: 0; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.ach.is-locked .ach-name { color: #c3c9e6; }
.ach-cond { margin: 0; font-size: 13px; color: var(--mut); overflow-wrap: anywhere; }
.ach-date { margin: 2px 0 0; font-size: 13px; color: var(--ye); }
.ach-prog { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.ach-bar { position: relative; flex: 1 1 auto; height: 5px; border-radius: var(--r-pill); background: var(--bar); overflow: hidden; }
.ach-fill { position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: inherit; background: var(--mut); transition: width .7s var(--ease); }
.ach-count { flex: none; font-size: 13px; color: var(--mut); font-variant-numeric: tabular-nums; }
.ach-state { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* --- iPhone : pastille compacte en haut, « Moi » en onglet, pas de bas de page --- */
@media (max-width: 767px) {
  .dash { display: none !important; }
  .moi-chip { order: 3; height: 44px; gap: 4px; padding: 0 6px; border-color: transparent; background: transparent; }
  /* Place de la pastille : sur iPhone, « à jour » n'est plus écrit (l'anneau suffit) ; « hors ligne » reste écrit. */
  .refresh:not([data-status="offline"]) .refresh-short { display: none; }
  .moi-label, .moi-sep { display: none; }
  .moi-streak { font-size: 15px; }
  .mh-card { padding: 14px; gap: 14px; border-radius: var(--r-row); }
  .diamond.is-big, .flame.is-big { width: 46px; height: 46px; }
  .mh-value { font-size: 24px; }
  .moi-seg button { min-height: 44px; }
  .moi-retry { min-height: 44px; }
  .nd { padding: 10px; border-radius: var(--r-row); }
  .nd-act, .mc-act { min-height: 44px; }
  .nd-advice .nd-act { flex: 1 1 100%; }
  .mission { grid-template-columns: 28px minmax(0, 1fr); border-radius: var(--r-row); }
  .mission .mc-act { grid-column: 1 / -1; width: 100%; }
  .ch-y, .ch-plot { height: 170px; }
  .ch-key { min-height: 44px; }
  .ach-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ach { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px 10px; border-radius: var(--r-row); }
  .ach-medal { width: 42px; height: 42px; }
  .cal { max-width: none; }
  /* Détails lisibles sur iPhone : 13 px au moins, intitulés en capitales compris. */
  .mh-kicker, .nd-kicker, .mc-kicker, .count-ye, .mc-count { font-size: 13px; }
  /* Intitulés en capitales du lot 1 (panneaux, sections des écrans, bulle, casiers proposés) : 13 px aussi. */
  .panel-head h2, .sc-section-head h3, .bubble-kicker, .sg-kicker { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .flame.is-lit { animation: none; }
  .mission.is-just-done, .mission.is-just-done .mc-check { animation: none; }
  .mission.is-just-done .mc-tick { animation: none; stroke-dashoffset: 0; }
  .nd-fill::before { transition: none; }
}

/* ======================================================================
   Lot 3 : Claude dans le salon (avatar et niveau, fiabilité des casiers, « Claude propose », urgence d'une lettre,
   écran « Ce que Claude a appris »)
   ====================================================================== */

:root {
  --info: #5b8cff;   /* urgence Info */
}
.count-cy { background: rgba(34, 227, 212, .14); color: var(--cy); }
.tab-count.is-cy { background: var(--cy); color: var(--ink); }

/* --- Avatar du facteur dans son anneau de niveau --- */
.avatar { position: relative; display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; }
.avatar.is-sm { width: 24px; height: 24px; }
.avatar.is-lg { width: 96px; height: 96px; }
.av-svg { width: 100%; height: 100%; overflow: visible; }
.av-track { fill: none; stroke: var(--line-hi); stroke-width: 3; }
.av-fill {
  --rc: var(--cy);
  fill: none; stroke: var(--rc); stroke-width: 3; stroke-linecap: round;
  stroke-dasharray: 100; stroke-dashoffset: calc(100 - var(--p, 0) * 100);
  transform: rotate(-90deg); transform-origin: 50% 50%; transform-box: fill-box;
  filter: drop-shadow(0 0 2.5px color-mix(in srgb, var(--rc) 80%, transparent));
  transition: stroke-dashoffset .8s var(--ease);
}
.avatar.is-learning .av-fill { --rc: var(--vi); }
.avatar.is-max .av-fill { --rc: var(--ye); }
.avatar.is-lg .av-track, .avatar.is-lg .av-fill { stroke-width: 2.4; }
.av-head { fill: #1d2340; stroke: rgba(34, 227, 212, .35); stroke-width: .9; }
.av-cap { fill: #7258f2; }
.av-visor { fill: #4b38c6; }
.av-badge { fill: var(--ye); }
.av-flap { fill: none; stroke: #6b4e00; stroke-width: .7; stroke-linejoin: round; }
.av-eye { fill: var(--cy); filter: drop-shadow(0 0 1.5px rgba(34, 227, 212, .9)); }
.av-smile { fill: none; stroke: var(--cy); stroke-width: 1.3; stroke-linecap: round; }
.av-level {
  position: absolute; right: -4px; bottom: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-pill);
  background: var(--cy); color: var(--ink); font-size: 11px; font-weight: 500; line-height: 16px; text-align: center;
  font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--pan);
}
.avatar.is-learning .av-level { background: var(--vi); color: #fff; }
.avatar.is-max .av-level { background: var(--ye); }
.avatar.is-sm .av-level { display: none; }
.avatar.is-lg .av-level { right: -2px; bottom: 0; min-width: 30px; height: 30px; font-size: 16px; line-height: 30px; box-shadow: 0 0 0 3px var(--pan2), 0 0 16px -4px var(--cy); }

/* --- Barre du haut : avatar, « Claude · facteur niv. N », « précision 91 % » --- */
.claude-chip {
  display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 9px 0 3px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--pan2); color: var(--txt); white-space: nowrap; flex: none; text-align: left;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
.claude-chip:hover { border-color: rgba(34, 227, 212, .5); background: var(--pan3); }
.claude-chip.is-active { border-color: var(--cy); box-shadow: var(--glow-cy); }
.cl-avatar { display: inline-flex; }
.cl-text { display: grid; line-height: 1.15; }
.cl-chip-name { font-size: 13px; font-weight: 500; }
.cl-chip-rate { font-size: 12px; color: var(--cy); font-variant-numeric: tabular-nums; }
/* Passage de palier : l'anneau éclate, l'avatar sursaute, la pastille s'illumine (coupé par prefers-reduced-motion). */
.claude-chip.is-levelup { animation: lv-glow 1.6s var(--ease) both; }
.claude-chip.is-levelup .avatar::after {
  content: ""; position: absolute; inset: -1px; border-radius: 50%; border: 2px solid var(--cy); pointer-events: none;
  animation: lv-burst 1.1s var(--ease) both;
}
.claude-chip.is-levelup .av-svg { animation: lv-pop .6s var(--ease) both; }
@keyframes lv-burst { from { transform: scale(.9); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
@keyframes lv-pop { 0% { transform: none; } 40% { transform: scale(1.18) rotate(-6deg); } 100% { transform: none; } }
@keyframes lv-glow { 0% { box-shadow: 0 0 0 1px var(--cy), 0 0 32px -2px var(--cy); } 100% { box-shadow: none; } }
/* La barre porte maintenant Claude : « Vérifier maintenant » passe en icône sur tout grand écran (libellé en aria-label et
   title, comme dans la barre compacte) pour laisser la place au nom de la boîte et à « courrier · 30 min ». */
@media (min-width: 1181px) {
  .search { flex-basis: 120px; }
  .check-now { width: 36px; padding: 0; flex: none; }
  .check-now .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* En dessous de 1320 px (barre plus étroite que son maximum), l'avatar seul : le texte reste en title et pour les lecteurs d'écran. */
@media (min-width: 768px) and (max-width: 1319px) {
  .claude-chip { padding: 0 3px; gap: 0; }
  .claude-chip .cl-text { display: none; }
}

/* --- Casiers : fiabilité de Claude, « Claude range seul », Lus --- */
.locker-claude { --rt: var(--cy); display: flex; align-items: center; gap: 5px; min-width: 0; margin-top: 6px; font-size: 13px; color: var(--mut); }
.locker-claude .ic { width: 13px; height: 13px; color: var(--rt); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--rt) 70%, transparent)); }
.lk-rel-bar {
  position: relative; flex: 0 0 44px; height: 4px; border-radius: var(--r-pill); overflow: hidden;
  background: var(--bar); box-shadow: inset 0 0 0 1px var(--line);
}
.lk-rel-fill {
  position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: inherit;
  background: var(--rt, var(--cy)); box-shadow: 0 0 8px -1px var(--rt, var(--cy)); transition: width .7s var(--ease);
}
.lk-rel-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.is-high { --rt: var(--gr); }
.is-mid { --rt: var(--ye); }
.is-low { --rt: var(--rd); }
.is-learning { --rt: var(--vi); }
.locker-claude.is-learning .lk-rel-fill, .cl-rel.is-learning .lk-rel-fill {
  background: repeating-linear-gradient(90deg, var(--vi) 0 5px, rgba(139, 108, 255, .45) 5px 8px); box-shadow: none;
}
.locker-rel-short { display: none; }
.locker-solo { color: var(--cy); }   /* en ligne : la ligne secondaire reste coupée par « … » sur un casier étroit */
.locker-solo .ic { width: 13px; height: 13px; margin-right: 3px; vertical-align: -2px; }
.locker.is-autofile { border-color: rgba(34, 227, 212, .3); }
.locker.is-read { --gc: var(--g-aqua); border-color: rgba(34, 227, 212, .25); }
.locker.is-read .ic-mail-open { width: 16px; height: 16px; color: var(--g-aqua); }
.locker.is-read::after { background: rgba(34, 227, 212, .3); }
/* Pendant un rangement, Lus n'est pas une cible. */
.lockers.is-armed .locker.is-read, body.is-dragging .locker.is-read { opacity: .45; cursor: not-allowed; }

/* --- Lettre : correction d'urgence --- */
.lt-urg {
  position: relative; gap: 4px; padding: 0 6px 0 9px; background: transparent; font: inherit; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: border-color .15s var(--ease), box-shadow .15s var(--ease), color .15s var(--ease);
}
.lt-urg .ic { width: 12px; height: 12px; opacity: .8; transition: transform .15s var(--ease); }
.lt-urg:hover { border-color: var(--cy); color: var(--txt); }
.lt-urg[aria-expanded="true"] { border-color: var(--cy); box-shadow: var(--glow-cy); color: var(--txt); }
.lt-urg[aria-expanded="true"] .ic { transform: rotate(180deg); }
.pill.is-info, .pill.is-useless { color: var(--mut); border-color: var(--line); background: transparent; }
.pill.is-useless { border-style: dashed; }
/* Info et Inutile sur chaque lettre : discrets (contour seul, gris) ; la teinte revient au survol ou à l'ouverture. */
.lt-urg.is-info, .lt-urg.is-useless { font-weight: 400; }
.lt-urg.is-info .ic, .lt-urg.is-useless .ic { opacity: .55; }
.cl-urg.is-info { color: #b9ccff; border-color: rgba(91, 140, 255, .5); }
.lt-urgency {
  display: grid; gap: 8px; margin-top: 4px; padding: 10px; border-radius: var(--r-btn); cursor: default;
  background: rgba(11, 13, 23, .55); border: 1px solid rgba(34, 227, 212, .35);
}
.lt-urgency.is-new { animation: rise .18s var(--ease) both; }   /* à l'ouverture seulement */
.lt-urgency-label { margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--cy); font-weight: 500; }
.lt-urgency-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.lt-urg-opt {
  --ut: var(--mut);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 34px; padding: 0 8px;
  border-radius: var(--r-btn); border: 1px solid var(--line); background: var(--pan); color: var(--txt); font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background-color .15s var(--ease);
}
.lt-urg-opt.is-urgent { --ut: var(--rd); }
.lt-urg-opt.is-todo { --ut: var(--vi); }
.lt-urg-opt.is-info { --ut: var(--info); }
.lt-urg-opt.is-useless { --ut: var(--mut); }
.lt-urg-opt:hover { border-color: var(--ut); }
.lt-urg-opt[aria-pressed="true"] { border-color: var(--ut); background: color-mix(in srgb, var(--ut) 14%, var(--pan)); box-shadow: 0 0 0 1px var(--ut), 0 0 18px -8px var(--ut); }
.lt-urg-opt.is-busy { opacity: .6; }
.lt-urg-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ut); box-shadow: 0 0 8px -1px var(--ut); }
.lt-urgency-help { margin: 0; font-size: 12px; color: var(--mut); }

/* --- Cartes « Claude propose » --- */
/* Grand écran : sous les jauges et « Mission du jour », une rangée « Claude propose » sur toute la largeur (cartes côte à côte). */
.dash > .missions:first-child { grid-column: 2; }
.dash > .proposals { grid-column: 1 / -1; }
.dash .pp-list { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.proposals { display: grid; gap: 12px; border-color: rgba(34, 227, 212, .3); box-shadow: 0 0 34px -22px var(--cy); }
.pp-head { display: flex; align-items: center; gap: 10px; }
.pp-head-av { display: inline-flex; }
.pp-kicker { flex: 1 1 auto; margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--cy); font-weight: 500; }
.pp-count { padding: 1px 9px; border-radius: var(--r-pill); background: rgba(34, 227, 212, .14); color: var(--cy); font-size: 13px; font-variant-numeric: tabular-nums; }
.pp-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.pp-card {
  --pt: var(--cy);
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; min-width: 0; padding: 12px; border-radius: var(--r-tile);
  background: linear-gradient(90deg, color-mix(in srgb, var(--pt) 7%, transparent), transparent 55%), var(--pan2);
  border: 1px solid var(--line);
  transition: opacity .22s var(--ease), transform .22s var(--ease), border-color .15s var(--ease);
}
.pp-card.is-new { animation: rise .22s var(--ease) both; }   /* nouvelles cartes seulement (pas à chaque reconstruction) */
.pp-card:hover { border-color: color-mix(in srgb, var(--pt) 40%, var(--line)); }
.pp-card.is-rd { --pt: var(--rd); }
.pp-card.is-aq { --pt: var(--g-aqua); }
.pp-card.is-vi { --pt: var(--vi); }
.pp-card.is-leaving { opacity: 0; transform: translateX(18px); pointer-events: none; }
.pp-ic {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-tile); color: var(--pt);
  background: color-mix(in srgb, var(--pt) 12%, transparent); border: 1px solid color-mix(in srgb, var(--pt) 38%, transparent);
}
.pp-main { display: grid; gap: 6px; min-width: 0; }
.pp-kind { margin: 0; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--pt); font-weight: 500; }
.pp-text { margin: 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.pp-meter { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--mut); }
.pp-meter .lk-rel-bar { flex-basis: 72px; height: 5px; }
.pp-streak { display: inline-flex; gap: 3px; }
.pp-tick { width: 8px; height: 8px; border-radius: 2px; background: var(--pt); box-shadow: 0 0 6px -1px var(--pt); }
.pp-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.pp-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; margin: 0; font-size: 13px; color: var(--mut); }
.pp-link {
  display: inline-flex; align-items: center; gap: 2px; padding: 4px 0; border: 0; background: none; color: var(--cy);
  font-size: 13px; font-weight: 500;
}
.pp-link .ic { width: 14px; height: 14px; }
.pp-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --- Écran « Ce que Claude a appris » --- */
.cl-hero {
  display: flex; align-items: center; gap: 24px; min-width: 0; padding: 18px 20px; border-radius: var(--r-pan);
  border: 1px solid rgba(34, 227, 212, .35);
  background: radial-gradient(340px 200px at 0% 50%, rgba(34, 227, 212, .12), transparent 70%), var(--pan2);
}
.cl-hero.is-learning { border-color: rgba(139, 108, 255, .4); background: radial-gradient(340px 200px at 0% 50%, rgba(139, 108, 255, .14), transparent 70%), var(--pan2); }
.cl-hero-text { flex: 1 1 auto; display: grid; gap: 4px; min-width: 0; }
.cl-hero-title { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 500; }
.cl-hero-rate { margin: 0; font-size: 15px; }
.cl-hero-hint { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: var(--cy); }
.cl-hero-hint .ic { width: 14px; height: 14px; }
.cl-hero.is-learning .cl-hero-hint { color: #c9bcff; }
.cl-steps { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; max-width: 540px; margin: 8px 0 0; padding: 0; list-style: none; }
.cl-step { display: grid; justify-items: center; gap: 2px; min-width: 0; padding: 5px 0 4px; border-radius: 6px; background: var(--bar); border: 1px solid var(--line); }
.cl-step-lv { font-size: 13px; font-weight: 500; color: var(--mut); font-variant-numeric: tabular-nums; }
.cl-step-pct { font-size: 11px; color: var(--mut); font-variant-numeric: tabular-nums; }
.cl-step.is-done { background: rgba(34, 227, 212, .08); border-color: rgba(34, 227, 212, .3); }
.cl-step.is-done .cl-step-lv { color: var(--cy); }
.cl-step.is-current { background: rgba(34, 227, 212, .16); border-color: var(--cy); box-shadow: var(--glow-cy); }
.cl-step.is-current .cl-step-lv { color: var(--txt); }
.cl-hero-foot { margin: 4px 0 0; font-size: 13px; color: var(--mut); }
.cl-section h3:focus { outline: none; }

.cl-row {
  --pt: var(--cy);
  display: flex; align-items: flex-start; flex-wrap: wrap; gap: 10px 14px; min-width: 0; padding: 12px 14px;
  border-radius: var(--r-tile); background: var(--pan2); border: 1px solid var(--line);
}
.cl-row > .st-confirm { flex-basis: 100%; }
.cl-row-ic {
  flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-tile); color: var(--pt);
  background: color-mix(in srgb, var(--pt) 12%, transparent); border: 1px solid color-mix(in srgb, var(--pt) 35%, transparent);
}
.cl-row-ic .ic { width: 17px; height: 17px; }
.cl-auto.is-auto_trash { --pt: var(--rd); }
.cl-auto.is-auto_read { --pt: var(--g-aqua); }
.cl-auto.is-rule { --pt: var(--vi); }
.cl-auto.is-refused { --pt: var(--mut); }
.cl-auto.is-refused .cl-name { color: var(--mut); }
.cl-row-ic.is-up { --pt: var(--rd); }
.cl-row-ic.is-down { --pt: var(--gr); }
.cl-row-main { flex: 1 1 260px; display: grid; gap: 4px; min-width: 0; }
.cl-row-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; min-width: 0; }
.cl-name { min-width: 0; font-weight: 500; overflow-wrap: anywhere; }
.cl-row-line { margin: 0; font-size: 13px; color: var(--mut); }
.cl-status { color: var(--txt); }
.cl-auto.is-active .cl-status { color: #9ff0c9; }
.cl-auto.is-later .cl-status { color: #ffe39b; }
.cl-row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cl-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; border-radius: var(--r-pill);
  border: 1px solid rgba(34, 227, 212, .5); color: var(--cy); font-size: 12px; font-weight: 500;
}
.cl-tag .ic { width: 12px; height: 12px; }
.cl-meter { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cl-meter .lk-rel-bar { flex: 1 1 auto; max-width: 280px; height: 6px; }
.cl-meter-text { font-size: 13px; color: var(--mut); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cl-rel.is-high .cl-meter-text { color: #9ff0c9; }
.cl-rel.is-low .cl-meter-text { color: #ffc2ca; }
.cl-when { margin-left: auto; font-size: 13px; color: var(--mut); font-weight: 400; }
.cl-ex-subject { margin: 0; font-size: 14px; overflow-wrap: anywhere; }
.cl-ex-change { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 2px 0 0; font-size: 13px; color: var(--mut); }
.cl-ex-arrow { color: var(--cy); }
.st-rule-target.is-read { color: #a8f5ee; }
.st-rule-target.is-read .ic { width: 14px; height: 14px; color: var(--g-aqua); }

/* --- Barre compacte (768 à 1180 px) --- */
@media (min-width: 768px) and (max-width: 1180px) {
  .claude-chip { height: 36px; }
}

/* --- iPhone : anneau à droite de l'en-tête (à côté de la flamme), propositions dans Moi --- */
@media (max-width: 767px) {
  /* Première ligne de l'en-tête : logo, humeur et série, Claude, anneau, vérifier, recherche, réglages (375 px : il reste
     quelques pixels). L'anneau de Claude garde une zone de 44 px, posée en partie sur les espaces voisins. */
  .topbar { column-gap: 2px; }
  .logo { letter-spacing: .1em; }
  .moi-chip { padding: 0 2px; gap: 3px; }
  .refresh { margin-right: 0; }
  .claude-chip { order: 3; width: 44px; height: 44px; margin: 0 -3px; padding: 0; justify-content: center; gap: 0; border-color: transparent; background: transparent; }
  .claude-chip.is-active { box-shadow: none; border-color: var(--cy); }
  .claude-chip .cl-text { display: none; }
  .claude-chip .avatar.is-md { width: 30px; height: 30px; }
  .av-level { font-size: 13px; min-width: 18px; height: 18px; line-height: 18px; right: -6px; bottom: -4px; }

  .locker-claude { display: none; }
  .locker-rel-short { display: inline-flex; align-items: center; gap: 3px; min-width: 0; font-size: 13px; color: var(--rt); white-space: nowrap; }
  .locker-rel-short .ic { width: 13px; height: 13px; }

  .lt-urg { height: 30px; padding: 0 8px 0 10px; font-size: 13px; }
  .lt-urg::after { content: ""; position: absolute; inset: -7px -3px; }   /* zone tactile de 44 px */
  .lt-urg .ic { width: 14px; height: 14px; }
  .lt-urgency { padding: 10px 8px; }
  .lt-urgency-label, .lt-urgency-help { font-size: 13px; }
  .lt-urg-opt { flex-direction: column; gap: 3px; min-height: 52px; padding: 4px 2px; }

  .proposals { padding: 14px; }
  .pp-card { padding: 12px 10px; border-radius: var(--r-row); grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
  .pp-ic { width: 34px; height: 34px; }
  .pp-kicker, .pp-kind { font-size: 13px; }
  .pp-text { font-size: 15px; }
  .pp-actions .btn { flex: 1 1 0; min-height: 44px; padding: 0 6px; font-size: 14px; }
  .pp-link { min-height: 44px; }

  .cl-hero { flex-direction: column; align-items: flex-start; gap: 14px; padding: 16px 14px; border-radius: var(--r-row); }
  .cl-hero .avatar.is-lg { width: 80px; height: 80px; }
  .cl-hero-title { font-size: 20px; }
  .cl-steps { gap: 3px; }
  .cl-step-pct { font-size: 13px; }
  .cl-row { padding: 12px; border-radius: var(--r-row); }
  .cl-row .btn, .cl-row-actions .btn { min-height: 44px; }
  .cl-row-actions { width: 100%; }
  .cl-row-actions .btn { flex: 1 1 0; }
  .cl-rel > .btn, .cl-auto > .btn, .cl-example > .btn { width: 100%; }
  .cl-tag, .count-cy, .cl-section .lk-rule-kind, .cl-urg { font-size: 13px; }
  .st-rules .st-rule .btn { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .claude-chip.is-levelup, .claude-chip.is-levelup .av-svg { animation: none; }
  .claude-chip.is-levelup .avatar::after { animation: none; display: none; }
  .av-fill, .lk-rel-fill { transition: none; }
  .pp-card.is-new, .lt-urgency.is-new { animation: none; }
  .pp-card.is-leaving { transform: none; }
}
