/* =========================================================
   SAKA — espace client et gestion (thème sombre)
   Mêmes jetons que la maquette publique (index.html) et le kit de marque.
   ========================================================= */
@font-face { font-family: "Bebas Neue"; src: url(fonts/bebas-neue-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url(fonts/dm-sans-latin-wght-normal.woff2) format("woff2"); font-weight: 100 1000; font-display: swap; }
:root {
  --bg: #0f0f10; --surface: #111113; --card: #18181b; --card-2: #1f1f23;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.14);
  --text: #ededef; --muted: #a3a3aa; --dim: #8b8b93;
  --red: #d0001b; --red-hover: #e5102c; --red-text: #ff4d63; --red-glow: rgba(208,0,27,.22);
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 40px; --s6: 48px; --s8: 64px;
  --r-sm: 8px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;
  --ease: cubic-bezier(.22,1,.36,1); --t-fast: .2s; --t: .45s; --t-slow: .9s;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 24px 48px rgba(0,0,0,.45);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.55 "DM Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--red-text); outline-offset: 3px; border-radius: var(--r-sm); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Typographie : lignes équilibrées, jamais de mot seul en fin de paragraphe (complété par assets/typo.js) */
body { text-wrap: pretty; }
h1, h2, h3, h4, summary, .display, button, .btn, label, th, small, figcaption { text-wrap: balance; }

[hidden] { display: none !important; }
svg.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.display { font-family: "Bebas Neue", sans-serif; font-weight: 400; letter-spacing: .01em; line-height: .92; margin: 0; }
.logo { font-family: "Bebas Neue", sans-serif; font-size: 32px; letter-spacing: .04em; line-height: 1; }
.logo span { color: var(--red); }

/* Boutons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); height: 48px; padding: 0 var(--s3); border-radius: var(--r-pill); font-size: 15px; font-weight: 600; white-space: nowrap; transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.btn:active { transform: scale(.98); }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 8px 24px var(--red-glow); }
.btn-red:hover { background: var(--red-hover); }
.btn-ghost { border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: rgba(255,255,255,.32); background: rgba(255,255,255,.04); }
.btn-sm { height: 40px; padding: 0 var(--s2); font-size: 14px; }
.btn svg.i { width: 18px; height: 18px; }

/* Cartes et étiquettes */
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: var(--s3); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); margin-bottom: var(--s2); }
.card-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.label { font-size: 13px; color: var(--dim); }
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); white-space: nowrap; flex: none; font-size: 12px; font-weight: 600; background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid var(--line); }
.tag.now { color: var(--red-text); background: rgba(208,0,27,.1); border-color: rgba(208,0,27,.28); }
.tag.now::before, .tag.live::before { content: ""; width: 6px; height: 6px; background: var(--red); }
.tag.live::before { animation: pulse 1.6s var(--ease) infinite; }
.tag.live, .tag.done { color: var(--text); border-color: var(--line-2); }
@keyframes pulse { 50% { transform: scale(.6); opacity: .6; } }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: var(--s3) 16px; position: relative; overflow: hidden; }
.login::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px); background-size: 64px 64px; opacity: .35; -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 45%, #000 10%, transparent 75%); mask-image: radial-gradient(ellipse 50% 50% at 50% 45%, #000 10%, transparent 75%); }
.login-box { position: relative; width: min(400px, 100%); text-align: center; animation: up var(--t-slow) var(--ease) both; }
.login-box .logo { font-size: 48px; }
.login-box h1 { font-size: 56px; margin-top: var(--s4); }
.login-box form { margin-top: var(--s4); display: grid; gap: 12px; text-align: left; }
.login-box .btn { width: 100%; }
.login-note { margin: var(--s3) 0 0; font-size: 13px; color: var(--dim); }
.sent-ic { width: 64px; height: 64px; margin: var(--s4) auto 0; border-radius: 20px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line-2); }
.sent-ic svg.i { width: 28px; height: 28px; color: var(--red-text); }
.login-box p.sent { color: var(--muted); margin: var(--s2) 0 var(--s4); }
@keyframes up { from { opacity: 0; transform: translateY(16px); } }

/* Champs */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input { width: 100%; height: 48px; padding: 0 var(--s2); border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line-2); transition: border-color var(--t-fast); }
textarea.input { height: 112px; padding: 12px var(--s2); resize: vertical; }
.input:focus { outline: none; border-color: var(--red-text); }
.input::placeholder { color: var(--dim); }

/* ---------- Application ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: var(--s3) var(--s2); border-right: 1px solid var(--line); background: var(--surface); }
.side .logo { padding: 0 12px; }
.side .logo small { display: block; margin-top: 6px; font: 600 12px/1 "DM Sans", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.nav { display: grid; gap: 2px; margin-top: var(--s5); }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; color: var(--muted); font-size: 15px; font-weight: 500; transition: color var(--t-fast), background var(--t-fast); }
.nav a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav a.active { color: var(--text); background: rgba(255,255,255,.07); }
.nav a.active::before { content: ""; position: absolute; left: -16px; top: 14px; width: 4px; height: 16px; background: var(--red); border-radius: 0 2px 2px 0; }
.nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line); }
.avatar { width: 40px; height: 40px; flex: none; border-radius: 12px; background: linear-gradient(135deg, #2a2a2f, #1b1b1e); border: 1px solid var(--line-2); display: grid; place-items: center; font-weight: 700; font-size: 14px; }
.side-foot b { display: block; font-size: 14px; line-height: 1.3; }
.side-foot small { font-size: 12px; color: var(--dim); }
.side-foot button { margin-left: auto; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--dim); }
.side-foot button:hover { color: var(--text); background: rgba(255,255,255,.06); }
.side-foot button svg.i { width: 18px; height: 18px; }

.main { padding: var(--s4) var(--s5) var(--s8); min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); max-width: 1200px; }
.mode { display: inline-flex; align-items: center; gap: var(--s1); font-size: 13px; color: var(--dim); }
.seg { position: relative; display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line); }
.seg button { height: 32px; padding: 0 14px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; color: var(--muted); transition: color var(--t-fast), background var(--t-fast); white-space: nowrap; }
.seg button[aria-pressed="true"] { background: rgba(255,255,255,.1); color: var(--text); }
.view { max-width: 1200px; animation: fadeUp var(--t) var(--ease); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s2); flex-wrap: wrap; margin: var(--s5) 0 var(--s4); }
.view-head h1 { font-size: clamp(48px, 5vw, 64px); }
.view-head p { margin: var(--s1) 0 0; color: var(--muted); }

.grid { display: grid; gap: var(--s2); }
.g-home { grid-template-columns: 1.35fr 1fr; }
.g-2 { grid-template-columns: 1fr 1fr; }
.g-site { grid-template-columns: 1.2fr 1fr; }
.g-pay { grid-template-columns: 1.4fr 1fr; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.tile { padding: var(--s2) var(--s3); text-align: left; transition: border-color var(--t-fast); }
button.tile:hover { border-color: var(--line-2); }
.tile small { display: block; font-size: 13px; color: var(--dim); }
.tile strong { display: block; margin-top: 4px; font-size: 22px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; white-space: nowrap; }
.tile strong em { font-style: normal; font-size: 14px; font-weight: 500; color: var(--dim); }
.tile strong em.apres::before { content: "· "; }
.mt { margin-top: var(--s2); }

/* Projet (mêmes codes que Chez Paulette sur le site) */
.big { font-size: 40px; font-weight: 600; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.big small { font-size: 16px; color: var(--dim); font-weight: 500; }
.row-b { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); }
.bar { height: 8px; border-radius: var(--r-pill); background: rgba(255,255,255,.06); margin-top: var(--s2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #8a0012, var(--red)); transition: width 1.4s var(--ease) .15s; }
.bar.white i { background: rgba(237,237,239,.75); }
.steps { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; gap: var(--s1); }
.steps li { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 12px; height: 48px; padding: 0 var(--s2); border-radius: var(--r-md); background: var(--card-2); border: 1px solid var(--line); font-size: 15px; }
.steps .ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); }
.steps .ic svg { width: 12px; height: 12px; opacity: 0; }
.steps .done .ic svg { opacity: 1; }
.steps .done .ic { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.4); color: #fff; }
.steps .now { border-color: rgba(208,0,27,.3); background: linear-gradient(90deg, rgba(208,0,27,.08), var(--card-2) 60%); }
.steps .now .ic { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-glow); }
.steps .now .ic::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.6s var(--ease) infinite; }
.steps .todo { color: var(--dim); }
.steps small { font-size: 13px; color: var(--dim); }
.steps .now small { color: var(--red-text); }

.todo-card { overflow: hidden; border-color: rgba(208,0,27,.35); background: linear-gradient(180deg, #1d1d21, var(--card)); display: flex; flex-direction: column; }
.todo-card::before { content: ""; position: absolute; inset: -30% -20% auto auto; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(var(--red-glow), transparent 65%); filter: blur(16px); pointer-events: none; }
.todo-card h3 { margin: var(--s2) 0 0; font-family: "Bebas Neue", sans-serif; font-weight: 400; font-size: 44px; line-height: .95; }
.todo-card p { margin: var(--s1) 0 var(--s3); color: var(--muted); }
.todo-card .acts { margin-top: auto; display: flex; gap: var(--s1); flex-wrap: wrap; }
.site-url { display: flex; align-items: center; gap: var(--s1); font-size: 20px; font-weight: 600; margin-top: var(--s2); word-break: break-all; }
.site-url svg.i { color: var(--dim); width: 18px; height: 18px; }

/* Liste générique (documents, paiements, demandes) */
.list { display: grid; }
.list .it { display: grid; grid-template-columns: 40px minmax(0,1fr) auto auto; align-items: center; gap: var(--s2); min-height: 64px; padding: 12px 0; border-top: 1px solid var(--line); }
.list .it:first-child { border-top: 0; }
.list .ic-box { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line-2); color: var(--muted); }
.list .ic-box svg.i { width: 18px; height: 18px; }
.list b { display: block; font-size: 15px; font-weight: 600; text-wrap: balance; }
.list small { font-size: 13px; color: var(--dim); overflow-wrap: anywhere; }
.list .amt { font-weight: 600; white-space: nowrap; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--muted); border: 1px solid transparent; transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast); }
.icon-btn:hover { color: var(--text); background: rgba(255,255,255,.05); border-color: var(--line-2); }
.icon-btn svg.i { width: 18px; height: 18px; }
.chips { display: flex; gap: var(--s1); flex-wrap: wrap; }
.chip { height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; color: var(--muted); transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast); }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }

/* Paiements : 12 cases */
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; margin-top: var(--s3); }
.months i { aspect-ratio: 1; border-radius: var(--r-sm); background: rgba(255,255,255,.05); border: 1px solid var(--line); transform: scale(.6); opacity: 0; transition: transform .5s var(--ease) calc(var(--i) * 50ms), opacity .5s var(--ease) calc(var(--i) * 50ms), background .3s; }
.months.in i { transform: none; opacity: 1; }
.months i.paid { background: rgba(237,237,239,.78); border-color: transparent; }
.months i.next { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-glow) inset; }
.legend { display: flex; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s2); font-size: 13px; color: var(--muted); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; background: rgba(255,255,255,.08); border: 1px solid var(--line-2); }
.legend .l-paid::before { background: rgba(237,237,239,.78); border-color: transparent; }
.legend .l-next::before { border-color: var(--red); background: rgba(208,0,27,.25); }
.after { display: flex; gap: var(--s2); margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); flex-wrap: wrap; }
.after > div { flex: 1 1 180px; }
.after b { display: block; font-size: 15px; }
.after small { font-size: 13px; color: var(--dim); }

/* Mon site : aperçu dessiné */
.browser { border-radius: 14px; overflow: hidden; background: #0f0f11; border: 1px solid var(--line); }
.browser .bt { display: flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-bottom: 1px solid var(--line); }
.browser .bt i { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); }
.browser .bt span { margin-left: 8px; flex: 1; height: 18px; border-radius: 6px; background: rgba(255,255,255,.05); font-size: 11px; line-height: 18px; color: var(--dim); padding: 0 8px; overflow: hidden; white-space: nowrap; }
.mini-site { aspect-ratio: 16 / 10; background: linear-gradient(160deg, #3a2a22, #1b1411 70%); position: relative; padding: 7% 8%; color: #f4ece6; overflow: hidden; }
.mini-site .nm { font-family: "Bebas Neue", sans-serif; font-size: clamp(22px, 4vw, 44px); line-height: .9; }
.mini-site .sb { margin-top: 6px; font-size: clamp(10px, 1.2vw, 13px); opacity: .7; }
.mini-site .cta { display: inline-block; margin-top: 8%; padding: 6px 12px; border-radius: 999px; background: #f4ece6; color: #1b1411; font-size: 11px; font-weight: 700; }
.mini-site .ph { position: absolute; right: 6%; bottom: 10%; width: 38%; aspect-ratio: 4/3; border-radius: 10px; background: radial-gradient(circle at 35% 40%, #c98b5a, #7a4a2c 60%, #3a2418); opacity: .9; }
.mini-site.wip::after { content: "En construction"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(15,15,16,.55); font-size: 13px; font-weight: 600; color: var(--text); letter-spacing: .04em; }
.facts { display: grid; }
.facts > div { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); min-height: 56px; border-top: 1px solid var(--line); }
.facts > div:first-child { border-top: 0; }
.facts span { color: var(--muted); font-size: 15px; }
.facts b { font-size: 15px; font-weight: 600; text-align: right; }

/* Graphiques */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .gl line { stroke: var(--line); }
.chart text { fill: var(--dim); font-size: 11px; font-family: "DM Sans", sans-serif; font-variant-numeric: tabular-nums; }
.chart .ln { fill: none; stroke: var(--red); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.chart.in .ln { transition: stroke-dashoffset 1.8s var(--ease) .15s; stroke-dashoffset: 0; }
.chart .ar { opacity: 0; transition: opacity 1s var(--ease) 1.1s; }
.chart.in .ar { opacity: 1; }
.hbars { display: grid; gap: 12px; }
.hbars div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; font-size: 14px; }
.hbars span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars b { font-weight: 600; }
.hbars i { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: rgba(255,255,255,.06); overflow: hidden; }
.hbars i::after { content: ""; display: block; height: 100%; width: var(--w); border-radius: inherit; background: rgba(237,237,239,.75); transform-origin: left; transform: scaleX(0); transition: transform 1.2s var(--ease) .2s; }
.hbars.in i::after { transform: none; }
.delta { color: var(--text); font-size: 13px; font-weight: 600; }
.delta::before { content: "▲ "; color: var(--red-text); font-size: 10px; }

/* États vides */
.empty { text-align: center; padding: var(--s8) var(--s3); }
.empty .ic-big { width: 64px; height: 64px; margin: 0 auto; border-radius: 20px; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--line-2); color: var(--muted); }
.empty .ic-big svg.i { width: 26px; height: 26px; }
.empty h3 { margin: var(--s3) 0 var(--s1); font-size: 20px; font-weight: 600; }
.empty p { margin: 0 auto; color: var(--muted); max-width: 360px; }

/* Messages */
.thread { display: flex; flex-direction: column; height: min(640px, calc(100vh - 260px)); min-height: 420px; padding: 0; overflow: hidden; }
.thread-head { display: flex; align-items: center; gap: 12px; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); }
.thread-head b { display: block; font-size: 15px; }
.thread-head small { font-size: 13px; color: var(--dim); }
.msgs { flex: 1; overflow: auto; padding: var(--s3); display: flex; flex-direction: column; gap: 12px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.18) transparent; }
.day { align-self: center; font-size: 12px; color: var(--dim); margin: var(--s1) 0; }
.msg { max-width: min(480px, 82%); padding: 12px var(--s2); border-radius: 18px; font-size: 15px; line-height: 1.45; background: var(--card-2); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.me { align-self: flex-end; background: var(--red); border-color: var(--red); color: #fff; border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; }
.msg small { display: block; margin-top: 4px; font-size: 11px; opacity: .65; }
.msg .att { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(0,0,0,.2); font-size: 13px; font-weight: 600; }
.msg .att svg.i { width: 16px; height: 16px; }
.msg.new { animation: fadeUp var(--t) var(--ease); }
.composer { display: flex; gap: var(--s1); padding: 12px; border-top: 1px solid var(--line); }
.composer .input { height: 48px; border-radius: var(--r-pill); }
.composer .btn { width: 48px; padding: 0; flex: none; }

/* Fichiers */
.drop { display: grid; place-items: center; text-align: center; gap: 12px; padding: var(--s5) var(--s3); border: 1.5px dashed var(--line-2); border-radius: var(--r-lg); background: rgba(255,255,255,.02); transition: border-color var(--t-fast), background var(--t-fast); }
.drop.over { border-color: var(--red-text); background: rgba(208,0,27,.06); }
.drop b { font-size: 17px; }
.drop small { color: var(--dim); font-size: 13px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--s2); }
.file { padding: 10px; border-radius: var(--r-md); background: var(--card); border: 1px solid var(--line); min-width: 0; }
.file .th { aspect-ratio: 4 / 3; border-radius: 10px; display: grid; place-items: center; font: 400 26px/1 "Bebas Neue", sans-serif; letter-spacing: .04em; color: rgba(255,255,255,.75); background: var(--card-2); overflow: hidden; }
.file .th img { width: 100%; height: 100%; object-fit: cover; }
.file b { display: block; margin-top: 10px; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file small { font-size: 12px; color: var(--dim); }
.file.new { animation: fadeUp var(--t) var(--ease); }
.sub { margin: var(--s4) 0 var(--s2); font-size: 15px; font-weight: 600; color: var(--muted); }

/* Panneau qui monte du bas */
.veil { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity var(--t) var(--ease); }
.veil.open { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; left: 50%; bottom: 0; z-index: 90; width: min(560px, 100%); max-height: 88vh; overflow: auto; transform: translate(-50%, 104%); transition: transform .6s var(--ease); visibility: hidden; background: linear-gradient(180deg, #1e1e22, #151517); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 32px 32px 0 0; padding: 12px var(--s4) calc(var(--s5) + env(safe-area-inset-bottom)); box-shadow: 0 -24px 64px rgba(0,0,0,.6); overscroll-behavior: contain; }
.sheet.open { transform: translate(-50%, 0); visibility: visible; }
.sheet .handle { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto var(--s4); }
.sheet h3 { margin: 0 48px 0 0; font-size: 24px; font-weight: 600; }
.sheet form { display: grid; gap: var(--s3); margin-top: var(--s3); }
.sheet .note { font-size: 13px; color: var(--dim); margin: 0; }
.sheet-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.sheet-close:hover { background: rgba(255,255,255,.06); color: var(--text); }
.menu-list { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s1); margin-top: var(--s3); }
.menu-list a { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 var(--s2); border-radius: var(--r-md); background: rgba(255,255,255,.04); border: 1px solid var(--line); font-weight: 600; font-size: 15px; color: var(--muted); }
.menu-list a.active { color: var(--text); border-color: rgba(208,0,27,.4); }
.menu-list .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.menu-foot { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); }

/* Message bref en bas */
.toast { position: fixed; left: 50%; bottom: 32px; z-index: 100; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; padding: 12px var(--s3); border-radius: var(--r-pill); background: #26262b; border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; box-shadow: 0 16px 48px rgba(0,0,0,.5); transition: opacity var(--t-fast), transform var(--t) var(--ease); white-space: nowrap; max-width: calc(100% - 32px); overflow: hidden; text-overflow: ellipsis; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* Mobile : en-tête + Dock (comme le site public) */
.m-head { display: none; }
.dock { display: none; }

@media (max-width: 1100px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .g-home, .g-site, .g-pay { grid-template-columns: 1fr; }
}
@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .main { padding: 0 var(--s3) 136px; }
  .m-head { display: flex; justify-content: space-between; align-items: center; height: 72px; }
  .m-head .avatar { width: 36px; height: 36px; font-size: 13px; }
  .topbar { margin-top: var(--s1); }
  .view-head { margin-top: var(--s3); }
  .toast { bottom: 108px; }
  .dock { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 50; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 6px; border-radius: var(--r-pill); background: rgba(24,24,27,.82); border: 1px solid var(--line-2); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); box-shadow: 0 16px 48px rgba(0,0,0,.55), 0 1px 0 rgba(255,255,255,.06) inset; }
  .dock-btn { position: relative; width: 52px; height: 48px; border-radius: var(--r-pill); display: grid; place-items: center; color: var(--muted); }
  .dock-btn.active { color: var(--text); background: rgba(255,255,255,.1); }
  .dock-dot { position: absolute; top: 10px; right: 12px; width: 8px; height: 8px; background: var(--red); box-shadow: 0 0 0 2px #18181b; }
  .dock-cta { height: 48px; padding: 0 var(--s3); margin: 0 4px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 6px; background: var(--red); color: #fff; font-size: 15px; font-weight: 600; white-space: nowrap; }
  .dock-cta svg.i { width: 18px; height: 18px; }
}
@media (max-width: 720px) {
  .main { padding: 0 16px 128px; }
  .g-2 { grid-template-columns: 1fr; }
  .card { padding: 20px; }
  .topbar { flex-direction: column; align-items: stretch; }
  .mode { justify-content: space-between; }
  .view-head .btn { width: 100%; }
  .big { font-size: 34px; }
  .tile strong { white-space: normal; }
  .tile strong em.apres { display: block; margin-top: 2px; }
  .tile strong em.apres::before { content: none; }
  .btn { height: auto; min-height: 48px; padding-top: 12px; padding-bottom: 12px; white-space: normal; text-align: center; }
  .todo-card h3 { font-size: 38px; }
  .list .it { grid-template-columns: 40px minmax(0,1fr) auto; }
  .list .it .hide-s { display: none; }
  .list .it > .tag { grid-column: 2; grid-row: 2; justify-self: start; margin-top: -4px; }
  .list .it > .amt { grid-column: 3; grid-row: 1; }
  .months { gap: 4px; }
  .months i { border-radius: 5px; }
  .sheet { padding-left: var(--s3); padding-right: var(--s3); }
  .thread { height: calc(100svh - 300px); }
}
@media (max-width: 420px) {
  /* Téléphone étroit : la date au-dessus du compteur, plus de place pour les libellés */
  .row-b { flex-direction: column; align-items: flex-start; gap: 8px; }
  .card { padding: 16px; }
  .list .it, .list .it.it3 { grid-template-columns: 32px minmax(0,1fr) auto; gap: 12px; }
  .list .ic-box { width: 32px; height: 32px; border-radius: 10px; }
  .mode { flex-direction: column; align-items: stretch; gap: 6px; }
  .seg { display: flex; }
  .seg button { flex: 1; padding: 0 8px; }
}
@media (max-width: 380px) {
  .menu-list { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
  .dock-cta { padding: 0 var(--s2); }
  .dock-btn { width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
}

/* ---------- Ajouts de l'espace réel ---------- */
.login-err { margin: 0; font-size: 14px; color: var(--red-text); min-height: 20px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.side-foot .who { min-width: 0; text-align: left; display: flex; align-items: center; gap: 12px; flex: 1; border-radius: 12px; }
.side-foot .who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 108px; }
.m-head button.avatar { cursor: pointer; }
a.tile { display: block; }
.list a.icon-btn, .file a { color: inherit; }
.file { position: relative; }
.file .th { position: relative; }
.file .del { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: rgba(15,15,16,.78); border: 1px solid var(--line-2); color: var(--muted); opacity: 0; transition: opacity var(--t-fast); }
.file:hover .del, .file .del:focus-visible { opacity: 1; }
@media (hover: none) { .file .del { opacity: 1; } }
.file .del svg.i { width: 16px; height: 16px; }
.file a.th { display: grid; }
.drop.busy { opacity: .6; pointer-events: none; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 48px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch i { flex: none; width: 48px; height: 28px; border-radius: 999px; background: rgba(255,255,255,.12); position: relative; transition: background var(--t-fast); }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform var(--t-fast) var(--ease); }
.switch input:checked + i { background: var(--red); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--red-text); outline-offset: 3px; }
.sheet .rowlinks { display: grid; gap: var(--s1); }
.sheet .rowlinks a, .sheet .rowlinks button { display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 var(--s2); border-radius: var(--r-md); background: rgba(255,255,255,.04); border: 1px solid var(--line); font-size: 15px; font-weight: 600; text-align: left; }
.sheet .rowlinks a:hover, .sheet .rowlinks button:hover { border-color: var(--line-2); }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; }
.list b.wrap2 { white-space: normal; overflow-wrap: break-word; }
.list .it.it3 { grid-template-columns: 40px minmax(0,1fr) auto; }
.loader { min-height: 100vh; display: grid; place-items: center; color: var(--dim); font-size: 14px; }
.calm h3 { margin: var(--s2) 0 0; font-family: "Bebas Neue", sans-serif; font-weight: 400; font-size: 40px; line-height: .95; }
.calm p { margin: var(--s1) 0 var(--s3); color: var(--muted); }
.late { color: var(--red-text); font-weight: 600; }
