/* ==========================================================================
   Atlas Metallic — design system d'Atlas Mail
   Une seule structure, quatre finitions : Silver/Gold × Clair/Sombre.
   Le métal est réservé aux éléments importants : logo, actions principales,
   sélection, barres de navigation. La lecture reste sobre.
   ========================================================================== */

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-xs: 6px; --r-sm: 9px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.34, 1.36, .64, 1);
  --t-fast: 120ms; --t: 180ms; --t-slow: 260ms;

  --nav-w: 248px; --list-w: 400px;
  --row-pad: 14px;
  --blur: 22px;
}

/* ---------- Finitions ---------------------------------------------------- */

/* Silver · Clair : blanc nacré, argent foncé, reflets platine */
[data-finish="silver"][data-theme="light"] {
  --bg: #eef0f3;
  --bg-sheen: radial-gradient(1200px 700px at 12% -10%, #ffffff 0%, rgba(255,255,255,0) 60%), radial-gradient(900px 600px at 110% 10%, #e3e7ee 0%, rgba(227,231,238,0) 55%), linear-gradient(180deg, #f4f5f7, #e9ecf0);
  --surface: rgba(255,255,255,.74);
  --surface-solid: #ffffff;
  --surface-2: rgba(246,247,249,.9);
  --surface-sunk: rgba(15,20,30,.035);
  --line: rgba(20,26,38,.09);
  --line-strong: rgba(20,26,38,.16);
  --text: #15171c;
  --text-2: #4a505b;
  --text-3: #6b717c;
  --accent: #4f5b6d;
  --accent-ink: #ffffff;
  --focus: #5d6f8f;
  --metal: linear-gradient(135deg, #fdfdfe 0%, #d6dae1 18%, #8e959f 42%, #f1f3f6 58%, #a9afb8 76%, #6a7079 100%);
  --metal-soft: linear-gradient(135deg, rgba(255,255,255,.95), rgba(219,223,230,.9) 40%, rgba(241,243,246,.95) 60%, rgba(205,210,218,.9));
  --metal-text: linear-gradient(100deg, #2b2f36 0%, #6e7581 30%, #2f343b 48%, #8b929d 70%, #30343a 100%);
  --metal-ink: #1b1e23;
  --metal-edge: rgba(255,255,255,.9);
  --select: linear-gradient(135deg, rgba(255,255,255,.98), rgba(226,230,236,.92) 55%, rgba(244,245,248,.98));
  --select-edge: rgba(90,100,118,.28);
  --unread: #3c4656;
  --shadow-1: 0 1px 2px rgba(16,22,35,.06), 0 1px 1px rgba(16,22,35,.04);
  --shadow-2: 0 10px 30px -12px rgba(22,30,48,.22), 0 2px 6px rgba(22,30,48,.06);
  --shadow-3: 0 30px 80px -24px rgba(22,30,48,.35), 0 6px 18px rgba(22,30,48,.08);
  --danger: #b4322e; --danger-bg: rgba(180,50,46,.08);
  --ok: #2f7d4f; --ok-bg: rgba(47,125,79,.09);
  --info-bg: rgba(79,91,109,.08);
  color-scheme: light;
}

/* Silver · Sombre : graphite, argent brillant, verre fumé */
[data-finish="silver"][data-theme="dark"] {
  --bg: #0c0d10;
  --bg-sheen: radial-gradient(1100px 650px at 8% -12%, rgba(120,130,148,.20) 0%, rgba(0,0,0,0) 60%), radial-gradient(900px 600px at 105% 0%, rgba(80,88,104,.16) 0%, rgba(0,0,0,0) 55%), linear-gradient(180deg, #111216, #0a0b0d);
  --surface: rgba(24,26,31,.72);
  --surface-solid: #16181c;
  --surface-2: rgba(30,33,39,.86);
  --surface-sunk: rgba(255,255,255,.035);
  --line: rgba(255,255,255,.08);
  --line-strong: rgba(255,255,255,.14);
  --text: #eceef2;
  --text-2: #b4bac4;
  --text-3: #8c929d;
  --accent: #cfd5de;
  --accent-ink: #121418;
  --focus: #aab6c8;
  --metal: linear-gradient(135deg, #ffffff 0%, #c3c9d2 18%, #6f7681 42%, #eef1f5 58%, #9aa1ab 76%, #50565f 100%);
  --metal-soft: linear-gradient(135deg, rgba(255,255,255,.14), rgba(160,168,180,.10) 40%, rgba(255,255,255,.16) 60%, rgba(120,128,140,.10));
  --metal-text: linear-gradient(100deg, #f4f6f9 0%, #9ba2ad 30%, #ffffff 48%, #8a919c 70%, #e7eaef 100%);
  --metal-ink: #0e1013;
  --metal-edge: rgba(255,255,255,.35);
  --select: linear-gradient(135deg, rgba(255,255,255,.10), rgba(170,178,190,.07) 55%, rgba(255,255,255,.12));
  --select-edge: rgba(220,226,235,.22);
  --unread: #e6eaf0;
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 12px 34px -12px rgba(0,0,0,.65), 0 2px 6px rgba(0,0,0,.3);
  --shadow-3: 0 34px 90px -24px rgba(0,0,0,.8), 0 8px 20px rgba(0,0,0,.4);
  --danger: #ff8b84; --danger-bg: rgba(255,110,100,.12);
  --ok: #7fd3a0; --ok-bg: rgba(110,210,150,.12);
  --info-bg: rgba(200,210,225,.08);
  color-scheme: dark;
}

/* Gold · Clair : blanc nacré, or champagne */
[data-finish="gold"][data-theme="light"] {
  --bg: #f3f0ea;
  --bg-sheen: radial-gradient(1200px 700px at 12% -10%, #fffdf8 0%, rgba(255,253,248,0) 60%), radial-gradient(900px 600px at 110% 10%, #efe6d4 0%, rgba(239,230,212,0) 55%), linear-gradient(180deg, #f8f5ef, #efe9df);
  --surface: rgba(255,253,249,.76);
  --surface-solid: #fffdf9;
  --surface-2: rgba(250,246,239,.92);
  --surface-sunk: rgba(60,42,10,.04);
  --line: rgba(64,48,18,.10);
  --line-strong: rgba(64,48,18,.18);
  --text: #1c1813;
  --text-2: #554b3c;
  --text-3: #75695a;
  --accent: #7d5f2a;
  --accent-ink: #ffffff;
  --focus: #a37f3e;
  --metal: linear-gradient(135deg, #fff8e8 0%, #ead3a2 18%, #a9844a 42%, #f8ead0 58%, #c9a565 76%, #7c5f2f 100%);
  --metal-soft: linear-gradient(135deg, rgba(255,251,242,.96), rgba(240,224,192,.9) 40%, rgba(252,244,228,.96) 60%, rgba(232,212,172,.9));
  --metal-text: linear-gradient(100deg, #4a3714 0%, #a07d3e 30%, #5a4319 48%, #b8955a 70%, #4d3916 100%);
  --metal-ink: #2a1f0d;
  --metal-edge: rgba(255,250,236,.95);
  --select: linear-gradient(135deg, rgba(255,252,245,.98), rgba(241,229,204,.9) 55%, rgba(252,247,236,.98));
  --select-edge: rgba(150,115,55,.28);
  --unread: #6e5222;
  --shadow-1: 0 1px 2px rgba(50,35,10,.07);
  --shadow-2: 0 10px 30px -12px rgba(70,50,15,.22), 0 2px 6px rgba(70,50,15,.06);
  --shadow-3: 0 30px 80px -24px rgba(70,50,15,.35), 0 6px 18px rgba(70,50,15,.08);
  --danger: #a8352b; --danger-bg: rgba(168,53,43,.08);
  --ok: #3b7a45; --ok-bg: rgba(59,122,69,.09);
  --info-bg: rgba(125,95,42,.08);
  color-scheme: light;
}

/* Gold · Sombre : noir profond, or champagne, verre fumé */
[data-finish="gold"][data-theme="dark"] {
  --bg: #0b0a08;
  --bg-sheen: radial-gradient(1100px 650px at 8% -12%, rgba(196,160,96,.16) 0%, rgba(0,0,0,0) 60%), radial-gradient(900px 600px at 105% 0%, rgba(150,118,62,.12) 0%, rgba(0,0,0,0) 55%), linear-gradient(180deg, #100e0b, #090807);
  --surface: rgba(26,23,18,.74);
  --surface-solid: #17140f;
  --surface-2: rgba(33,29,22,.86);
  --surface-sunk: rgba(255,240,210,.035);
  --line: rgba(255,236,200,.08);
  --line-strong: rgba(255,236,200,.14);
  --text: #f2ece1;
  --text-2: #c4b8a3;
  --text-3: #9b8f7b;
  --accent: #dcc08a;
  --accent-ink: #17130c;
  --focus: #d8bb82;
  --metal: linear-gradient(135deg, #fff6dc 0%, #e2c58c 18%, #8f6c35 42%, #f6e4bd 58%, #bf9a58 76%, #6a4f24 100%);
  --metal-soft: linear-gradient(135deg, rgba(255,236,190,.14), rgba(200,165,100,.10) 40%, rgba(255,236,190,.16) 60%, rgba(160,125,70,.10));
  --metal-text: linear-gradient(100deg, #fbf1da 0%, #c8a564 30%, #fff7e6 48%, #b48f50 70%, #f3e2bd 100%);
  --metal-ink: #15110a;
  --metal-edge: rgba(255,236,196,.38);
  --select: linear-gradient(135deg, rgba(255,232,180,.11), rgba(200,165,100,.07) 55%, rgba(255,232,180,.13));
  --select-edge: rgba(226,197,140,.24);
  --unread: #ecd5a6;
  --shadow-1: 0 1px 2px rgba(0,0,0,.45);
  --shadow-2: 0 12px 34px -12px rgba(0,0,0,.7), 0 2px 6px rgba(0,0,0,.35);
  --shadow-3: 0 34px 90px -24px rgba(0,0,0,.85), 0 8px 20px rgba(0,0,0,.45);
  --danger: #ff9a8a; --danger-bg: rgba(255,120,100,.12);
  --ok: #92d6a4; --ok-bg: rgba(120,210,150,.12);
  --info-bg: rgba(226,197,140,.08);
  color-scheme: dark;
}

[data-density="compact"] { --row-pad: 9px; }

/* ---------- Base --------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
:where(svg.i) { width: 18px; height: 18px; flex: none; }
body {
  margin: 0; font: 14px/1.45 var(--font); color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  overflow: hidden;
}
body::before { content: ""; position: fixed; inset: 0; background: var(--bg-sheen); z-index: -1; transition: opacity var(--t-slow) var(--ease); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); }
code { font-family: var(--mono); font-size: .92em; background: var(--surface-sunk); padding: 1px 5px; border-radius: 5px; }
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.glass {
  background: var(--surface);
  -webkit-backdrop-filter: saturate(1.6) blur(var(--blur)); backdrop-filter: saturate(1.6) blur(var(--blur));
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: var(--surface-solid); } }
[data-transparency="reduced"] .glass, [data-transparency="reduced"] .glass-strong { background: var(--surface-solid) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

.metal-text { background: var(--metal-text); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; }

/* ---------- Boutons ------------------------------------------------------ */

.btn {
  --h: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h); padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text);
  font-weight: 560; letter-spacing: .005em; white-space: nowrap; text-decoration: none;
  transition: transform var(--t-fast) var(--ease), background var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
  user-select: none;
}
.btn:hover { border-color: var(--select-edge); background: var(--surface-solid); }
.btn:active { transform: scale(.975); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn svg { width: 17px; height: 17px; flex: none; }
.btn-block { width: 100%; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-sunk); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-sm { --h: 30px; padding: 0 10px; font-size: 13px; }
.btn-lg { --h: 46px; padding: 0 20px; font-size: 15px; border-radius: var(--r-md); }

/* Bouton métal : matière brossée + reflet qui suit le pointeur */
.btn-metal {
  position: relative; isolation: isolate; overflow: hidden;
  color: var(--metal-ink); border: 1px solid transparent;
  background: var(--metal) padding-box, linear-gradient(180deg, var(--metal-edge), rgba(0,0,0,.18)) border-box;
  background-size: 180% 180%, 100% 100%; background-position: 30% 30%, 0 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -1px 0 rgba(0,0,0,.18), var(--shadow-2);
  text-shadow: 0 1px 0 rgba(255,255,255,.45);
  transition: background-position 600ms var(--ease-out), transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.btn-metal::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(120px 60px at var(--mx, 50%) var(--my, 0%), rgba(255,255,255,.75), rgba(255,255,255,0) 70%);
  opacity: 0; transition: opacity var(--t) var(--ease);
}
.btn-metal::after {
  content: ""; position: absolute; top: -50%; bottom: -50%; width: 40%; left: -60%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-18deg);
}
.btn-metal:hover { background-position: 70% 70%, 0 0; box-shadow: inset 0 1px 0 rgba(255,255,255,.8), inset 0 -1px 0 rgba(0,0,0,.2), var(--shadow-3); }
.btn-metal:hover::before { opacity: 1; }
.btn-metal:hover::after { animation: sheen 900ms var(--ease-out); }
@keyframes sheen { to { left: 130%; } }

.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-2);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface-sunk); color: var(--text); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.on { color: var(--accent); }
.icon-btn.star.on { color: #c79a3a; }
[data-finish="silver"] .icon-btn.star.on { color: var(--accent); }

.kbd { font: 11px/1 var(--mono); padding: 3px 5px; border-radius: 5px; border: 1px solid var(--line-strong); color: var(--text-3); background: var(--surface-sunk); }

/* ---------- Formulaires -------------------------------------------------- */

input[type=text], input[type=email], input[type=password], input[type=search], input:not([type]), input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong);
  background: var(--surface-solid); color: var(--text); outline: none;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
textarea { height: auto; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }
label { display: grid; gap: 6px; font-size: 12.5px; font-weight: 560; color: var(--text-2); }
fieldset { border: 0; padding: 0; margin: 0 0 6px; display: grid; gap: 12px; }
legend { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-bottom: 10px; }
.form-grid { display: grid; gap: 18px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.notice { padding: 10px 12px; border-radius: var(--r-sm); font-size: 13px; background: var(--info-bg); color: var(--text-2); display: flex; gap: 10px; align-items: flex-start; }
.notice svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.notice.danger { background: var(--danger-bg); color: var(--danger); }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.code-box { font-family: var(--mono); font-size: 12px; width: 100%; }

/* ---------- Écrans d'accès ---------------------------------------------- */

.auth-shell { min-height: 100%; display: grid; place-items: center; padding: 32px 16px; overflow: auto; height: 100%; }
.auth-card {
  width: min(440px, 100%); padding: 40px 36px 32px; border-radius: var(--r-xl); border: 1px solid var(--line);
  box-shadow: var(--shadow-3); position: relative;
  animation: rise 520ms var(--ease-out) both;
}
.auth-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(160deg, var(--metal-edge), transparent 40%, transparent 70%, var(--select-edge)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
.auth-logo { display: grid; place-items: center; margin-bottom: 18px; }
.auth-title { font: 650 26px/1.15 var(--font-display); letter-spacing: -.02em; text-align: center; margin: 0 0 8px; }
.auth-sub { text-align: center; color: var(--text-2); margin: 0 0 24px; }
.auth-foot { margin-top: 18px; text-align: center; color: var(--text-3); font-size: 12.5px; display: grid; gap: 10px; }
.auth-sep { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12px; margin: 6px 0; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.install-page { overflow: auto; }
.install-h { font-size: 15px; margin: 22px 0 8px; }
.install-steps { padding-left: 20px; color: var(--text-2); display: grid; gap: 8px; margin: 0 0 22px; }
.wrap { word-break: break-all; }
.otp-input { text-align: center; font: 600 24px/1 var(--mono) !important; letter-spacing: .4em; height: 54px !important; }
.secret-box { font-family: var(--mono); font-size: 15px; letter-spacing: .12em; text-align: center; padding: 12px; border-radius: var(--r-sm); background: var(--surface-sunk); border: 1px dashed var(--line-strong); word-break: break-all; user-select: all; }

.brand-word { font: 700 13px/1 var(--font-display); letter-spacing: .42em; text-transform: uppercase; padding-left: .42em; }

@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Introduction (première visite) ------------------------------ */

.intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: var(--bg); }
.intro::before { content: ""; position: absolute; inset: 0; background: var(--bg-sheen); }
.intro-inner { position: relative; display: grid; justify-items: center; gap: 22px; }
.intro .logo-mark { width: 112px; height: 112px; }
.intro .logo-mark .ring { stroke-dasharray: 140; stroke-dashoffset: 140; animation: draw 1100ms var(--ease-out) 150ms forwards; }
.intro .logo-mark .glyph { opacity: 0; transform: translateY(6px) scale(.94); transform-origin: 50% 60%; animation: glyph 800ms var(--ease-out) 450ms forwards; }
.intro .brand-word { font-size: 22px; letter-spacing: .9em; padding-left: .9em; opacity: 0; animation: word 1000ms var(--ease-out) 700ms forwards; }
.intro .tagline { color: var(--text-3); font-size: 13px; letter-spacing: .08em; opacity: 0; animation: fade 700ms var(--ease) 1200ms forwards; }
.intro.out { animation: introOut 520ms var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes glyph { to { opacity: 1; transform: none; } }
@keyframes word { from { opacity: 0; letter-spacing: 1.4em; } to { opacity: 1; letter-spacing: .5em; } }
@keyframes introOut { to { opacity: 0; transform: scale(1.03); visibility: hidden; } }
.intro .sheen-sweep { position: absolute; inset: -40% -60%; background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,.18) 50%, transparent 58%); animation: sweep 1600ms var(--ease) 600ms both; pointer-events: none; }
@keyframes sweep { from { transform: translateX(-60%); } to { transform: translateX(60%); } }

/* ---------- Application ------------------------------------------------- */

.app {
  height: 100%; display: grid; grid-template-columns: var(--nav-w) 0 var(--list-w) 0 minmax(0, 1fr);
  transition: grid-template-columns var(--t-slow) var(--ease-out);
}
.app.nav-collapsed { --nav-w: 68px; }
.app.reading-wide { --list-w: 0px; }
.app.booting > * { animation: rise 600ms var(--ease-out) both; }
.app.booting > .list { animation-delay: 70ms; }
.app.booting > .reader { animation-delay: 140ms; }

/* Navigation latérale */
.nav {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border-right: 1px solid var(--line); padding: 14px 10px 10px;
}
.nav-head { display: flex; align-items: center; gap: 10px; padding: 4px 6px 16px; min-height: 52px; }
.nav-head .logo-mark { width: 34px; height: 34px; flex: none; }
.nav-head .brand-word { white-space: nowrap; transition: opacity var(--t) var(--ease); }
.nav-head .collapse { margin-left: auto; }
.compose-btn { margin: 0 4px 14px; justify-content: flex-start; padding: 0 14px; height: 44px; border-radius: 13px; font-size: 14.5px; }
.compose-btn .kbd { margin-left: auto; background: rgba(255,255,255,.35); border-color: rgba(0,0,0,.12); color: var(--metal-ink); }
.nav-scroll { overflow: auto; flex: 1; margin: 0 -4px; padding: 0 4px; scrollbar-width: thin; }
.nav-section { margin: 14px 8px 6px; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; justify-content: space-between; white-space: nowrap; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px; width: 100%; height: 36px; padding: 0 10px;
  border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--text-2); text-align: left;
  white-space: nowrap; overflow: hidden; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav-item:hover { background: var(--surface-sunk); color: var(--text); }
.nav-item svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.nav-item .label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-item .count { font-size: 11.5px; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text-3); }
.nav-item.active { color: var(--text); font-weight: 600; background: var(--select); border-color: var(--select-edge); box-shadow: inset 0 1px 0 var(--metal-edge), var(--shadow-1); }
.nav-item.active .count { color: var(--accent); }
.nav-item .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.nav-foot { display: flex; gap: 4px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 8px; align-items: center; }
.nav-foot .user-chip { flex: 1; display: flex; align-items: center; gap: 9px; min-width: 0; padding: 4px 6px; border-radius: 10px; background: none; border: 0; text-align: left; }
.nav-foot .user-chip:hover { background: var(--surface-sunk); }
.nav-foot .user-chip .who { min-width: 0; line-height: 1.2; }
.nav-foot .user-chip .who b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-foot .user-chip .who span { font-size: 11.5px; color: var(--text-3); }
.app.nav-collapsed .nav .label, .app.nav-collapsed .nav .count, .app.nav-collapsed .nav-section, .app.nav-collapsed .brand-word,
.app.nav-collapsed .compose-btn span, .app.nav-collapsed .compose-btn .kbd, .app.nav-collapsed .user-chip .who, .app.nav-collapsed .nav-foot .icon-btn:not(.keep) { display: none; }
.app.nav-collapsed .compose-btn { justify-content: center; padding: 0; }
.app.nav-collapsed .nav-head { flex-direction: column; gap: 12px; }
.app.nav-collapsed .nav-head .collapse { margin: 0; }
.app.nav-collapsed .nav-foot { flex-direction: column; }

/* Poignées de redimensionnement */
.resizer { position: relative; z-index: 5; cursor: col-resize; width: 0; }
.resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: -4px; width: 8px; }
.resizer::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: var(--metal); opacity: 0; transition: opacity var(--t) var(--ease); }
.resizer:hover::before, .resizer.dragging::before { opacity: .9; }
body.resizing { cursor: col-resize; user-select: none; }
body.resizing .app { transition: none; }

/* Liste des messages */
.list { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border-right: 1px solid var(--line); background: color-mix(in srgb, var(--surface-solid) 38%, transparent); }
.app.reading-wide .list { visibility: hidden; }
.list-head { padding: 18px 18px 10px; display: grid; gap: 12px; }
.list-title { display: flex; align-items: baseline; gap: 10px; }
.list-title h2 { margin: 0; font: 680 22px/1.1 var(--font-display); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-title .sub { color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list-title .icon-btn { margin-left: auto; }
.list-title .spin svg { animation: spin 900ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input { padding-left: 34px; padding-right: 44px; height: 38px; background: var(--surface-sunk); border-color: transparent; }
.search input:focus { background: var(--surface-solid); }
.search .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.segmented { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-sunk); gap: 2px; position: relative; }
.segmented button { position: relative; z-index: 1; border: 0; background: none; height: 28px; padding: 0 12px; border-radius: 8px; color: var(--text-2); font-size: 12.5px; font-weight: 560; }
.segmented button[aria-pressed="true"] { color: var(--text); background: var(--surface-solid); box-shadow: var(--shadow-1), inset 0 1px 0 var(--metal-edge); }
.list-tools { display: flex; align-items: center; gap: 8px; }
.list-tools .bulk { margin-left: auto; display: flex; gap: 2px; }

.msgs { flex: 1; overflow: auto; padding: 4px 10px 16px; scrollbar-width: thin; contain: strict; }
.msg {
  position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 0 12px; padding: var(--row-pad) 12px var(--row-pad) 16px;
  border-radius: 12px; border: 1px solid transparent; cursor: pointer; outline: none;
  transition: background var(--t-fast) var(--ease), transform var(--t) var(--ease-out), opacity var(--t) var(--ease);
  content-visibility: auto; contain-intrinsic-size: auto 78px;
}
.msg + .msg::before { content: ""; position: absolute; top: -1px; left: 60px; right: 12px; height: 1px; background: var(--line); }
.msg:hover { background: var(--surface-sunk); }
.msg:hover::before, .msg:hover + .msg::before, .msg.active::before, .msg.active + .msg::before { opacity: 0; }
.msg.active { background: var(--select); border-color: var(--select-edge); box-shadow: inset 0 1px 0 var(--metal-edge), var(--shadow-1); }
.msg:focus-visible { border-color: var(--focus); }
.msg.leaving { opacity: 0; transform: translateX(-24px); }
.msg.fresh { animation: arrive 520ms var(--ease-out) both; }
@keyframes arrive { from { opacity: 0; transform: translateY(-8px); } }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 650; letter-spacing: .02em;
  color: var(--text); position: relative; background: var(--surface-solid);
  box-shadow: inset 0 0 0 1px var(--line);
}
.avatar::before { content: ""; position: absolute; inset: -1.5px; border-radius: 50%; padding: 1.5px; background: var(--metal); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .85; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; }
.msg .line1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.msg .from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-weight: 520; }
.msg .date { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.msg .subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); margin-top: 1px; }
.msg .snippet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: 13px; margin-top: 1px; }
[data-density="compact"] .msg .snippet { display: none; }
.msg.unread .from, .msg.unread .subject { color: var(--text); font-weight: 680; }
.msg.unread::after { content: ""; position: absolute; left: 4px; z-index: 1; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 55%, transparent); }
.msg .badges { display: inline-flex; gap: 4px; align-items: center; color: var(--text-3); }
.msg .badges svg { width: 13px; height: 13px; }
.msg .badges .flag { color: #c79a3a; }
[data-finish="silver"] .msg .badges .flag { color: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .01em; background: var(--surface-sunk); color: var(--text-3); white-space: nowrap; }
.chip.metal { background: var(--metal-soft); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--select-edge); }
.chip svg { width: 12px; height: 12px; }
.acct-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.list-more { display: grid; place-items: center; padding: 10px; }
.list-empty { display: grid; place-items: center; text-align: center; color: var(--text-3); padding: 60px 24px; gap: 10px; }
.list-empty svg { width: 36px; height: 36px; opacity: .5; }

.skeleton .sk { background: linear-gradient(90deg, var(--surface-sunk) 0%, color-mix(in srgb, var(--surface-sunk) 30%, var(--line-strong)) 50%, var(--surface-sunk) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 6px; height: 11px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Zone de lecture et de rédaction */
.reader { position: relative; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.reader-bar {
  display: flex; align-items: center; gap: 2px; padding: 10px 16px; min-height: 56px; border-bottom: 1px solid var(--line); position: relative; z-index: 2;
}
.reader-bar .sp { flex: 1; }
.reader-bar .sep { width: 1px; height: 20px; background: var(--line); margin: 0 6px; }
.reader-scroll { flex: 1; overflow: auto; scrollbar-width: thin; }
.reader-inner { max-width: 920px; margin: 0 auto; padding: 26px 32px 40px; animation: openMsg 260ms var(--ease-out) both; }
@keyframes openMsg { from { opacity: 0; transform: translateY(10px); } }
.reader h1 { font: 680 26px/1.2 var(--font-display); letter-spacing: -.022em; margin: 0 0 18px; text-wrap: balance; }
.sender { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.sender .who { flex: 1; min-width: 0; }
.sender .who b { font-size: 15px; }
.sender .who .addr { color: var(--text-3); font-size: 13px; margin-left: 6px; }
.sender .who .to { color: var(--text-3); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sender .when { color: var(--text-3); font-size: 12.5px; text-align: right; white-space: nowrap; }
.insights { display: grid; gap: 8px; margin-bottom: 16px; }
.insight {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); font-size: 13px;
  background: var(--metal-soft); box-shadow: inset 0 0 0 1px var(--select-edge), inset 0 1px 0 var(--metal-edge); color: var(--text-2);
  animation: insightIn 420ms var(--ease-out) both;
}
.insight:nth-child(2) { animation-delay: 60ms; } .insight:nth-child(3) { animation-delay: 120ms; }
@keyframes insightIn { from { opacity: 0; transform: translateY(-4px) scale(.99); } }
.insight svg { width: 17px; height: 17px; flex: none; color: var(--accent); }
.insight .grow { flex: 1; min-width: 0; }
.insight .tag { font-size: 10px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-right: 6px; }
.insight.danger { background: var(--danger-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.insight.danger svg { color: var(--danger); }
.paper {
  border-radius: var(--r-lg); background: #fff; color: #1c1d21; box-shadow: var(--shadow-2); overflow: hidden;
  border: 1px solid var(--line);
}
.paper iframe { display: block; width: 100%; border: 0; height: 60vh; min-height: 320px; background: #fff; }
.paper .demo-body { padding: 28px 32px 36px; font: 15px/1.65 var(--font); }
.paper .demo-body p { margin: 0 0 14px; }
.paper .demo-body a { color: #3b5bdb; }
[data-theme="dark"] .paper { background: #f6f6f7; }
.atts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.att { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); text-decoration: none; color: var(--text); max-width: 280px; transition: border-color var(--t) var(--ease), transform var(--t-fast) var(--ease); }
.att:hover { border-color: var(--select-edge); transform: translateY(-1px); }
.att .ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--metal-soft); box-shadow: inset 0 0 0 1px var(--select-edge); flex: none; font-size: 10px; font-weight: 750; letter-spacing: .04em; color: var(--text-2); }
.att .meta { min-width: 0; line-height: 1.25; }
.att .meta b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .meta span { font-size: 11.5px; color: var(--text-3); }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; align-items: center; }
.quick .lbl { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); margin-right: 4px; display: inline-flex; align-items: center; gap: 6px; }
.quick .lbl svg { width: 14px; height: 14px; color: var(--accent); }
.quick button { border: 1px solid var(--line-strong); background: var(--surface-2); border-radius: 999px; height: 32px; padding: 0 14px; font-size: 13px; color: var(--text-2); transition: all var(--t) var(--ease); }
.quick button:hover { border-color: var(--select-edge); color: var(--text); background: var(--surface-solid); transform: translateY(-1px); }

.empty-state { flex: 1; display: grid; place-items: center; text-align: center; padding: 40px; }
.empty-state .inner { display: grid; justify-items: center; gap: 14px; animation: fade 400ms var(--ease) both; }
.empty-state .logo-mark { width: 84px; height: 84px; opacity: .9; filter: drop-shadow(0 18px 30px rgba(0,0,0,.12)); }
.empty-state h3 { margin: 6px 0 0; font: 650 18px/1.2 var(--font-display); }
.empty-state p { margin: 0; color: var(--text-3); max-width: 340px; }
.empty-state .shortcuts { display: grid; grid-template-columns: auto auto; gap: 8px 14px; margin-top: 12px; font-size: 12.5px; color: var(--text-3); text-align: left; }

/* Rédaction */
.composer { display: flex; flex-direction: column; height: 100%; animation: composeIn 300ms var(--ease-out) both; }
@keyframes composeIn { from { opacity: 0; transform: translateY(16px); } }
.composer .reader-bar h2 { margin: 0 0 0 6px; font: 650 16px/1 var(--font-display); }
.composer .saved { color: var(--text-3); font-size: 12px; margin-right: 8px; }
.compose-fields { padding: 6px 28px 0; max-width: 920px; width: 100%; margin: 0 auto; }
.field { display: flex; align-items: center; gap: 10px; min-height: 46px; border-bottom: 1px solid var(--line); position: relative; }
.field > .lbl { width: 54px; flex: none; color: var(--text-3); font-size: 13px; }
.field select { height: 34px; border: 0; background: transparent; padding: 0; box-shadow: none !important; width: auto; max-width: 100%; }
.field .plain { border: 0; background: transparent; height: 44px; padding: 0; box-shadow: none !important; }
.field .subject-input { font-size: 17px; font-weight: 620; }
.field .toggles { display: flex; gap: 4px; }
.field .toggles button { border: 0; background: none; color: var(--text-3); font-size: 12.5px; padding: 4px 6px; border-radius: 6px; }
.field .toggles button:hover { color: var(--text); background: var(--surface-sunk); }
.recips { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 0; min-width: 0; }
.recips input { flex: 1; min-width: 140px; border: 0 !important; background: transparent !important; height: 32px; padding: 0; box-shadow: none !important; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: 999px; background: var(--metal-soft); box-shadow: inset 0 0 0 1px var(--select-edge); font-size: 13px; animation: pillIn 220ms var(--spring) both; max-width: 100%; }
.pill.bad { background: var(--danger-bg); color: var(--danger); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 40%, transparent); }
.pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill button { border: 0; background: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: var(--text-3); padding: 0; }
.pill button:hover { background: var(--surface-sunk); color: var(--text); }
.pill button svg { width: 12px; height: 12px; }
@keyframes pillIn { from { transform: scale(.85); opacity: 0; } }
.suggest { position: absolute; top: 100%; left: 64px; z-index: 30; width: min(420px, 90%); padding: 6px; border-radius: var(--r-md); border: 1px solid var(--line); box-shadow: var(--shadow-3); animation: pop 160ms var(--ease-out) both; }
.suggest button { width: 100%; display: flex; gap: 10px; align-items: center; border: 0; background: none; padding: 7px 8px; border-radius: 8px; text-align: left; }
.suggest button.on, .suggest button:hover { background: var(--select); }
.suggest .avatar { width: 28px; height: 28px; font-size: 11px; }
.suggest small { color: var(--text-3); display: block; }
.toolbar { display: flex; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.toolbar .icon-btn { width: 32px; height: 32px; }
.toolbar .sep { width: 1px; background: var(--line); margin: 6px 4px; }
.editor-wrap { flex: 1; overflow: auto; }
.editor { max-width: 920px; margin: 0 auto; padding: 18px 28px 30px; min-height: 240px; outline: none; font-size: 15px; line-height: 1.65; }
.editor:empty::before { content: attr(data-placeholder); color: var(--text-3); }
.editor blockquote { margin: 10px 0; padding-left: 14px; border-left: 3px solid var(--line-strong); color: var(--text-2); }
.editor .sig { color: var(--text-2); }
.compose-atts { max-width: 920px; margin: 0 auto; padding: 0 28px 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.compose-foot { display: flex; align-items: center; gap: 10px; padding: 12px 28px; border-top: 1px solid var(--line); }
.compose-foot .grow { flex: 1; }
.compose-foot .ai-hint { color: var(--text-3); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
.compose-foot .ai-hint svg { width: 14px; height: 14px; color: var(--accent); }
.send-group { display: inline-flex; }
.send-group .btn-metal:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.send-group .btn-metal:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; padding: 0 9px; margin-left: 1px; }
.drop-overlay { position: absolute; inset: 12px; z-index: 40; border-radius: var(--r-xl); border: 2px dashed var(--select-edge); display: grid; place-items: center; font-weight: 600; color: var(--text-2); background: color-mix(in srgb, var(--surface-solid) 80%, transparent); animation: fade 160ms var(--ease) both; pointer-events: none; }

/* Menus, popovers, dialogues */
.popover {
  position: fixed; z-index: 60; min-width: 220px; padding: 6px; border-radius: var(--r-lg); border: 1px solid var(--line);
  box-shadow: var(--shadow-3); animation: pop 170ms var(--ease-out) both; transform-origin: var(--origin, top left);
}
@keyframes pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 8px 10px; border-radius: 9px; text-align: left; color: var(--text); font-size: 13.5px; }
.menu-item:hover, .menu-item:focus-visible { background: var(--select); outline: none; }
.menu-item svg { width: 17px; height: 17px; color: var(--text-2); }
.menu-item .kbd { margin-left: auto; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 6px; }
.menu-title { padding: 6px 10px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }

/* Sélecteur de design */
.theme-panel { width: 340px; padding: 16px; }
.theme-panel h4 { margin: 2px 2px 12px; font: 650 15px/1.2 var(--font-display); display: flex; align-items: center; gap: 8px; }
.finishes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.finish {
  position: relative; border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 10px; background: var(--surface-2); text-align: left; display: grid; gap: 10px;
  transition: border-color var(--t) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t) var(--ease);
}
.finish:hover { transform: translateY(-1px); }
.finish[aria-pressed="true"] { border-color: var(--select-edge); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent), var(--shadow-1); }
.finish .swatch { height: 54px; border-radius: 9px; position: relative; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), inset 0 -1px 0 rgba(0,0,0,.15); }
.finish .swatch::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%); transform: translateX(-100%); transition: transform 700ms var(--ease-out); }
.finish:hover .swatch::after { transform: translateX(100%); }
.finish.silver .swatch { background: linear-gradient(135deg, #fdfdfe 0%, #d6dae1 18%, #8e959f 42%, #f1f3f6 58%, #a9afb8 76%, #6a7079 100%); }
.finish.gold .swatch { background: linear-gradient(135deg, #fff8e8 0%, #ead3a2 18%, #a9844a 42%, #f8ead0 58%, #c9a565 76%, #7c5f2f 100%); }
.finish b { font-size: 13.5px; }
.finish small { display: block; color: var(--text-3); font-size: 11.5px; }
.finish .check { position: absolute; top: 16px; right: 16px; width: 20px; height: 20px; border-radius: 50%; background: rgba(255,255,255,.9); color: #111; display: none; place-items: center; box-shadow: var(--shadow-1); }
.finish .check svg { width: 12px; height: 12px; }
.finish[aria-pressed="true"] .check { display: grid; animation: pillIn 240ms var(--spring) both; }
.appearances { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 3px; border-radius: 11px; background: var(--surface-sunk); margin-bottom: 14px; }
.appearances button { border: 0; background: none; height: 34px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; color: var(--text-2); font-size: 12.5px; font-weight: 560; }
.appearances button svg { width: 15px; height: 15px; }
.appearances button[aria-pressed="true"] { background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-1), inset 0 1px 0 var(--metal-edge); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 2px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.switch { position: relative; width: 38px; height: 22px; flex: none; border-radius: 999px; border: 0; background: var(--line-strong); transition: background var(--t) var(--ease); padding: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform var(--t) var(--spring); }
.switch[aria-checked="true"] { background: var(--metal); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }

/* Panneaux (réglages) */
.panel { flex: 1; overflow: auto; }
.panel-inner { max-width: 760px; margin: 0 auto; padding: 28px 32px 60px; animation: openMsg 260ms var(--ease-out) both; }
.panel h1 { font: 700 28px/1.15 var(--font-display); letter-spacing: -.025em; margin: 0 0 6px; }
.panel .lead { color: var(--text-2); margin: 0 0 26px; }
.tabs { display: flex; gap: 4px; margin-bottom: 22px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 12px; color: var(--text-2); font-weight: 560; position: relative; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--text); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--metal); }
.card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-1); }
.card h3 { margin: 0 0 4px; font-size: 15px; }
.card p { margin: 0 0 12px; color: var(--text-2); }
.card-row { display: flex; align-items: center; gap: 12px; }
.card-row .grow { flex: 1; min-width: 0; }
.card-row small { color: var(--text-3); }
.providers { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.provider { border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface-solid); height: 64px; font-weight: 620; display: grid; place-items: center; transition: all var(--t) var(--ease); }
.provider:hover { transform: translateY(-1px); border-color: var(--select-edge); }
.provider[aria-pressed="true"] { background: var(--select); border-color: var(--select-edge); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 20%, transparent); }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid td, table.grid th { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 700; }
.st { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12px; }
.st::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st.ok { color: var(--ok); } .st.warning { color: #b7791f; } .st.error { color: var(--danger); }
.score { font: 700 40px/1 var(--font-display); letter-spacing: -.03em; }

/* Notifications (toasts) */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 90; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
@media (max-width: 860px) { .toasts { right: 50%; transform: translateX(50%); justify-items: center; bottom: 84px; } }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 14px; min-width: 260px; max-width: min(560px, 92vw);
  border: 1px solid var(--line); box-shadow: var(--shadow-3); font-size: 13.5px; animation: toastIn 340ms var(--spring) both; position: relative; overflow: hidden;
}
.toast.out { animation: toastOut 220ms var(--ease) forwards; }
.toast .grow { flex: 1; }
.toast svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.toast.error svg { color: var(--danger); }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--metal); animation: bar linear forwards; }
@keyframes bar { from { width: 100%; } to { width: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }

.overlay { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(8,10,14,.32); animation: fade 160ms var(--ease) both; padding: 20px; }
.dialog { width: min(520px, 100%); border-radius: var(--r-xl); border: 1px solid var(--line); box-shadow: var(--shadow-3); padding: 24px; animation: rise 260ms var(--ease-out) both; max-height: 90vh; overflow: auto; }
.dialog h3 { margin: 0 0 14px; font: 650 18px/1.2 var(--font-display); }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.shortcut-grid { display: grid; grid-template-columns: 1fr auto; gap: 8px 18px; font-size: 13px; color: var(--text-2); }

.demo-banner { position: fixed; bottom: 84px; left: 16px; z-index: 50; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; border-radius: 999px; border: 1px solid var(--select-edge); box-shadow: var(--shadow-2); font-size: 12.5px; color: var(--text-2); animation: rise 400ms var(--ease-out) both; }
.demo-banner b { color: var(--text); }

.mobile-only { display: none !important; }

/* ---------- Mobile : navigation repensée, pas réduite -------------------- */

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr !important; grid-template-rows: 1fr; }
  .resizer { display: none; }
  .nav, .list, .reader { grid-row: 1; grid-column: 1; }
  .nav { position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); z-index: 45; translate: -104% 0; transition: translate var(--t-slow) var(--ease-out); background: var(--surface-solid); box-shadow: var(--shadow-3); }
  .app.nav-open .nav { translate: 0 0; }
  .app.nav-open::after { content: ""; position: fixed; inset: 0; z-index: 44; background: rgba(0,0,0,.32); animation: fade 200ms var(--ease); }
  .app.nav-collapsed .nav .label, .app.nav-collapsed .nav .count, .app.nav-collapsed .nav-section, .app.nav-collapsed .brand-word, .app.nav-collapsed .compose-btn span, .app.nav-collapsed .user-chip .who { display: revert; }
  .nav-head .collapse { display: none; }
  .list { border-right: 0; }
  .reader { position: fixed; inset: 0; z-index: 30; background: var(--bg); translate: 100% 0; transition: translate var(--t-slow) var(--ease-out); }
  .reader::before { content: ""; position: absolute; inset: 0; background: var(--bg-sheen); z-index: -1; }
  .app.show-reader .reader { translate: 0 0; }
  .demo-banner { left: 14px; bottom: 24px; }
  body:has(.app.show-reader) .demo-banner, body:has(.app.nav-open) .demo-banner { display: none; }
  .sender { flex-wrap: wrap; align-items: flex-start; }
  .sender .who .addr { display: block; margin-left: 0; overflow: hidden; text-overflow: ellipsis; }
  .sender .when { width: 100%; text-align: left; padding-left: 0; }
  .mobile-only { display: inline-grid !important; }
  .desktop-only { display: none !important; }
  .reader-inner, .panel-inner { padding: 18px 16px 90px; }
  .reader h1 { font-size: 22px; }
  .compose-fields, .editor, .compose-atts { padding-left: 16px; padding-right: 16px; }
  .compose-foot { padding: 10px 16px; }
  .fab { position: fixed; right: 18px; bottom: 22px; z-index: 25; width: 58px; height: 58px; border-radius: 18px; padding: 0; }
  .fab svg { width: 22px; height: 22px; }
  .list-head { padding-top: 12px; }
  .msgs { padding-bottom: 96px; }
  .theme-panel { width: min(340px, 92vw); }
  .paper iframe { height: 70vh; }
}
@media (min-width: 861px) { .fab { display: none !important; } }

/* ---------- Réduction des animations ------------------------------------ */

@media (prefers-reduced-motion: reduce) { :root:not([data-motion="full"]) { --t-fast: 0ms; --t: 0ms; --t-slow: 0ms; } }
[data-motion="reduced"] *, [data-motion="reduced"] *::before, [data-motion="reduced"] *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }

/* View Transitions : changement de finition et d'apparence */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: reveal 620ms var(--ease-out); clip-path: circle(var(--vt-r, 150%) at var(--vt-x, 50%) var(--vt-y, 50%)); }
@keyframes reveal { from { clip-path: circle(0 at var(--vt-x, 50%) var(--vt-y, 50%)); } }

/* ---------- Logo : métal selon la finition ------------------------------ */
.s-0 { stop-color: var(--lg-0); } .s-1 { stop-color: var(--lg-1); } .s-2 { stop-color: var(--lg-2); }
.s-3 { stop-color: var(--lg-3); } .s-4 { stop-color: var(--lg-4); } .s-5 { stop-color: var(--lg-5); }
.s-bg0 { stop-color: var(--lg-bg0); } .s-bg1 { stop-color: var(--lg-bg1); }
[data-finish="silver"] { --lg-0: #ffffff; --lg-1: #cdd2da; --lg-2: #7b828d; --lg-3: #f1f3f6; --lg-4: #9da4ae; --lg-5: #5b616a; }
[data-finish="gold"] { --lg-0: #fff8e6; --lg-1: #e8cf98; --lg-2: #a17c40; --lg-3: #f8e9cb; --lg-4: #c7a260; --lg-5: #735828; }
[data-theme="light"] { --lg-bg0: #262a31; --lg-bg1: #0e1013; }
[data-theme="dark"] { --lg-bg0: #2a2d33; --lg-bg1: #111215; }
[data-finish="gold"][data-theme="light"] { --lg-bg0: #2b241a; --lg-bg1: #110e09; }
[data-finish="gold"][data-theme="dark"] { --lg-bg0: #2c251a; --lg-bg1: #120f0a; }
.logo-mark { display: block; filter: drop-shadow(0 6px 14px rgba(0,0,0,.18)); }
.logo-mark .glyph { transition: filter var(--t) var(--ease); }
.nav-head:hover .logo-mark .ring { animation: orbit 1400ms var(--ease-out); transform-origin: 32px 35px; }
@keyframes orbit { 50% { opacity: 1; stroke-width: 2.2; } }

/* Squelettes de chargement et utilitaires */
.skeleton .sk-a { width: 55%; margin-bottom: 8px; }
.skeleton .sk-b { width: 85%; margin-bottom: 8px; }
.skeleton .sk-c { width: 40%; }
.nav-item.skeleton { pointer-events: none; }
.spin-ico { animation: spin 1s linear infinite; }
.pop-pad { padding: 4px 8px 8px; }
.pop-pad input { width: 100%; }
.noscript { padding: 40px; text-align: center; }
#root { height: 100%; }
.auth-logo .logo-mark { width: 76px; height: 76px; filter: drop-shadow(0 14px 26px rgba(0,0,0,.22)); }
.empty-state .logo-mark, .intro .logo-mark { flex: none; }

.demo-banner .long { display: none; }
