@font-face { font-family: "Nunito"; src: url(/fonts/nunito.woff2) format("woff2"); font-weight: 200 1000; font-display: swap; }

:root {
  --font: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #fbf7f4; --surface: rgba(255,255,255,.86); --surface-solid: #ffffff; --fg: #2a2733; --muted: #77728a; --line: #ece6f2;
  --accent: #6c5ce7; --accent-2: #8b7ff0; --accent-soft: #ece8ff; --accent-fg: #fff; --err: #c0392b; --ok: #3fae7a; --ok-soft: #d8f3e6;
  --ink: #2a2733; --ink-muted: #6f6a80; --ink-line: rgba(60,40,90,.08);
  --jaune: #fff1b8; --rose: #ffd9e4; --bleu: #d3e8ff; --vert: #d2f2df; --orange: #ffe0c7; --violet: #e4dcff;
  --blob1: #ffd6e5; --blob2: #dcd6ff; --blob3: #ccf0e1; --blob4: #ffe6cc;
  --shadow: 0 1px 2px rgba(80,60,120,.06), 0 6px 18px rgba(80,60,120,.07);
  --shadow-ui: 0 8px 30px rgba(80,60,120,.18);
  --radius: 16px;
}
/* Thème : theme.js pose data-theme="light" ou "dark" sur <html> selon le choix de l'utilisateur
   (Mon compte › Apparence : Automatique / Clair / Sombre). Sans JavaScript : thème de l'appareil. */
:root { color-scheme: light; }
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #17151f; --surface: rgba(34,31,45,.88); --surface-solid: #221f2d; --fg: #ece9f5; --muted: #a29db5; --line: #332f42;
  --accent: #a99cff; --accent-2: #c0b6ff; --accent-soft: #2e2a48; --accent-fg: #17151f; --err: #ff8f84; --ok: #7fdcae; --ok-soft: #1f3a2f;
  --ink: #ece9f5; --ink-muted: #b3aec6; --ink-line: rgba(255,255,255,.08);
  --jaune: #3a3424; --rose: #3d2a33; --bleu: #24324a; --vert: #233a2f; --orange: #3d2f24; --violet: #2f2a48;
  --blob1: rgba(255,150,190,.12); --blob2: rgba(150,130,255,.14); --blob3: rgba(110,220,180,.10); --blob4: rgba(255,190,130,.08);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
  --shadow-ui: 0 8px 30px rgba(0,0,0,.5);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #17151f; --surface: rgba(34,31,45,.88); --surface-solid: #221f2d; --fg: #ece9f5; --muted: #a29db5; --line: #332f42;
    --accent: #a99cff; --accent-2: #c0b6ff; --accent-soft: #2e2a48; --accent-fg: #17151f; --err: #ff8f84; --ok: #7fdcae; --ok-soft: #1f3a2f;
    --ink: #ece9f5; --ink-muted: #b3aec6; --ink-line: rgba(255,255,255,.08);
    --jaune: #3a3424; --rose: #3d2a33; --bleu: #24324a; --vert: #233a2f; --orange: #3d2f24; --violet: #2f2a48;
    --blob1: rgba(255,150,190,.12); --blob2: rgba(150,130,255,.14); --blob3: rgba(110,220,180,.10); --blob4: rgba(255,190,130,.08);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    --shadow-ui: 0 8px 30px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--fg); font: 16px/1.5 var(--font);
  background:
    radial-gradient(55vmax 45vmax at 0% 0%, var(--blob1), transparent 70%),
    radial-gradient(50vmax 45vmax at 100% 0%, var(--blob2), transparent 70%),
    radial-gradient(55vmax 45vmax at 100% 100%, var(--blob3), transparent 70%),
    radial-gradient(45vmax 40vmax at 0% 100%, var(--blob4), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
/* Pas de zoom automatique d'iOS sur les champs (texte >= 16 px) */
@media (hover: none) { input, select, textarea { font-size: 16px !important; } }
a { color: var(--accent); }
button, select { font: inherit; color: inherit; cursor: pointer; }
input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
kbd { font: 600 .7rem var(--font); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; opacity: .7; margin-left: 4px; }
[hidden] { display: none !important; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); font-weight: 700;
  background: var(--surface); color: var(--fg); transition: background .12s;
}
.btn:hover { background: var(--bg); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--accent-fg); box-shadow: 0 4px 14px rgba(108,92,231,.25); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.wide { width: 100%; padding: 11px; margin-top: 4px; }
.btn.small { padding: 5px 10px; font-size: .85rem; font-weight: 600; background: transparent; border-color: var(--ink-line); color: var(--ink); }
.btn.small:hover { background: var(--ink-line); }
.btn.small.ghost { border: 0; color: var(--ink-muted); text-decoration: underline; text-underline-offset: 3px; }
.icon {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-muted); font-size: 1.2rem; line-height: 1;
}
.icon:hover { background: var(--ink-line); color: var(--ink); }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; font-weight: 600; background: var(--surface); }
.chip:hover { border-color: var(--accent); }

/* ---------- Barre du haut + menu ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  padding: 8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  background: var(--surface); border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--fg); font-weight: 800; font-size: 1.1rem; justify-self: start; }
.brand img { width: 26px; height: 26px; }
.tabs { display: flex; gap: 3px; padding: 4px; background: var(--accent-soft); border-radius: 14px; }
.tab {
  position: relative; display: flex; align-items: center; gap: 7px; padding: 6px 16px; border-radius: 9px;
  text-decoration: none; color: var(--muted); font-weight: 700; font-size: .92rem; transition: color .15s, background .15s;
}
.tab i { font-style: normal; font-size: 1.05rem; }
.tab:hover { color: var(--fg); }
.tab[aria-current=page] { background: var(--surface-solid); color: var(--accent); box-shadow: 0 2px 8px rgba(108,92,231,.18); }
.tab .badge { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: var(--accent-fg); font-size: .68rem; line-height: 18px; text-align: center; }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.top-actions form { margin: 0; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); padding: 4px 8px; }
.sync i { width: 8px; height: 8px; border-radius: 50%; background: #aaa; }
.sync.ok i { background: #3cbf7f; }
.sync.busy i { background: #f0a020; }
.sync.off i { background: var(--err); }
.avatar-btn { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; padding: 3px 10px 3px 3px; border-radius: 999px; font-weight: 600; font-size: .9rem; }
.avatar-btn:hover { background: var(--bg); }
.avatar {
  --h: 160; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: hsl(var(--h) 80% 86%); color: hsl(var(--h) 45% 30%); font-weight: 800; font-size: .8rem; text-transform: uppercase;
}

/* ---------- En-tête de page ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 0 16px 60px; }
.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; margin: 24px 0 16px; }
.hero h1 { margin: 0; font-size: 1.6rem; line-height: 1.2; }
.today { margin: 2px 0 0; color: var(--muted); text-transform: capitalize; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; }
.stat { padding: 5px 14px; border-radius: 999px; background: var(--rose); color: var(--ink); }
.stat:nth-child(2) { background: var(--violet); }
.stat:nth-child(3) { background: var(--vert); }
.stat b { font-size: 1.05rem; margin-right: 4px; }
.stat span { font-size: .85rem; color: var(--ink-muted); font-weight: 600; }
.tools { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; box-shadow: var(--shadow); }
.search span { opacity: .6; font-size: .9rem; }
.search input { flex: 1; border: 0; background: transparent; padding: 9px 0; outline: none; min-width: 0; }
.search:focus-within { border-color: var(--accent); }

/* ---------- Listes ---------- */
.board { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 285px), 1fr)); align-items: start; }
.note {
  --paper: var(--jaune);
  position: relative; color: var(--ink); padding: 12px 14px; background: var(--paper);
  border: 1px solid rgba(255,255,255,.6); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.note:hover { transform: translateY(-2px); box-shadow: var(--shadow-ui); }
.note.c-rose { --paper: var(--rose); } .note.c-bleu { --paper: var(--bleu); } .note.c-vert { --paper: var(--vert); }
.note.c-orange { --paper: var(--orange); } .note.c-violet { --paper: var(--violet); }
.note-head { display: flex; align-items: center; gap: 4px; margin-left: -6px; }
.note-grip { width: 16px; flex: none; text-align: center; color: var(--ink-muted); opacity: .4; cursor: grab; touch-action: none; user-select: none; }
.note:hover .note-grip { opacity: .9; }
.emoji-btn { width: 34px; height: 34px; flex: none; border: 0; border-radius: 8px; background: transparent; font-size: 1.2rem; }
.emoji-btn:hover { background: var(--ink-line); }
.note-title {
  flex: 1; min-width: 0; border: 0; background: transparent; padding: 3px 6px; border-radius: 6px;
  font-weight: 800; font-size: 1.1rem; color: var(--ink); text-overflow: ellipsis;
}
.note-title:hover { background: var(--ink-line); }
.note-title:focus { background: var(--surface); outline: none; box-shadow: 0 0 0 2px var(--accent-2); }
.progress { height: 4px; margin: 8px 0 2px; border-radius: 4px; background: var(--ink-line); overflow: hidden; }
.progress { background: rgba(255,255,255,.55); }
.progress b { display: block; height: 100%; width: var(--p, 0%); background: linear-gradient(90deg, #8be0b5, var(--ok)); border-radius: 4px; transition: width .3s ease; }
.count { margin: 4px 0; font-size: .78rem; color: var(--ink-muted); }

.items { list-style: none; margin: 0; padding: 0; min-height: 8px; }
.items li { display: flex; align-items: center; gap: 6px; padding: 5px 0; border-bottom: 1px solid var(--ink-line); animation: fadein .2s ease both; }
.items li.old { animation: none; }
.items li.leaving { animation: fadeout .2s ease forwards; }
.grip { width: 14px; flex: none; color: var(--ink-muted); opacity: .3; cursor: grab; touch-action: none; text-align: center; user-select: none; font-size: .95rem; }
.items li:hover .grip { opacity: .9; }
.tick {
  width: 20px; height: 20px; flex: none; display: grid; place-items: center; padding: 0;
  border: 1.5px solid rgba(60,40,90,.35); border-radius: 6px; background: var(--surface-solid); transition: background .12s, border-color .12s;
}
.tick svg { width: 13px; height: 13px; stroke: #fff; stroke-width: 3.2; fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
li.done .tick { background: var(--ok); border-color: var(--ok); }
li.done .tick svg { opacity: 1; }
.it-emoji { width: 22px; flex: none; text-align: center; font-size: 1rem; }
.it-text { flex: 0 1 auto; margin-right: auto; min-width: 0; cursor: pointer; overflow-wrap: break-word; user-select: none; -webkit-user-select: none; }
li.done .it-text { color: var(--ink-muted); text-decoration: line-through; }
li.done .it-emoji, li.done .qty { opacity: .5; }
.qty { display: inline-block; margin-left: 6px; vertical-align: 1px; font-size: .72rem; font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--ink-line); white-space: nowrap; }
.items .avatar { width: 20px; height: 20px; font-size: .62rem; opacity: .75; }
.del { width: 24px; height: 24px; font-size: 1rem; opacity: 0; }
.items li:hover .del, .del:focus-visible { opacity: 1; }
@media (hover: none) { .del { opacity: .45; } .grip, .note-grip { opacity: .5; } }
@media (hover: hover) {
  .items li { position: relative; }
  .del { position: absolute; right: 0; top: 50%; transform: translateY(-50%); background: var(--paper); }
}
.edit-input { flex: 1; min-width: 0; border: 1px solid var(--accent-2); border-radius: 6px; padding: 2px 6px; background: var(--surface); }
mark { background: rgba(255,214,0,.55); color: inherit; border-radius: 2px; }
li.filtered-out { display: none; }
.note.no-match { opacity: .4; }

.add-item { display: flex; gap: 6px; margin-top: 10px; }
.add-item input, .shop-add input {
  flex: 1; min-width: 0; border: 1px solid rgba(255,255,255,.7); border-radius: 10px; padding: 7px 10px; background: rgba(255,255,255,.7);
}
.add-item input:focus, .shop-add input:focus { outline: none; border-color: var(--accent-2); }
.add { width: 36px; flex: none; border: 0; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-fg); font-size: 1.15rem; font-weight: 800; }
.add:hover { background: var(--accent-2); }
.parse-hint { margin: 4px 2px 0; font-size: .75rem; color: var(--ink-muted); }
.parse-hint:empty { margin: 0; }
.note-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-top: 8px; }

.add-card {
  display: grid; place-content: center; justify-items: center; gap: 2px; min-height: 140px;
  background: rgba(255,255,255,.35); border: 2px dashed var(--accent-2); box-shadow: none; color: var(--accent); font-weight: 700; border-radius: var(--radius);
}
.add-card .plus { font-size: 1.8rem; line-height: 1; }
.add-card:hover { background: var(--accent-soft); }

.sortable-ghost { opacity: .35; }
.items li.sortable-chosen { background: var(--surface); }

/* ---------- Vide ---------- */
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.empty h2 { margin: 6px 0; color: var(--fg); font-size: 1.3rem; }
.empty-art { font-size: 2.6rem; }
.starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.tips { margin: 36px auto 0; max-width: 760px; text-align: center; font-size: .8rem; color: var(--muted); }

/* ---------- Popover ---------- */
.popover {
  position: fixed; z-index: 50; width: 260px; padding: 10px; border-radius: var(--radius);
  background: var(--surface); color: var(--fg); box-shadow: var(--shadow-ui); border: 1px solid var(--line);
}
.popover h3 { margin: 4px 4px 8px; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.swatches { display: flex; gap: 8px; margin: 0 4px 12px; }
.swatches button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.swatches button[aria-pressed=true] { border-color: var(--fg); }
.emojis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; margin-bottom: 6px; }
.emojis button { border: 0; background: transparent; border-radius: 8px; font-size: 1.25rem; padding: 4px 0; }
.emojis button:hover { background: var(--bg); }
.emojis button[aria-pressed=true] { background: var(--line); }
.menu-item { display: flex; width: 100%; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; text-align: left; }
.menu-item:hover { background: var(--bg); }
.menu-item.danger { color: var(--err); }
.menu-sep { height: 1px; background: var(--line); margin: 6px 0; }

/* ---------- Mode magasin ---------- */
.shop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.4); display: grid; place-items: center; }
.shop-inner {
  --paper: var(--jaune); width: min(600px, 100%); height: min(840px, 100%); display: flex; flex-direction: column;
  background: var(--surface); color: var(--fg); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-ui);
}
@media (max-width: 680px) { .shop-inner { border-radius: 0; height: 100%; } }
.shop-head { display: flex; align-items: center; gap: 10px; padding: max(12px, env(safe-area-inset-top)) 14px 12px; background: var(--paper); border-bottom: 1px solid var(--ink-line); }
.shop-head > div:nth-child(2) { flex: 1; min-width: 0; }
.shop-head h2 { margin: 0; font-size: 1.35rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-sub { margin: 0; color: var(--muted); font-size: .9rem; }
.ring { position: relative; width: 50px; height: 50px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.5; }
.ring-bg { stroke: var(--ink-line); }
.ring-fg { stroke: var(--ok); stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: var(--off, 97.4); transition: stroke-dashoffset .4s ease; }
.ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: .78rem; }
.shop-list { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 4px 14px; overscroll-behavior: contain; }
.shop-list li { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 1.1rem; user-select: none; -webkit-user-select: none; }
.shop-list li:active { background: var(--bg); }
.shop-list .tick { width: 28px; height: 28px; border-radius: 7px; }
.shop-list .tick svg { width: 17px; height: 17px; }
.shop-list .it-emoji { font-size: 1.35rem; width: 28px; }
.shop-list li.done { opacity: .5; }
.shop-list li.done .it-text { text-decoration: line-through; }
.shop-list .sep { cursor: default; padding: 16px 4px 6px; border: 0; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.shop-done { text-align: center; padding: 16px; }
.shop-done .big { font-size: 2.4rem; }
.shop-done p { font-weight: 700; font-size: 1.15rem; margin: 4px 0 12px; }
.shop-add { display: flex; gap: 8px; padding: 12px 14px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.shop-add .add { width: 44px; }

/* ---------- Page Imprimer ---------- */
.printer { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--vert); border: 0; color: var(--ink); font-size: .9rem; font-weight: 600; }
.printer i { width: 8px; height: 8px; border-radius: 50%; background: #aaa; }
.printer.ok i { background: #3cbf7f; }
.printer.busy i { background: #f0a020; }
.printer.off i { background: var(--err); }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.card h2 .ico { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--bleu); font-size: 1.15rem; }
.cards .card:nth-child(2) h2 .ico { background: var(--rose); }
.card h2 { margin: 0 0 14px; font-size: 1.1rem; display: flex; align-items: center; gap: 8px; }
.drop {
  display: grid; justify-items: center; gap: 2px; padding: 22px 12px; margin-bottom: 14px; text-align: center;
  border: 2px dashed var(--accent-2); border-radius: 14px; background: var(--accent-soft); cursor: pointer; color: var(--muted); transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--violet); }
.drop.has-file { border-style: solid; border-color: var(--ok); background: var(--ok-soft); color: var(--fg); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop .big { font-size: 1.8rem; }
.drop b { color: var(--fg); word-break: break-all; }
.drop small { font-size: .78rem; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.field { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); }
.field select, .field input { display: block; width: 100%; margin-top: 4px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--fg); }
.seg { display: flex; gap: 3px; margin-top: 4px; padding: 3px; background: var(--accent-soft); border-radius: 10px; }
.seg label { flex: 1; position: relative; margin: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; }
.seg span { display: block; padding: 4px 6px; border-radius: 7px; text-align: center; color: var(--muted); font-weight: 700; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.seg input:checked + span { background: var(--surface-solid); color: var(--accent); box-shadow: 0 2px 6px rgba(108,92,231,.18); }
.seg input:focus-visible + span { outline: 2px solid var(--accent-2); }
.stepper { display: flex; align-items: center; margin-top: 4px; border-radius: 10px; background: var(--accent-soft); overflow: hidden; }
.stepper button { width: 34px; height: 34px; border: 0; background: transparent; font-size: 1.1rem; font-weight: 700; }
.stepper button:hover { background: var(--line); }
.stepper input { flex: 1; min-width: 0; margin: 0; border: 0; text-align: center; background: transparent; padding: 0; font-weight: 700; color: var(--fg); -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.card .hint { margin: 10px 0 0; font-size: .8rem; color: var(--muted); }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.history li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history time { color: var(--muted); font-size: .8rem; }
.history .empty-h { color: var(--muted); border: 0; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 420px); pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 10px 10px 14px; border-radius: 10px;
  background: #24282c; color: #fff; box-shadow: var(--shadow-ui); font-size: .95rem; animation: fadein .2s ease;
}
.toast.err { background: #8c1d18; }
.toast.ok { background: #1f5c4c; }
.toast span { flex: 1; }
.toast button { border: 0; background: transparent; color: #8fe0c6; font-weight: 800; padding: 6px 10px; border-radius: 6px; }
.toast button:hover { background: rgba(255,255,255,.1); }
.toast.out { animation: fadeout .2s ease forwards; }

/* ---------- Confettis ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; width: 7px; height: 11px; border-radius: 2px; background: var(--c); animation: confetti 1.3s cubic-bezier(.15,.7,.35,1) forwards; }

/* ---------- Connexion / inscription : page fixe ---------- */
html:has(body.login-page) { height: 100%; overflow: hidden; overscroll-behavior: none; }
.login-page {
  position: fixed; inset: 0; overflow: hidden; overscroll-behavior: none; touch-action: manipulation;
  display: grid; place-items: center; padding: 16px; min-height: 0;
}
.login-page.tall { position: static; overflow: visible; min-height: 100vh; }  /* inscription : peut défiler sur petit écran */
.login-card {
  position: relative; width: min(390px, 100%); padding: 30px 26px 24px; overflow: hidden;
  background: var(--surface); border: 1px solid rgba(255,255,255,.7); border-radius: 22px; box-shadow: var(--shadow-ui);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.login-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: linear-gradient(90deg, #ffb8cf, #c9bdff, #a8e6cf, #ffd6a5); }
.login-card h1 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 1.5rem; }
.login-card h1 img { width: 34px; height: 34px; padding: 4px; border-radius: 12px; background: var(--jaune); }
.login-card .sub { margin: 4px 0 16px; color: var(--muted); }
.login-card label { display: block; font-size: .85rem; font-weight: 700; color: var(--muted); margin-bottom: 12px; }
.login-card input:not([type=checkbox]) { display: block; width: 100%; margin-top: 4px; padding: 11px 13px; font-size: 1rem; border: 1.5px solid transparent; border-radius: 12px; background: var(--accent-soft); color: var(--fg); }
.login-card input:focus { outline: none; border-color: var(--accent-2); background: var(--surface-solid); }
.login-card label.check { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 600; }
.login-card label.check input { width: 18px; height: 18px; accent-color: var(--accent); }
.login-card button[type=submit] { width: 100%; margin-top: 4px; padding: 12px; border: 0; border-radius: 12px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-fg); font-weight: 800; font-size: 1rem; box-shadow: 0 6px 18px rgba(108,92,231,.3); }
.login-card button[type=submit]:hover { filter: brightness(1.06); }
.login-card .hint { margin: 14px 0 0; font-size: .85rem; color: var(--muted); }
.login-card .err { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--rose); color: var(--err); font-weight: 700; }
.login-card .apps { display: flex; gap: 8px; margin: 0 0 18px; }
.login-card .apps span { padding: 4px 12px; border-radius: 999px; background: var(--jaune); font-size: .8rem; font-weight: 700; color: var(--ink); }
.login-card .apps span + span { background: var(--bleu); }
.back-link { position: fixed; top: max(14px, env(safe-area-inset-top)); left: 16px; z-index: 2; color: var(--muted); text-decoration: none; font-size: .9rem; font-weight: 600; }
.back-link:hover { color: var(--accent); }

/* ---------- Animations (discrètes) ---------- */
@keyframes fadein { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
@keyframes confetti { 75% { opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }

/* ---------- Téléphone : menu en barre d'onglets en bas ---------- */
@media (max-width: 640px) {
  .hide-sm { display: none; }
  /* pas de flou ici : il ferait de la barre du haut le repere de la barre d'onglets fixee en bas */
  .topbar { grid-template-columns: 1fr auto; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface-solid); }
  .tabs {
    position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; justify-content: space-around; gap: 0;
    padding: 6px 8px max(6px, env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line);
    border-radius: 0; background: var(--surface); box-shadow: 0 -2px 14px rgba(80,60,120,.08); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .tab { flex-direction: column; gap: 0; padding: 4px 24px; font-size: .72rem; }
  .tab i { font-size: 1.35rem; }
  .tab[aria-current=page] { box-shadow: none; background: var(--accent-soft); color: var(--accent); }
  .tab .badge { position: absolute; top: 0; right: 14px; }
  main { padding-bottom: 96px; }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .hero { margin-top: 16px; }
  .hero h1 { font-size: 1.35rem; }
  .stats { gap: 12px; }
  .tips { display: none; }
  .fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Petits écrans en paysage : la connexion peut défiler plutôt que d'être coupée */
@media (max-height: 560px) {
  html:has(body.login-page) { overflow: auto; height: auto; }
  .login-page { position: static; overflow: visible; min-height: 100vh; }
}
/* Ajustements du mode sombre pour les éléments clairs translucides */
:root[data-theme=dark] :is(.add-item input, .shop-add input) { background: rgba(0,0,0,.25); border-color: transparent; }
:root[data-theme=dark] .progress { background: rgba(255,255,255,.08); }
:root[data-theme=dark] .add-card { background: rgba(255,255,255,.03); }
:root[data-theme=dark] :is(.note, .login-card) { border-color: rgba(255,255,255,.06); }
:root[data-theme=dark] :is(.btn.primary, .login-card button[type=submit], .tab[aria-current=page]) { box-shadow: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) :is(.add-item input, .shop-add input) { background: rgba(0,0,0,.25); border-color: transparent; }
  :root:not([data-theme]) .progress { background: rgba(255,255,255,.08); }
  :root:not([data-theme]) .add-card { background: rgba(255,255,255,.03); }
  :root:not([data-theme]) :is(.note, .login-card) { border-color: rgba(255,255,255,.06); }
  :root:not([data-theme]) :is(.btn.primary, .login-card button[type=submit], .tab[aria-current=page]) { box-shadow: none; }
}

/* ---------- Choix du thème (Mon compte) ---------- */
.theme-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--accent-soft); }
.theme-seg label { position: relative; }
.theme-seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.theme-seg span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 9px; font-weight: 700; font-size: .88rem; color: var(--muted); }
.theme-seg span i { font-style: normal; font-size: 1.3rem; }
.theme-seg input:checked + span { background: var(--surface-solid); color: var(--accent); box-shadow: 0 2px 8px rgba(108,92,231,.18); }
.theme-seg input:focus-visible + span { outline: 2px solid var(--accent-2); }

/* ======================================================================
   Ajouts : onglet Jeux, Mon compte, bouton « œil », notifications
   ====================================================================== */

/* ---------- Lien « Mon compte » dans la barre du haut ---------- */
a.avatar-btn { color: var(--fg); text-decoration: none; }
a.avatar-btn[aria-current=page] { background: var(--accent-soft); }
@media (max-width: 640px) {
  .tab { flex: 1; padding: 4px 6px; }
  .tab .badge { right: calc(50% - 26px); }
}

/* ---------- Mot de passe : bouton œil ---------- */
.pw-wrap { position: relative; display: block; margin-top: 4px; }
.pw-wrap input { margin-top: 0 !important; padding-right: 48px !important; }
.pw-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px;
  display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--muted);
}
.pw-eye:hover { color: var(--accent); background: var(--accent-soft); }
.pw-eye[aria-pressed=true] { color: var(--accent); }

/* ---------- Mon compte ---------- */
.account-head { display: flex; align-items: center; gap: 14px; }
.account-head .today { text-transform: none; }
.avatar.big { width: 56px; height: 56px; font-size: 1.5rem; }
.stack { display: grid; gap: 12px; }
.stack .field input { padding: 9px 12px; font-size: 1rem; }
.meter { height: 6px; margin-top: -4px; border-radius: 6px; background: var(--line); overflow: hidden; }
.meter b { display: block; height: 100%; width: 0; border-radius: 6px; transition: width .2s, background .2s; background: var(--err); }
.meter b.fair { background: #f0a020; }
.meter b.strong { background: var(--ok); }
.rules-list { list-style: none; margin: -4px 0 0; padding: 0; font-size: .82rem; color: var(--muted); }
.rules-list li::before { content: "○ "; }
.rules-list li.ok { color: var(--ok); }
.rules-list li.ok::before { content: "✓ "; }
.check-line { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.check-line input { width: 18px; height: 18px; accent-color: var(--accent); }
.device-line { margin: 0 0 10px; }
.device-line:empty { display: none; }
.btn.danger { color: var(--err); }
.card .menu-sep { margin: 16px 0; }

/* ======================================================================
   VIRAGE – jeu de cartes (design « VIRAGE — jeu de cartes »)
   ====================================================================== */
@font-face { font-family: "Bricolage Grotesque"; src: url(/fonts/bricolage.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Outfit"; src: url(/fonts/outfit.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

body.games-page {
  --night: #12202A; --felt: #16303A; --cream: #F3EEE3; --paper: #FBF7EE; --ink: #1B1A2E; --dim: #B9B3A6;
  --braise: #E0542C; --moutarde: #F0B323; --sapin: #2A8A64; --myrtille: #4152C8;
  --line-v: rgba(243,238,227,.1);
  color: var(--cream); font-family: "Outfit", system-ui, sans-serif;
  background: var(--night) radial-gradient(rgba(243,238,227,.06) 1px, transparent 1.5px) 0 0 / 22px 22px fixed;
}
.games-page .topbar { background: rgba(18,32,42,.9); border-bottom-color: var(--line-v); }
.games-page .brand { color: var(--cream); }
.games-page .tabs { background: rgba(243,238,227,.08); }
.games-page .tab { color: var(--dim); }
.games-page .tab:hover { color: var(--cream); }
.games-page .tab[aria-current=page] { background: var(--cream); color: var(--night); box-shadow: none; }
.games-page a.avatar-btn { color: var(--cream); }
.games-page a.avatar-btn:hover { background: rgba(243,238,227,.08); }
@media (max-width: 640px) {
  .games-page .topbar { background: var(--night); }
  .games-page .tabs { background: var(--night); border-top-color: var(--line-v); }
  .games-page .tab[aria-current=page] { background: rgba(243,238,227,.12); color: var(--cream); }
}

.vg { max-width: 1240px; }
.vg h1, .vg h2, .vt-word, .vbtn.shout, .vg-sheet h2 { font-family: "Bricolage Grotesque", "Outfit", sans-serif; }
.vg h2 { margin: 0 0 14px; font-size: 1.25rem; font-weight: 800; letter-spacing: -.01em; }
.vg-hint { margin: 10px 0 0; font-size: .88rem; color: var(--dim); line-height: 1.45; }

/* Logo losange 4 couleurs */
.vg-logo { flex: none; width: 24px; height: 24px; transform: rotate(45deg); border-radius: 6px; background: var(--paper); padding: 3px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; box-sizing: border-box; }
.vg-logo i:nth-child(1) { border-radius: 3px 1px 1px 1px; background: var(--braise); }
.vg-logo i:nth-child(2) { border-radius: 1px 3px 1px 1px; background: var(--moutarde); }
.vg-logo i:nth-child(3) { border-radius: 1px 1px 1px 3px; background: var(--myrtille); }
.vg-logo i:nth-child(4) { border-radius: 1px 1px 3px 1px; background: var(--sapin); }
.vg-logo.big { width: 52px; height: 52px; border-radius: 13px; padding: 6px; gap: 4px; }
.vg-logo.big i { border-radius: 4px !important; }

/* Boutons */
.vbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 12px; border: 1px solid rgba(243,238,227,.25); background: transparent; color: var(--cream);
  font: 600 15px/1 "Outfit", sans-serif; cursor: pointer; transition: transform .08s, background .15s, box-shadow .15s;
}
.vbtn:hover { background: rgba(243,238,227,.08); }
.vbtn:active { transform: translateY(2px); }
.vbtn:disabled { opacity: .45; cursor: not-allowed; }
.vbtn.sm { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.vbtn.ghost { border-color: transparent; color: var(--dim); }
.vbtn.ghost:hover { color: var(--cream); }
.vbtn.soft { border: 0; background: rgba(243,238,227,.1); }
.vbtn.hot { border: 0; background: var(--braise); color: #fff; box-shadow: 0 4px 0 #9E3216; }
.vbtn.hot:hover { background: #E8653F; }
.vbtn.hot:active { box-shadow: 0 2px 0 #9E3216; }
.vbtn.mout { border: 0; background: var(--moutarde); color: var(--ink); box-shadow: 0 4px 0 #A87A0C; }
.vbtn.big { min-height: 56px; padding: 0 28px; font-size: 17px; border-radius: 14px; }
.vbtn.shout { font-size: 21px; font-weight: 800; letter-spacing: .02em; }
.vbtn.shout.armed { background: var(--sapin); box-shadow: 0 4px 0 #1A5A41; }
.vbtn.shout.urgent { animation: vg-pulse 1s ease-in-out infinite; }
.vbtn.hint-me { animation: vg-pulse 1.4s ease-in-out infinite; border-color: var(--moutarde); }
@keyframes vg-pulse { 50% { transform: scale(1.06); } }

/* Accueil du jeu */
.vg-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 30px; margin: 26px 0 22px; }
.vg-title { display: flex; align-items: center; gap: 22px; }
.vg-title h1 { margin: 0; font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 800; letter-spacing: -.03em; line-height: .9; }
.vg-title p { margin: 8px 0 0; color: var(--dim); font-size: 1.02rem; }
.vg-fan { display: flex; align-items: flex-end; padding: 10px 26px 26px 40px; }
.vg-fan .vc { --z: .44; margin-left: -34px; transform: rotate(var(--r)) translateY(var(--y)); transform-origin: 50% 120%; }
@media (max-width: 640px) { .vg-fan { display: none; } }
.vg-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); align-items: start; }
.vg-panel { background: rgba(243,238,227,.06); border: 1px solid var(--line-v); border-radius: 20px; padding: 20px; }
.vg-form { display: grid; gap: 14px; }
.vg-field { display: grid; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--dim); }
.vg-field input { min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(243,238,227,.18); background: rgba(0,0,0,.18); color: var(--cream); font: 500 1rem "Outfit", sans-serif; }
.vg-field input::placeholder { color: rgba(243,238,227,.4); }
.vg-field input:focus { outline: none; border-color: var(--moutarde); }
.vg-seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: rgba(0,0,0,.2); }
.vg-seg label { flex: 1; position: relative; }
.vg-seg input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.vg-seg span { display: block; padding: 8px 4px; border-radius: 9px; text-align: center; color: var(--dim); font-weight: 600; cursor: pointer; white-space: nowrap; }
.vg-seg input:checked + span { background: var(--cream); color: var(--ink); }
.vg-seg input:focus-visible + span { outline: 2px solid var(--moutarde); }
.vg-games { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.vg-games li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(0,0,0,.16); }
.vg-games .g-info { display: grid; gap: 4px; min-width: 0; }
.vg-games .g-info b { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vg-games small { color: var(--dim); }
.vg-games li.vg-empty { color: var(--dim); justify-content: center; }
.faces { display: flex; margin-top: 2px; }
.faces .vg-ava { width: 26px; height: 26px; font-size: .62rem; margin-right: -6px; border: 2px solid var(--night); }
.vg-ava.bot { box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.vg-ava { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; font: 800 .9rem "Bricolage Grotesque", sans-serif; }
.vg-rules { margin-top: 16px; }
.vg-rules summary, .vt-log summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; }
.rules-body { color: #DDD7CA; line-height: 1.55; }
.rules-body b { color: var(--cream); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin: 0 4px 0 2px; }
.dot.r { background: var(--braise); } .dot.y { background: var(--moutarde); } .dot.g { background: var(--sapin); } .dot.b { background: var(--myrtille); }
.rules-cards { list-style: none; padding: 0; display: grid; gap: 10px; }
.rules-cards li { display: flex; align-items: center; gap: 14px; }
.rules-cards .vc { --z: .26; }

/* Salle d'attente */
.vg-room { max-width: 640px; margin: 26px auto 0; }
.vg-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.vg-room h2 { font-size: 1.8rem; margin: 0; }
.vg-seats { list-style: none; margin: 18px 0; padding: 0; display: grid; gap: 8px; }
.vg-seats li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; background: rgba(0,0,0,.16); }
.vg-seats .nm { flex: 1; font-weight: 600; }
.tag { padding: 2px 10px; border-radius: 999px; background: var(--moutarde); color: var(--ink); font-weight: 700; font-size: .75rem; }
.vg-row { display: flex; flex-wrap: wrap; gap: 10px; }
.vg-row.center { justify-content: center; }

/* Table */
.vt-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line-v); flex-wrap: wrap; }
.vt-brand { display: flex; align-items: center; gap: 12px; }
.vt-word { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.vt-info { font-size: 15px; color: var(--dim); }
.vt-info strong { color: var(--cream); font-weight: 600; }
.vt-nav { display: flex; gap: 8px; }
.vt-opps { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 18px 0; }
.vt-opp {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; min-width: 0;
  border-radius: 18px; background: rgba(243,238,227,.06); border: 1px solid rgba(243,238,227,.08); transition: border-color .2s, box-shadow .2s;
}
.vt-opp.alert { border-color: var(--moutarde); }
.vt-opp.turn { border-color: var(--cream); box-shadow: 0 0 0 3px rgba(243,238,227,.15); }
.vt-opp .meta { display: grid; gap: 2px; justify-items: start; min-width: 0; }
.vt-opp .meta b { font-size: 16px; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vt-opp .meta small { font-size: 14px; color: var(--dim); }
.vt-badge { margin-top: 4px; padding: 2px 10px; border-radius: 999px; background: var(--moutarde); color: var(--ink); font-size: 13px; font-weight: 700; }
.vt-sub { border: 0; background: none; padding: 0; color: var(--dim); font-size: 12px; text-decoration: underline; cursor: pointer; }
.vt-opp .meta .vbtn { margin-top: 4px; }
.vt-opp .fan { display: flex; align-items: center; padding: 6px 4px 6px 30px; }
.vt-opp .fan > span { display: block; margin-left: -26px; }
.vt-opp .fan .vc { --z: .2; }

.vt-felt {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 28px 56px; padding: 30px 24px;
  border-radius: 28px; background: var(--felt); border: 1px solid rgba(243,238,227,.08);
}
.vt-stack { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vt-cap { font-size: 14px; color: var(--dim); }
.vt-pile { position: relative; width: 112px; height: 166px; padding: 0; border: 0; background: none; }
.vt-pile .vc { --z: .58; position: absolute; left: 0; top: 0; }
button.vt-pile .vc:nth-child(1) { left: 0; top: 10px; }
button.vt-pile .vc:nth-child(2) { left: 4px; top: 5px; }
button.vt-pile .vc:nth-child(3) { left: 8px; top: 0; }
button.vt-pile:not(:disabled) { cursor: pointer; }
button.vt-pile:not(:disabled):hover .vc:nth-child(3) { top: -6px; }
button.vt-pile:disabled { opacity: 1; cursor: default; }
.vt-pile.discard .vc { left: 4px; top: 4px; }
.vt-pile.discard .under { transform: rotate(-10deg); }
.vt-pile.discard .top { transform: rotate(6deg); }
.vt-pile.discard .pop { animation: vg-drop .32s cubic-bezier(.2,.9,.3,1.2); }
@keyframes vg-drop { from { transform: translateY(-60px) rotate(-12deg) scale(1.15); opacity: .4; } }
.vt-info2 { display: flex; flex-direction: column; gap: 14px; }
.vt-lab { display: grid; gap: 6px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.vt-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; font: 600 16px "Outfit", sans-serif; letter-spacing: 0; text-transform: none; color: var(--cream); background: rgba(243,238,227,.1); width: max-content; }
.vt-pill .ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.18); }
.vt-pill.neutral .ico { background: rgba(243,238,227,.12); }
svg.g { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.vt-pill.ccw svg { transform: scaleX(-1); }

.vt-turn { width: max-content; max-width: 100%; margin: 22px auto 6px; padding: 12px 24px; border-radius: 999px; text-align: center; font-weight: 700; background: rgba(243,238,227,.1); color: var(--cream); }
.vt-turn.mine { background: var(--moutarde); color: var(--ink); }
.vt-hand { --gap: 10px; display: flex; justify-content: center; align-items: flex-end; min-height: 210px; padding: 34px 8px 8px; }
.vt-hand .vc { --z: .62; flex: none; transition: transform .15s ease, opacity .15s; }
.vt-hand .vc + .vc { margin-left: var(--gap); }
.vt-hand button.vc { cursor: default; font-family: "Bricolage Grotesque", "Outfit", sans-serif; color: #1B1A2E; }
/* les déplacements sont aussi réduits par zoom : -36px ≈ 22 px à l'écran */
.vt-hand .vc.ok { transform: translateY(-36px); cursor: pointer; }
.vt-hand .vc.ok:hover, .vt-hand .vc.ok:focus-visible { transform: translateY(-54px); z-index: 2; }
.vt-hand .vc.no { opacity: .55; }
.vt-hand .vc.new { animation: vg-in .35s ease both; }
.vt-hand .vc.drawn { outline: 5px solid var(--moutarde); outline-offset: 3px; }
@keyframes vg-in { from { translate: 0 -40px; opacity: 0; } }
.vt-me { margin: 4px 0 0; text-align: center; color: var(--dim); font-size: .9rem; }
.vt-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 16px 0 22px; }
.vt-log { margin-top: 10px; }
.vt-log ol { list-style: none; margin: 10px 0 0; padding: 0; max-height: 220px; overflow-y: auto; font-size: .9rem; color: #DDD7CA; }
.vt-log li { padding: 5px 0; border-bottom: 1px solid var(--line-v); }
.vt-log li:first-child { color: var(--cream); font-weight: 600; }

/* Fenêtres */
.vg-overlay { position: fixed; inset: 0; z-index: 55; display: grid; place-items: center; padding: 16px; background: rgba(8,14,20,.65); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fadein .15s; }
.vg-sheet { width: min(440px, 100%); max-height: 100%; overflow-y: auto; padding: 24px; border-radius: 22px; background: var(--felt); border: 1px solid rgba(243,238,227,.12); color: var(--cream); text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.vg-sheet.wide { width: min(720px, 100%); }
.vg-sheet h2 { margin: 0 0 10px; font-size: 1.5rem; }
.vg-sheet p { color: #DDD7CA; }
.vg-sheet-card { display: flex; justify-content: center; margin-bottom: 8px; }
.vg-sheet-card .vc { --z: .5; transform: rotate(-6deg); }
.vg-colors { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 16px 0; }
.vg-color { display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 14px 8px 8px; border: 0; border-radius: 16px; font: 700 17px "Outfit", sans-serif; color: #fff; cursor: pointer; transition: transform .1s; }
.vg-color:hover { transform: translateY(-2px); }
.vg-color.braise { background: var(--braise); } .vg-color.moutarde { background: var(--moutarde); color: var(--ink); }
.vg-color.sapin { background: var(--sapin); } .vg-color.myrtille { background: var(--myrtille); }
.vg-color .ico { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.2); }
.vg-color svg.g { width: 24px; height: 24px; }
.vg-scroll { overflow-x: auto; margin: 10px 0 16px; }
.vg-scores { width: 100%; border-collapse: collapse; text-align: left; font-size: .92rem; }
.vg-scores th { color: var(--dim); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px; }
.vg-scores td { padding: 8px; border-top: 1px solid var(--line-v); vertical-align: middle; }
.vg-scores td:first-child { font-weight: 600; white-space: nowrap; }
.vg-scores td:first-child .vg-ava { display: inline-grid; margin-right: 8px; vertical-align: middle; }
.vg-scores td:last-child { font: 800 1.15rem "Bricolage Grotesque", sans-serif; text-align: right; }
.vg-scores .vg-ava { width: 30px; height: 30px; font-size: .7rem; }
.vg-scores tr.winner td { background: rgba(240,179,35,.12); }
.mini-hand { display: inline-flex; flex-wrap: wrap; gap: 2px; vertical-align: middle; margin-right: 6px; }
.mini-hand .vc { --z: .16; }

/* ---------- Carte VIRAGE (180 × 270, réduite par --z) ---------- */
.vc {
  --bg: #1B1A2E; --fg: #fff; --deep: #1B1A2E; --frame: rgba(255,255,255,.22);
  zoom: var(--z, .5); position: relative; display: inline-block; flex: none; box-sizing: border-box; width: 180px; height: 270px; padding: 7px; margin: 0;
  border-radius: 16px; background: #FBF7EE; border: 1px solid rgba(27,26,46,.14);
  box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 8px 18px rgba(10,14,20,.28);
  font-family: "Bricolage Grotesque", "Outfit", sans-serif; color: #1B1A2E; text-align: left; line-height: 1.2; user-select: none; -webkit-user-select: none;
}
.vc.braise { --bg: #E0542C; --fg: #fff; --deep: #B83A18; --frame: rgba(255,255,255,.32); }
.vc.moutarde { --bg: #F0B323; --fg: #1B1A2E; --deep: #8F6200; --frame: rgba(27,26,46,.18); }
.vc.sapin { --bg: #2A8A64; --fg: #fff; --deep: #1F6B4E; --frame: rgba(255,255,255,.3); }
.vc.myrtille { --bg: #4152C8; --fg: #fff; --deep: #2E3C9E; --frame: rgba(255,255,255,.3); }
.vc svg { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.vc-in { position: relative; display: block; width: 100%; height: 100%; border-radius: 10px; overflow: hidden; background: var(--bg); }
.vc-wm { position: absolute; left: 50%; top: 50%; width: 210px; height: 210px; margin: -105px 0 0 -105px; opacity: .14; stroke: var(--fg); stroke-width: 1.2; }
.vc-fr { position: absolute; inset: 5px; border-radius: 7px; border: 1.5px solid var(--frame); }
.vc-k { position: absolute; width: 36px; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--fg); }
.vc-k.tl { top: 11px; left: 9px; }
.vc-k.br { bottom: 11px; right: 9px; transform: rotate(180deg); }
.vc-lbl { font-size: 25px; font-weight: 800; line-height: 1; letter-spacing: -.03em; }
.vc .u { text-decoration: underline; }
.vc-ki { width: 24px; height: 24px; stroke: var(--fg); stroke-width: 2.6; }
.vc-ks { width: 16px; height: 16px; stroke: var(--fg); stroke-width: 2.2; }
.vc-dia { position: absolute; left: 50%; top: 50%; width: 104px; height: 104px; margin: -52px 0 0 -52px; transform: rotate(45deg); border-radius: 20px; background: #FBF7EE; box-shadow: 0 0 0 5px var(--frame); }
.vc-quad { position: absolute; inset: 7px; display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.vc-quad i:nth-child(1) { border-radius: 12px 4px 4px 4px; background: #E0542C; }
.vc-quad i:nth-child(2) { border-radius: 4px 12px 4px 4px; background: #F0B323; }
.vc-quad i:nth-child(3) { border-radius: 4px 4px 4px 12px; background: #4152C8; }
.vc-quad i:nth-child(4) { border-radius: 4px 4px 12px 4px; background: #2A8A64; }
.vc-mid { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transform: rotate(-45deg); }
.vc-num { font-size: 66px; font-weight: 800; line-height: 1; letter-spacing: -.05em; color: var(--deep); text-decoration-thickness: 5px; text-underline-offset: 6px; }
.vc-num.sm { font-size: 48px; }
.vc-mi { width: 60px; height: 60px; stroke: var(--deep); stroke-width: 2.4; }
.vc-w4 { width: 58px; height: 58px; box-sizing: border-box; border-radius: 50%; background: #1B1A2E; border: 3px solid #FBF7EE; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 27px; font-weight: 800; font-style: normal; letter-spacing: -.04em; }
/* Dos */
.vc.back .vc-in { background: #1B1A2E; }
.vc-pat { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .3; stroke-width: 2; }
.vc.back .vc-fr { border-color: rgba(251,247,238,.25); }
.vc.back .vc-dia { width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 18px; box-shadow: none; }
.vc.back .vc-quad { inset: 6px; gap: 4px; }
.vc.back .vc-quad i:nth-child(1) { border-radius: 11px 3px 3px 3px; }
.vc.back .vc-quad i:nth-child(2) { border-radius: 3px 11px 3px 3px; }
.vc.back .vc-quad i:nth-child(3) { border-radius: 3px 3px 3px 11px; }
.vc.back .vc-quad i:nth-child(4) { border-radius: 3px 3px 11px 3px; }
.vc-band { position: absolute; left: -12px; right: -12px; top: 50%; height: 40px; margin-top: -20px; transform: rotate(-14deg); background: #FBF7EE; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 0 rgba(0,0,0,.3); font-size: 28px; font-weight: 800; font-style: italic; letter-spacing: .06em; color: #1B1A2E; }

/* Table sur tablette / téléphone */
@media (max-width: 900px) {
  .vt-felt { gap: 18px 30px; padding: 22px 14px; }
  .vt-hand .vc { --z: .5; }
}
@media (max-width: 640px) {
  .vt-head { padding: 10px 0; }
  .vt-word { font-size: 20px; }
  .vt-info { order: 3; width: 100%; font-size: 14px; }
  .vt-opps { gap: 8px; margin: 12px 0; }
  .vt-opp { padding: 8px 10px 8px 8px; gap: 8px; border-radius: 14px; }
  .vt-opp .vg-ava { width: 34px; height: 34px; font-size: .75rem; }
  .vt-opp .meta b { font-size: 14px; max-width: 90px; }
  .vt-opp .meta small { font-size: 12px; }
  .vt-opp .fan { display: none; }
  .vt-felt { gap: 14px 22px; padding: 18px 10px; border-radius: 22px; }
  .vt-pile { width: 82px; height: 122px; }
  .vt-pile .vc { --z: .42; }
  .vt-info2 { flex-direction: row; flex-wrap: wrap; justify-content: center; width: 100%; gap: 8px; }
  .vt-pill { font-size: 14px; padding: 4px 12px 4px 4px; }
  .vt-pill .ico { width: 26px; height: 26px; }
  .vt-turn { margin-top: 14px; padding: 10px 18px; font-size: .92rem; }
  .vt-hand { min-height: 160px; padding-top: 28px; }
  .vt-hand .vc { --z: .4; }
  .vt-hand .vc.ok { transform: translateY(-40px); }
  .vt-hand .vc.ok:hover { transform: translateY(-40px); }
  .vbtn.big { min-height: 52px; padding: 0 20px; }
}
@media (prefers-reduced-motion: reduce) { .vbtn.shout.urgent, .vbtn.hint-me { animation: none; } }

/* ---------- Messages en direct (live.js) ---------- */
.login-card .apps span:nth-child(3) { background: var(--vert); }
.live-toasts { position: fixed; z-index: 65; top: calc(64px + env(safe-area-inset-top)); right: 16px; display: flex; flex-direction: column; gap: 8px; width: min(380px, calc(100vw - 32px)); pointer-events: none; }
.live-toast { pointer-events: auto; display: flex; align-items: center; gap: 8px; padding: 10px 8px 10px 14px; border-radius: 12px; background: #2a2733; color: #fff; box-shadow: var(--shadow-ui); font: 600 .92rem var(--font); animation: fadein .2s ease; }
.live-toast span { flex: 1; }
.live-toast button { border: 0; background: #6c5ce7; color: #fff; font-weight: 800; padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.live-toast button.x { background: transparent; color: #bbb; padding: 4px 8px; }
.live-toast.out { animation: fadeout .25s ease forwards; }
@media (max-width: 640px) { .live-toasts { top: auto; bottom: calc(80px + env(safe-area-inset-bottom)); right: 16px; } }

/* ======================================================================
   Le Journal (onglet Actus)
   ====================================================================== */
@font-face { font-family: "Newsreader"; src: url(/fonts/newsreader.woff2) format("woff2"); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url(/fonts/newsreader-italic.woff2) format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }

.news-page { --serif: "Newsreader", Georgia, "Times New Roman", serif; --paper: var(--surface-solid); --rule: var(--fg); }
.np { max-width: 1180px; }
.np-mast { margin: 22px 0 0; padding: 16px 22px 18px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: var(--shadow); }
.np-dateline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--muted); font-weight: 600; }
.np-ed { color: var(--fg); }
.np-ed.old { color: var(--err); }
.np-titlerow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 30px; padding-top: 12px; }
.np-title { margin: 0; font-family: var(--serif); font-size: clamp(2.6rem, 8vw, 4.8rem); font-weight: 800; letter-spacing: -.02em; line-height: .95; }
.np-tagline { margin: 6px 0 0; font-family: var(--serif); font-style: italic; font-size: 1.05rem; color: var(--muted); }

/* Météo */
.np-weather { display: grid; gap: 8px; padding: 12px 14px; min-width: 280px; max-width: 420px; border-radius: 14px; background: var(--bleu); color: var(--ink); }
.np-w-now { display: flex; align-items: center; gap: 12px; }
.np-w-icon { font-size: 2.4rem; line-height: 1; }
.np-w-now div { display: grid; }
.np-w-temp { font: 800 1.9rem/1 var(--serif); }
.np-w-text { font-weight: 700; font-size: .9rem; }
.np-w-meta { margin: 0; font-size: .78rem; color: var(--ink-muted); }
.np-w-hours, .np-w-days { display: flex; gap: 6px; }
.np-w-h, .np-w-d { flex: 1; display: grid; justify-items: center; gap: 1px; padding: 5px 4px; border-radius: 9px; background: rgba(255,255,255,.45); font-size: .8rem; }
:root[data-theme=dark] :is(.np-w-h, .np-w-d) { background: rgba(255,255,255,.06); }
.np-w-h i, .np-w-d i { font-style: normal; font-size: 1.1rem; }
.np-w-h small, .np-w-d small { color: var(--ink-muted); font-size: .7rem; font-weight: 700; }
.np-w-h .rain { color: #2f6fd6; }
:root[data-theme=dark] .np-w-h .rain { color: #8fb8ff; }

/* Éditions */
.np-editions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 22px; background: var(--paper); border: 1px solid var(--line); border-top: 3px double var(--rule); font-size: .85rem; }
.np-ed-label { font-family: var(--serif); font-style: italic; color: var(--muted); }
.np-ed-list { display: flex; gap: 6px; overflow-x: auto; flex: 1 1 300px; padding: 2px; scrollbar-width: thin; }
.np-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--fg); font-weight: 700; font-size: .82rem; }
.np-chip:hover { border-color: var(--accent); }
.np-chip[aria-current=true] { background: var(--fg); color: var(--paper); border-color: var(--fg); }
.np-chip .n, .np-sec-chip .n { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--err); color: #fff; font-size: .68rem; line-height: 17px; text-align: center; }
.np-next { color: var(--muted); font-weight: 600; }

/* Rubriques */
.np-sections { position: sticky; top: 58px; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 10px 22px; background: var(--paper); border: 1px solid var(--line); border-top: 0; border-radius: 0 0 18px 18px; box-shadow: var(--shadow); scrollbar-width: none; }
.np-sec-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 8px; color: var(--fg); text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: .98rem; }
.np-sec-chip:hover { background: var(--accent-soft); }
.np-sec { scroll-margin-top: 120px; margin-top: 26px; padding: 18px 22px 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.np-sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 3px double var(--rule); }
.np-sec-head h2 { margin: 0; font-family: var(--serif); font-size: 1.7rem; font-weight: 800; letter-spacing: -.01em; }
.np-sec.local .np-sec-head h2::before { content: "📍 "; font-size: 1.2rem; }
.np-sec-new { font-size: .78rem; font-weight: 800; color: var(--err); text-transform: uppercase; letter-spacing: .06em; }
.np-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; }
.np-side { display: grid; gap: 14px; align-content: start; }
.np-side .np-art + .np-art { padding-top: 14px; border-top: 1px solid var(--line); }

/* Article */
.np-link { display: block; color: inherit; text-decoration: none; }
.np-link:hover .np-h { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.np-img { overflow: hidden; border-radius: 10px; background: var(--line); }
.np-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.np-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 4px; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.np-new { padding: 1px 7px; border-radius: 4px; background: var(--err); color: #fff; letter-spacing: .06em; }
.np-h { margin: 0; font-family: var(--serif); font-weight: 700; line-height: 1.18; }
.np-sum { margin: 6px 0 0; font-family: var(--serif); font-size: 1.02rem; line-height: 1.45; color: var(--fg); opacity: .85; }
.np-art.lead .np-img { aspect-ratio: 16 / 9; margin-bottom: 12px; }
.np-art.lead .np-h { font-size: clamp(1.4rem, 2.6vw, 2rem); font-weight: 800; }
.np-art.side .np-link { display: grid; grid-template-columns: minmax(0, 1fr) 104px; gap: 12px; align-items: start; }
.np-art.side .np-img { grid-column: 2; grid-row: 1; aspect-ratio: 1; }
.np-art.side .np-text { grid-column: 1; grid-row: 1; }
.np-art.side .np-h { font-size: 1.08rem; }
.np-art.side .np-sum { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .92rem; }
.np-briefs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px 22px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.np-art.brief .np-h { font-size: 1rem; font-weight: 600; }
.np-empty { margin: 30px 0; text-align: center; font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: var(--muted); }
.np-credits { margin: 26px 0 0; text-align: center; font-size: .78rem; color: var(--muted); }

@media (max-width: 760px) {
  .np-grid { grid-template-columns: 1fr; }
  .np-weather { min-width: 0; width: 100%; max-width: none; }
}
@media (max-width: 640px) {
  .np-mast, .np-editions, .np-sections, .np-sec { padding-left: 14px; padding-right: 14px; }
  .np-mast { margin-top: 14px; }
  .np-sections { top: 54px; }
  .np-sec { margin-top: 16px; }
  .np-sec-head h2 { font-size: 1.4rem; }
  .np-art.side .np-link { grid-template-columns: minmax(0, 1fr) 84px; }
  .tab { padding: 4px 2px; }
}
.np-img { position: relative; }
.np-art.lead .np-img img, .np-art.side .np-img img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }

/* ======================================================================
   REFONTE (maquette Claude Design « FamilyHome — refonte »)
   Geist + Geist Mono · fond lavande · accent #5B4FE0 · barre d'onglets flottante
   Ce bloc, placé en dernier, remplace les couleurs et composants précédents.
   ====================================================================== */
@font-face { font-family: "Geist"; src: url(/fonts/geist.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(/fonts/geist-mono.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --bg: #F3F1FB; --surface: #FFFFFF; --surface-solid: #FFFFFF; --fg: #17162A; --muted: #6A6884; --faint: #A19FB5;
  --line: #E4E1F3; --row-line: #F0EEF8; --card-border: transparent;
  --accent: #5B4FE0; --accent-2: #4C41D1; --accent-soft: #E6E3FF; --accent-text: #5B4FE0; --accent-fg: #FFFFFF;
  --err: #E11D48; --ok: #16A34A; --ok-soft: #DDF7E7; --check-off: #C8C5DA; --done-text: #8F8CA6;
  --ink: #17162A; --ink-muted: #6A6884; --ink-line: #F0EEF8;
  --jaune: #FFF4D6; --rose: #FFE4EC; --bleu: #DCEBFF; --vert: #DDF7E7; --orange: #FFE6D2; --violet: #E6E3FF; --teal: #D5F5F0;
  --amber-fg: #A16207; --pink-fg: #BE123C; --pink-sub: #9F1239; --violet-fg: #4338CA; --violet-sub: #3730A3;
  --green-fg: #15803D; --green-sub: #166534; --blue-fg: #1D4ED8; --teal-fg: #0F766E; --orange-fg: #9A3412; --orange-strong: #C2410C;
  --blob1: transparent; --blob2: transparent; --blob3: transparent; --blob4: transparent;
  --input-bg: #F7F6FD; --input-line: #E4E1F3; --on-tint: rgba(255,255,255,.75);
  --nav-bg: rgba(255,255,255,.9);
  --shadow: 0 1px 2px rgba(23,22,42,.05), 0 12px 28px -14px rgba(67,56,202,.25);
  --shadow-ui: 0 14px 32px -12px rgba(67,56,202,.35);
  --radius: 22px;
}
:root[data-theme=dark] {
  --bg: #0F0E17; --surface: #1A1926; --surface-solid: #1A1926; --fg: #F2F1F8; --muted: #A3A1B8; --faint: #7A7891;
  --line: #2E2C3F; --row-line: #26243A; --card-border: #2A2839;
  --accent: #5B4FE0; --accent-2: #6C61EC; --accent-soft: rgba(129,120,255,.18); --accent-text: #A9A3FF; --accent-fg: #FFFFFF;
  --err: #FB7185; --ok: #22C55E; --ok-soft: rgba(34,197,94,.15); --check-off: #4A4862; --done-text: #6F6D85;
  --ink: #F2F1F8; --ink-muted: #A3A1B8; --ink-line: #26243A;
  --jaune: rgba(234,179,8,.16); --rose: rgba(244,63,94,.16); --bleu: rgba(59,130,246,.17); --vert: rgba(34,197,94,.15);
  --orange: rgba(249,115,22,.15); --violet: rgba(129,120,255,.18); --teal: rgba(20,184,166,.15);
  --amber-fg: #FDE047; --pink-fg: #FDA4AF; --pink-sub: #FECDD3; --violet-fg: #C4BFFF; --violet-sub: #DDD9FF;
  --green-fg: #86EFAC; --green-sub: #BBF7D0; --blue-fg: #93C5FD; --teal-fg: #5EEAD4; --orange-fg: #FDBA74; --orange-strong: #FDBA74;
  --input-bg: #22212F; --input-line: #33314A; --on-tint: rgba(255,255,255,.08);
  --nav-bg: rgba(26,25,38,.88);
  --shadow: 0 12px 28px -16px rgba(0,0,0,.8);
  --shadow-ui: 0 14px 32px -12px rgba(0,0,0,.7);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #0F0E17; --surface: #1A1926; --surface-solid: #1A1926; --fg: #F2F1F8; --muted: #A3A1B8; --faint: #7A7891;
    --line: #2E2C3F; --row-line: #26243A; --card-border: #2A2839;
    --accent-soft: rgba(129,120,255,.18); --accent-text: #A9A3FF; --err: #FB7185; --ok: #22C55E; --ok-soft: rgba(34,197,94,.15);
    --check-off: #4A4862; --done-text: #6F6D85; --ink: #F2F1F8; --ink-muted: #A3A1B8; --ink-line: #26243A;
    --jaune: rgba(234,179,8,.16); --rose: rgba(244,63,94,.16); --bleu: rgba(59,130,246,.17); --vert: rgba(34,197,94,.15);
    --orange: rgba(249,115,22,.15); --violet: rgba(129,120,255,.18); --teal: rgba(20,184,166,.15);
    --amber-fg: #FDE047; --pink-fg: #FDA4AF; --pink-sub: #FECDD3; --violet-fg: #C4BFFF; --violet-sub: #DDD9FF;
    --green-fg: #86EFAC; --green-sub: #BBF7D0; --blue-fg: #93C5FD; --teal-fg: #5EEAD4; --orange-fg: #FDBA74; --orange-strong: #FDBA74;
    --input-bg: #22212F; --input-line: #33314A; --on-tint: rgba(255,255,255,.08); --nav-bg: rgba(26,25,38,.88);
    --shadow: 0 12px 28px -16px rgba(0,0,0,.8); --shadow-ui: 0 14px 32px -12px rgba(0,0,0,.7);
  }
}

body { background: var(--bg); font: 15px/1.5 var(--font); letter-spacing: -0.005em; }
a { color: var(--accent-text); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.accent-text { color: var(--accent-text); }
svg.ic { flex: none; }
@media (hover: none) { .hide-touch { display: none; } }

/* ---------- Avatars : pastille pleine ---------- */
.avatar { background: hsl(var(--h, 248) 58% 50%); color: #FFFFFF; font-weight: 700; }
:root[data-theme=dark] .avatar { background: hsl(var(--h, 248) 55% 52%); color: #FFFFFF; }

/* ---------- Boutons ---------- */
.btn { border-radius: 12px; border-color: var(--line); background: var(--surface); }
.btn.primary { background: var(--accent); border-color: transparent; color: #FFFFFF; box-shadow: 0 8px 18px -10px var(--accent); }
.btn.primary:hover { background: var(--accent-2); filter: none; }

/* ---------- Barre du haut ---------- */
.topbar {
  grid-template-columns: 1fr auto 1fr; padding: 14px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 0;
}
.brand { gap: 10px; color: var(--fg); font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; background: var(--accent); color: #FFFFFF; display: grid; place-items: center; box-shadow: 0 6px 14px -6px var(--accent); }
.brand-name em { font-style: normal; color: var(--accent-text); }
.top-actions { gap: 8px; }
.bell { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--jaune); color: var(--amber-fg); }
.bell:hover { filter: brightness(.97); }
.me-btn { position: relative; display: block; width: 40px; height: 40px; border-radius: 999px; text-decoration: none; }
.me-btn .avatar { width: 40px; height: 40px; font-size: 15px; font-weight: 600; }
.me-btn[aria-current=page] { box-shadow: 0 0 0 3px var(--accent-soft); }
.me-btn .sync { position: absolute; right: 0; bottom: 0; padding: 0; width: 11px; height: 11px; border-radius: 999px; background: var(--faint); border: 2px solid var(--bg); }
.me-btn .sync i { display: none; }
.me-btn .sync.ok { background: #22C55E; }
.me-btn .sync.busy { background: #F59E0B; }
.me-btn .sync.off { background: var(--err); }

/* Onglets (ordinateur : au centre de la barre) */
.tabs { gap: 4px; padding: 5px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.tab { gap: 8px; padding: 8px 14px; border-radius: 13px; color: var(--muted); font-weight: 700; font-size: 14px; }
.tab svg.ic { width: 20px; height: 20px; }
.tab:hover { color: var(--fg); }
.tab[aria-current=page] { box-shadow: none; }
.tab.t-courses[aria-current=page] { background: var(--violet); color: var(--accent-text); }
.tab.t-news[aria-current=page] { background: var(--bleu); color: var(--blue-fg); }
.tab.t-print[aria-current=page] { background: var(--teal); color: var(--teal-fg); }
.tab.t-games[aria-current=page] { background: var(--orange); color: var(--orange-strong); }
.tab .badge { min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 999px; background: #E11D48; color: #FFFFFF; font: 600 11px/14px var(--mono); border: 2px solid var(--surface); display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Pages ---------- */
main { padding: 0 20px 60px; }
.hero { margin: 22px 0 16px; }
.hero h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.025em; }
.today { color: var(--muted); font-size: 13px; font-weight: 500; }
.card { background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow); backdrop-filter: none; -webkit-backdrop-filter: none; }
.card h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.card h2 .ico { width: 42px; height: 42px; border-radius: 13px; background: var(--bleu); }
.field select, .field input { border-radius: 12px; background: var(--input-bg); border: 1.5px solid var(--input-line); }
.stack .field input { padding: 11px 13px; }
.seg, .stepper { background: var(--accent-soft); border-radius: 12px; }
.drop { border-radius: 16px; border-color: var(--accent); background: var(--violet); }
.toast { background: #17162A; border-radius: 14px; font-weight: 500; }
:root[data-theme=dark] .toast { background: #2A2839; }
.popover { border-radius: 18px; background: var(--surface); }

/* ---------- Courses : accueil ---------- */
.home { max-width: 1180px; display: flex; flex-direction: column; gap: 18px; padding-top: 12px; }
.greet { display: flex; flex-direction: column; gap: 4px; padding-top: 6px; }
.greet-date { font-size: 13px; color: var(--muted); font-weight: 500; }
.greet h1 { margin: 0; font-size: 28px; line-height: 1.15; font-weight: 700; letter-spacing: -0.025em; }
.home .stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; max-width: 620px; }
.home .stat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 18px; }
.home .stat b { margin: 0; font: 600 24px/1.2 var(--mono); }
.home .stat span { font-size: 12px; font-weight: 500; }
.home .stat.s0 { background: var(--rose); } .home .stat.s0 b { color: var(--pink-fg); } .home .stat.s0 span { color: var(--pink-sub); }
.home .stat.s1 { background: var(--violet); } .home .stat.s1 b { color: var(--violet-fg); } .home .stat.s1 span { color: var(--violet-sub); }
.home .stat.s2 { background: var(--vert); } .home .stat.s2 b { color: var(--green-fg); } .home .stat.s2 span { color: var(--green-sub); }
.home .stat.pop b { animation: fh-pop .35s ease; }
@keyframes fh-pop { 40% { transform: scale(1.18); } }
.home .search { flex: none; height: 48px; padding: 0 14px; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--accent-text); box-shadow: none; max-width: 620px; }
.home .search input { font-size: 15px; color: var(--fg); padding: 0; height: 100%; }
.home .search kbd { margin: 0; padding: 2px 7px; border: 0; border-radius: 6px; background: var(--violet); color: var(--violet-fg); font: 500 12px var(--mono); opacity: 1; }
.lists-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.lists-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.lists-head .btn.primary { height: 38px; padding: 0 14px; gap: 6px; font-size: 14px; font-weight: 600; }
.board { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px; }

/* Carte de liste */
.note { --nc-band: var(--bleu); --nc-tile: #2563EB; --nc-title: #1E3A8A; --nc-sub: #1E40AF; --nc-bar: #3B82F6; }
.note.c-jaune { --nc-band: var(--jaune); --nc-tile: #CA8A04; --nc-title: #713F12; --nc-sub: #A16207; --nc-bar: #EAB308; }
.note.c-rose { --nc-band: var(--rose); --nc-tile: #DB2777; --nc-title: #831843; --nc-sub: #BE185D; --nc-bar: #EC4899; }
.note.c-bleu { --nc-band: var(--bleu); --nc-tile: #2563EB; --nc-title: #1E3A8A; --nc-sub: #1E40AF; --nc-bar: #3B82F6; }
.note.c-vert { --nc-band: var(--vert); --nc-tile: #16A34A; --nc-title: #14532D; --nc-sub: #166534; --nc-bar: #22C55E; }
.note.c-orange { --nc-band: var(--orange); --nc-tile: #EA580C; --nc-title: #7C2D12; --nc-sub: #9A3412; --nc-bar: #F97316; }
.note.c-violet { --nc-band: var(--violet); --nc-tile: #5B4FE0; --nc-title: #312E81; --nc-sub: #3730A3; --nc-bar: #6366F1; }
:root[data-theme=dark] .note { --nc-title: #DBEAFE; --nc-sub: #93C5FD; }
:root[data-theme=dark] .note.c-jaune { --nc-title: #FEF3C7; --nc-sub: #FDE047; }
:root[data-theme=dark] .note.c-rose { --nc-title: #FCE7F3; --nc-sub: #F9A8D4; }
:root[data-theme=dark] .note.c-vert { --nc-title: #DCFCE7; --nc-sub: #86EFAC; }
:root[data-theme=dark] .note.c-orange { --nc-title: #FFEDD5; --nc-sub: #FDBA74; }
:root[data-theme=dark] .note.c-violet { --nc-title: #E0E7FF; --nc-sub: #C4BFFF; }
:root .board .note {
  display: flex; flex-direction: column; padding: 0; overflow: hidden; color: var(--fg);
  background: var(--surface); border: 1px solid var(--card-border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.board .note:hover { transform: translateY(-2px); box-shadow: var(--shadow-ui); }
.note-band { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: var(--nc-band); }
.note .note-head { gap: 12px; margin: 0; }
.note .note-grip { width: 10px; margin-right: -6px; color: var(--nc-sub); }
.note .emoji-btn { width: 42px; height: 42px; border-radius: 13px; background: var(--nc-tile); font-size: 20px; flex: none; }
.note .emoji-btn:hover { filter: brightness(1.08); background: var(--nc-tile); }
.note-titles { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.note .note-title { padding: 0 4px; margin-left: -4px; font-size: 17px; font-weight: 700; color: var(--nc-title); }
.note .note-title:hover { background: var(--on-tint); }
.note .note-title:focus { background: var(--surface); }
.note .count { margin: 0; font-size: 13px; color: var(--nc-sub); }
.note .menu-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--on-tint); color: var(--nc-sub); }
.note .note-band .progress { height: 8px; margin: 0; border-radius: 999px; background: var(--on-tint); }
.note .note-band .progress b { background: var(--nc-bar); border-radius: 999px; }
.note-body { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px 16px; }
.note .items { min-height: 0; }
.note .items li { gap: 10px; min-height: 58px; padding: 6px 0; border-bottom: 1px solid var(--row-line); }
.note .items li:last-child { border-bottom: 0; }
.note .grip { width: 10px; margin-right: -4px; color: var(--faint); }
.note .tick { width: 22px; height: 22px; border: 2px solid var(--check-off); border-radius: 7px; background: transparent; }
.note .tick svg { width: 14px; height: 14px; stroke-width: 3; }
.note li.done .tick { background: var(--ok); border-color: var(--ok); }
.it-tile { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; font-weight: 700; font-size: 14px; background: var(--cat-bg); color: var(--cat-fg); }
.it-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; margin-right: auto; }
.note .it-text { font-size: 15px; font-weight: 600; color: var(--fg); margin: 0; }
.note li.done .it-text { color: var(--done-text); }
.it-cat { font-size: 12px; font-weight: 500; color: var(--cat-fg); }
.note li.done :is(.it-tile, .it-cat, .qty) { opacity: .55; }
.note .qty { margin: 0; padding: 3px 7px; border-radius: 7px; background: var(--cat-bg); color: var(--cat-fg); font: 600 12px var(--mono); }
.note .items .avatar { width: 26px; height: 26px; font-size: 12px; opacity: 1; }
.note .del { position: static; width: 32px; height: 44px; transform: none; opacity: .9; color: var(--faint); background: transparent; }
.note .del:hover { color: var(--err); background: transparent; }
@media (hover: hover) { .note .del { opacity: 0; } .note .items li:hover .del, .note .del:focus-visible { opacity: 1; } }
.note .edit-input { border-radius: 8px; padding: 6px 8px; background: var(--input-bg); }
.note .note-body .add-item { margin: 0; gap: 8px; }
.note .note-body .add-item input { height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--nc-band); background: var(--input-bg); font-size: 15px; color: var(--fg); }
.note .note-body .add-item input:focus { border-color: var(--nc-tile); }
.note .note-body .add { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--nc-tile); color: #FFFFFF; }
.note .parse-hint { margin: -6px 2px 0; color: var(--muted); }
.note .shop-btn { display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border: 0; border-radius: 12px; background: var(--orange); color: var(--orange-fg); font-size: 14px; font-weight: 700; }
.note .shop-btn:hover { filter: brightness(.97); }
.note .clear { align-self: center; border: 0; background: none; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.note .clear[hidden] { display: none; }
.board .add-card { min-height: 180px; border: 2px dashed var(--line); background: transparent; color: var(--accent-text); border-radius: var(--radius); box-shadow: none; font-weight: 600; }
.board .add-card:hover { background: var(--violet); border-color: var(--accent); }
.board .add-card .plus { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--violet); margin-bottom: 6px; }

/* Couleurs des rayons */
.cat-frais { --cat-bg: #DCEBFF; --cat-fg: #1D4ED8; }
.cat-primeur { --cat-bg: #DDF7E7; --cat-fg: #15803D; }
.cat-boulangerie { --cat-bg: #FFF4D6; --cat-fg: #A16207; }
.cat-epicerie { --cat-bg: #FFEDD5; --cat-fg: #C2410C; }
.cat-boissons { --cat-bg: #E6E3FF; --cat-fg: #4338CA; }
.cat-hygiene { --cat-bg: #D5F5F0; --cat-fg: #0F766E; }
.cat-maison { --cat-bg: #FCE7F3; --cat-fg: #BE185D; }
.cat-autre { --cat-bg: #EEEDF5; --cat-fg: #5B5873; }
:root[data-theme=dark] .cat-frais { --cat-bg: rgba(59,130,246,.18); --cat-fg: #93C5FD; }
:root[data-theme=dark] .cat-primeur { --cat-bg: rgba(34,197,94,.16); --cat-fg: #86EFAC; }
:root[data-theme=dark] .cat-boulangerie { --cat-bg: rgba(234,179,8,.16); --cat-fg: #FDE047; }
:root[data-theme=dark] .cat-epicerie { --cat-bg: rgba(249,115,22,.16); --cat-fg: #FDBA74; }
:root[data-theme=dark] .cat-boissons { --cat-bg: rgba(129,120,255,.18); --cat-fg: #C4BFFF; }
:root[data-theme=dark] .cat-hygiene { --cat-bg: rgba(20,184,166,.16); --cat-fg: #5EEAD4; }
:root[data-theme=dark] .cat-maison { --cat-bg: rgba(236,72,153,.16); --cat-fg: #F9A8D4; }
:root[data-theme=dark] .cat-autre { --cat-bg: rgba(255,255,255,.07); --cat-fg: #B9B7CC; }

.empty h2 { font-size: 20px; }
.chip { border-radius: 12px; background: var(--surface); }
.tips { color: var(--muted); }
.shop-inner { background: var(--surface); border-radius: 24px; }
.shop-add .add { background: var(--accent); }

/* ---------- Connexion / inscription ---------- */
html:has(body.auth-page) { height: auto; overflow: auto; }
body.auth-page { background: var(--bg); color: var(--fg); min-height: 100dvh; }
.auth { width: min(420px, 100%); min-height: 100dvh; margin: 0 auto; padding: max(48px, env(safe-area-inset-top)) 24px 28px; display: flex; flex-direction: column; gap: 24px; box-sizing: border-box; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.auth-tiles { display: flex; align-items: flex-end; gap: 8px; }
.auth-tiles span { display: grid; place-items: center; color: #FFFFFF; }
.auth-tiles .t-side { width: 44px; height: 44px; border-radius: 14px; }
.auth-tiles .t-side.blue { background: #2563EB; transform: rotate(-8deg); }
.auth-tiles .t-side.orange { background: #EA580C; transform: rotate(8deg); }
.auth-tiles .t-main { width: 64px; height: 64px; border-radius: 20px; background: var(--accent); box-shadow: 0 14px 28px -12px var(--accent); }
.auth-tiles .t-main.orange { background: #EA580C; box-shadow: 0 14px 28px -12px #EA580C; }
.auth-brand h1 { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -0.025em; }
.auth-brand h1 em { font-style: normal; color: var(--accent-text); }
.auth-brand p { margin: 0; max-width: 290px; font-size: 15px; line-height: 1.45; color: var(--muted); }
.auth .err { margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--rose); color: var(--pink-fg); font-weight: 600; font-size: 14px; }
.auth-card { display: flex; flex-direction: column; gap: 18px; padding: 20px; background: var(--surface); border: 1px solid var(--card-border); border-radius: 24px; box-shadow: var(--shadow); }
.who { border: 0; margin: 0; padding: 0; }
.who legend { padding: 0; margin-bottom: 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.who-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.who-btn { --pc: var(--accent); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px 10px; border-radius: 16px; border: 2px solid transparent; background: var(--input-bg); color: var(--fg); font-size: 13px; font-weight: 600; transition: border-color .15s, background .15s; overflow: hidden; text-overflow: ellipsis; }
.who-btn[aria-pressed=true] { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 14%, var(--surface)); }
.who-av { width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center; background: var(--pc); color: #FFFFFF; font-size: 17px; font-weight: 700; }
.who-btn.other .who-av { background: var(--line); color: var(--muted); }
.auth-field { display: flex; flex-direction: column; gap: 8px; }
.auth-field[hidden] { display: none; }
.auth-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.auth-input { display: flex; align-items: center; gap: 8px; height: 50px; padding: 0 6px 0 14px; border-radius: 14px; border: 1.5px solid var(--input-line); background: var(--input-bg); color: var(--accent-text); }
.auth-input:focus-within { border-color: var(--accent); }
.auth-input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font-size: 15px; color: var(--fg); padding: 0; }
.auth-input input::placeholder { color: var(--faint); }
.auth-input .pw-wrap { flex: 1; display: flex; align-items: center; margin: 0; height: 100%; }
.auth-input .pw-wrap input { padding-right: 44px !important; }
.auth-input .pw-eye { color: var(--muted); }
.auth-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; margin-top: -4px; }
.auth-check { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; cursor: pointer; }
.auth-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.forgot summary { list-style: none; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--accent-text); }
.forgot summary::-webkit-details-marker { display: none; }
.forgot[open] { flex-basis: 100%; }
.forgot p { margin: 6px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--violet); font-size: 13px; color: var(--fg); }
.auth-submit { display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; border: 0; border-radius: 14px; background: var(--accent); color: #FFFFFF; font-size: 16px; font-weight: 700; box-shadow: 0 12px 24px -12px var(--accent); }
.auth-submit:hover { background: var(--accent-2); }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.auth-or span { flex: 1; height: 1px; background: var(--line); }
.auth-family { display: flex; align-items: center; justify-content: center; gap: 10px; height: 52px; border-radius: 14px; background: var(--orange); color: var(--orange-fg); font-size: 15px; font-weight: 700; text-decoration: none; }
.auth-foot { margin: auto 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.auth-foot a { font-weight: 600; text-decoration: none; }

/* ---------- Le Journal et Jeux : réglages avec la nouvelle barre ---------- */
.np-sections { top: 70px; }
.games-page .topbar { background: rgba(18,32,42,.92); }
.games-page .brand-name { color: #F3EEE3; }
.games-page .tabs { background: rgba(243,238,227,.06); border-color: rgba(243,238,227,.1); box-shadow: none; }
.games-page .tab { color: #B9B3A6; }
.games-page .tab.t-games[aria-current=page] { background: rgba(240,179,35,.18); color: #F0B323; }
.games-page .bell { background: rgba(240,179,35,.16); color: #F0B323; }
.games-page .me-btn .sync { border-color: #12202A; }

/* ---------- Téléphone : barre d'onglets flottante ---------- */
@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; padding: 18px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left)); background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .tabs {
    position: fixed; z-index: 30; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); top: auto;
    height: 74px; padding: 8px; box-sizing: border-box; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px;
    border-radius: 26px; background: var(--nav-bg); border: 1px solid var(--line); box-shadow: var(--shadow-ui);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  }
  .tab { flex-direction: column; justify-content: center; gap: 4px; padding: 0; border-radius: 18px; font-size: 12px; font-weight: 700; }
  .tab svg.ic { width: 22px; height: 22px; }
  .tab .badge { position: absolute; top: 6px; left: 50%; right: auto; margin-left: 8px; }
  main { padding-bottom: 120px; }
  .toasts, .live-toasts { bottom: calc(100px + env(safe-area-inset-bottom)); }
  .home .stats { max-width: none; }
  .games-page .topbar { background: #12202A; }
  .games-page .tabs { background: rgba(22,48,58,.94); }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .tab span:not(.badge) { display: none; }
  .tab { padding: 8px 12px; }
}
.who-grid { grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); }
.seg input:checked + span, .stepper input { color: var(--accent-text); }
:root[data-theme=dark] .seg input:checked + span { background: var(--surface); }

/* ---------- Progression d'impression ---------- */
.print-progress { display: grid; gap: 6px; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--violet); color: var(--violet-fg); font-size: .88rem; font-weight: 600; }
.print-progress .pp-bar { height: 6px; border-radius: 999px; background: var(--on-tint); overflow: hidden; }
.print-progress .pp-bar b { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .4s ease; }
.print-progress.printing .pp-bar b { min-width: 8%; animation: pp-pulse 1.4s ease-in-out infinite; }
.print-progress.done { background: var(--vert); color: var(--green-fg); }
.print-progress.done .pp-bar b { background: var(--ok); }
.print-progress.error { background: var(--rose); color: var(--pink-fg); }
.print-progress.error .pp-bar { display: none; }
@keyframes pp-pulse { 50% { opacity: .55; } }

/* ---------- File d'attente d'impression ---------- */
.queue-card { margin-bottom: 16px; }
.queue-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.queue-card h2 { margin-bottom: 10px; }
.queue-card h2 .ico { background: var(--jaune); }
.queue-me { margin: 0; font-size: .88rem; font-weight: 600; color: var(--accent-text); }
.queue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.q-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--input-bg); }
.q-item.printing { background: var(--teal); }
.q-item.mine { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.q-pos { width: 26px; flex: none; text-align: center; font: 600 15px var(--mono); color: var(--muted); }
.q-item .avatar { width: 32px; height: 32px; font-size: 13px; }
.q-info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.q-info b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-info small { color: var(--muted); font-size: .8rem; }
.q-item.printing small { color: var(--teal-fg); font-weight: 600; }
.q-bar { height: 6px; margin-top: 4px; border-radius: 999px; background: var(--on-tint); overflow: hidden; }
.q-bar b { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--teal-fg); transition: width .4s ease; }
.q-cancel { flex: none; color: var(--err); border-color: currentColor; }
.print-progress.waiting { background: var(--jaune); color: var(--amber-fg); }
.print-progress.waiting .pp-bar { display: none; }
.print-progress.cancelled { background: var(--input-bg); color: var(--muted); }
.print-progress.cancelled .pp-bar { display: none; }

/* ---------- Pages d'erreur / hors connexion ---------- */
.err-page { justify-content: center; }
.err-page .auth-brand { gap: 10px; }
.err-code { margin: 6px 0 0 !important; font: 600 13px var(--mono) !important; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text) !important; }
.err-page .auth-submit { text-decoration: none; }
.err-status { margin: 0; text-align: center; font-weight: 600; color: var(--muted); }

/* ======================================================================
   Agenda & Chat (onglets ajoutés) + barre à 6 onglets
   ====================================================================== */
.tab.t-agenda[aria-current=page] { background: var(--rose); color: var(--pink-fg); }
.tab.t-chat[aria-current=page] { background: var(--vert); color: var(--green-fg); }
@media (min-width: 761px) and (max-width: 1180px) {
  .tab span:not(.badge) { display: none; }
  .tab { padding: 8px 12px; }
}
@media (max-width: 760px) {
  .tabs { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 2px; left: 10px; right: 10px; padding: 7px 6px; height: 70px; }
  .tab { font-size: 10.5px; border-radius: 16px; letter-spacing: -0.01em; }
  .tab svg.ic { width: 21px; height: 21px; }
  .tab .badge { margin-left: 4px; }
}

/* ---------- Agenda ---------- */
.ag { max-width: 1240px; padding-top: 12px; display: flex; flex-direction: column; gap: 16px; }
.ag-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; }
.ag-head h1 { text-transform: none; }
.ag-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.ag-nav { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.ag-arrow, .ag-todaybtn { height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--fg); font-weight: 600; }
.ag-arrow { width: 36px; display: grid; place-items: center; }
.ag-todaybtn { padding: 0 12px; font-size: 14px; }
.ag-arrow:hover, .ag-todaybtn:hover { background: var(--violet); color: var(--accent-text); }
.ag-tools .btn.primary { height: 44px; gap: 6px; font-weight: 600; }
.ag-people { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ag-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ag-chip { --c: var(--accent); display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 4px; border-radius: 999px;
  border: 1.5px solid color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 12%, var(--surface));
  color: var(--fg); font-weight: 600; font-size: 14px; }
.ag-chip i { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; background: var(--c); color: #fff; font-style: normal; font-size: 12px; font-weight: 700; }
.ag-chip small { color: var(--muted); }
button.ag-chip.mine { cursor: pointer; }
button.ag-chip.mine:hover { border-color: var(--c); }
.ag-hint { font-size: 13px; color: var(--muted); }
.ag-palette { width: 260px; }
.ag-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 4px; }
.ag-swatches button { aspect-ratio: 1; border-radius: 12px; border: 3px solid transparent; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.ag-swatches button[aria-pressed=true] { border-color: var(--fg); }

.ag-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.ag-month { padding: 12px; }
.ag-dow { display: grid; grid-template-columns: repeat(7, 1fr); padding: 2px 2px 8px; }
.ag-dow span { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.ag-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ag-cell { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 3px; min-height: 104px; padding: 6px; border: 1.5px solid transparent;
  border-radius: 12px; background: var(--input-bg); color: var(--fg); text-align: left; overflow: hidden; cursor: pointer; }
.ag-cell:hover { border-color: var(--line); }
.ag-cell.we { background: color-mix(in srgb, var(--input-bg) 70%, var(--violet)); }
.ag-cell.out { opacity: .45; }
.ag-cell.sel { border-color: var(--accent); background: var(--surface); box-shadow: var(--shadow); }
.ag-num { align-self: flex-start; min-width: 26px; height: 26px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; font: 600 13px var(--mono); }
.ag-cell.today .ag-num { background: var(--accent); color: #fff; }
.ag-pills { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ag-pill { --c: var(--accent); display: block; padding: 2px 6px; border-radius: 6px; border-left: 3px solid var(--c);
  background: color-mix(in srgb, var(--c) 15%, var(--surface)); color: var(--fg); font-size: 12px; font-weight: 600; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-pill b { font: 600 11px var(--mono); color: color-mix(in srgb, var(--c) 75%, var(--fg)); }
.ag-more { font-size: 11px; font-weight: 700; color: var(--muted); padding-left: 4px; }
.ag-dots { display: none; gap: 3px; flex-wrap: wrap; }
.ag-dots i { width: 7px; height: 7px; border-radius: 999px; background: var(--c); }

.ag-day { position: sticky; top: 80px; }
.ag-day-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ag-day-head h2 { margin: 0; font-size: 17px; }
.ag-mini-add { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--accent); color: #fff; }
.ag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ag-empty { color: var(--muted); font-size: 14px; padding: 6px 2px; }
.ag-ev { --c: var(--accent); width: 100%; display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 12px 12px 14px;
  border: 0; border-radius: 14px; text-align: left; color: var(--fg); background: color-mix(in srgb, var(--c) 10%, var(--surface)); position: relative; overflow: hidden; cursor: pointer; }
.ag-ev::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--bar, var(--c)); }
.ag-ev:hover { background: color-mix(in srgb, var(--c) 16%, var(--surface)); }
.ag-time { display: grid; gap: 1px; font: 600 13px var(--mono); color: color-mix(in srgb, var(--c) 80%, var(--fg)); }
.ag-time b { font-size: 17px; font-weight: 600; color: var(--fg); }
.ag-time small { color: var(--muted); font-size: 12px; }
.ag-ev-body { display: grid; gap: 3px; min-width: 0; }
.ag-ev-title { font-size: 16px; line-height: 1.25; }
.ag-ev-meta { font-size: 13px; color: var(--muted); }
.ag-ev-notes { font-size: 13px; color: var(--muted); white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ag-ev-who { display: flex; }
.ag-ev-who i { width: 26px; height: 26px; margin-left: -6px; border-radius: 999px; display: grid; place-items: center; background: var(--c); color: #fff;
  font-style: normal; font-size: 11px; font-weight: 700; border: 2px solid var(--surface); }
.ag-upcoming-card h2 { margin: 0 0 12px; font-size: 17px; }
#ag-upcoming { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 16px 20px; }
.ag-up-day h3 { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* Fiche */
.ag-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(15,14,23,.45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fadein .15s; }
.ag-form { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 20px;
  border-radius: 24px; background: var(--surface); border: 1px solid var(--card-border); box-shadow: var(--shadow-ui); }
.ag-form-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ag-form-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.01em; }
.ag-close { width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 12px; background: var(--input-bg); color: var(--muted); }
.ag-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; border: 0; margin: 0; padding: 0; }
.ag-field > span, .ag-field legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; }
.ag-field small { font-weight: 500; opacity: .8; }
.ag-field input, .ag-field select, .ag-field textarea { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 14px; border: 1.5px solid var(--input-line);
  background: var(--input-bg); color: var(--fg); font: 500 16px var(--font); }
.ag-field textarea { padding: 12px 14px; resize: vertical; line-height: 1.4; }
.ag-field input:focus, .ag-field select:focus, .ag-field textarea:focus { outline: none; border-color: var(--accent); }
.ag-title-field input { font-size: 18px; font-weight: 600; }
.ag-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.ag-row[hidden] { display: none; }
.ag-switch { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border-radius: 14px; background: var(--input-bg); font-weight: 600; cursor: pointer; }
.ag-switch input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.ag-who-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ag-chip.pick { cursor: pointer; opacity: .55; border-style: dashed; }
.ag-chip.pick[aria-pressed=true] { opacity: 1; border-style: solid; border-color: var(--c); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 25%, transparent); }
.ag-form-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 4px; }
.ag-form-foot .btn { min-height: 48px; padding: 0 20px; }
.ag-form-foot .btn.primary { margin-left: auto; }
.ag-delete { color: var(--err); }

@media (max-width: 900px) {
  .ag-layout { grid-template-columns: 1fr; }
  .ag-day { position: static; }
}
@media (max-width: 640px) {
  .ag-month { padding: 8px; }
  .ag-grid { gap: 3px; }
  .ag-cell { min-height: 54px; padding: 4px; align-items: center; border-radius: 10px; }
  .ag-num { align-self: center; font-size: 13px; }
  .ag-pills { display: none; }
  .ag-dots { display: flex; justify-content: center; }
  .ag-tools { width: 100%; justify-content: space-between; }
  .ag-overlay { padding: 0; place-items: end stretch; }
  .ag-form { width: 100%; max-height: 92dvh; border-radius: 24px 24px 0 0; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .ag-ev { grid-template-columns: 50px minmax(0, 1fr) auto; }
}

/* ---------- Chat ---------- */
.chat { max-width: 900px; padding-top: 8px; }
.chat-card { display: flex; flex-direction: column; height: calc(100dvh - 92px); min-height: 420px; background: var(--surface); border: 1px solid var(--card-border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; position: relative; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--vert); }
.chat-head h1 { margin: 0; font-size: 18px; letter-spacing: -0.01em; color: var(--green-sub); }
.chat-members { margin: 0; font-size: 13px; color: var(--green-fg); }
.chat-faces { display: flex; padding-left: 6px; }
.chat-faces i { width: 34px; height: 34px; margin-left: -8px; border-radius: 999px; display: grid; place-items: center; background: var(--c); color: #fff;
  font-style: normal; font-weight: 700; font-size: 14px; border: 2px solid var(--surface); }
.chat-log { flex: 1; overflow-y: auto; padding: 12px 16px 8px; overscroll-behavior: contain; display: flex; flex-direction: column; }
#chat-msgs { display: flex; flex-direction: column; gap: 2px; }
.chat-more { align-self: center; margin: 4px 0 10px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--accent-text); font-weight: 600; font-size: 13px; }
.chat-day { align-self: center; margin: 14px 0 8px; padding: 3px 12px; border-radius: 999px; background: var(--input-bg); color: var(--muted); font-size: 12px; font-weight: 700; }
.chat-row { --c: var(--accent); display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; max-width: 100%; }
.chat-row.grouped { margin-top: 2px; }
.chat-row.mine { flex-direction: row-reverse; }
.chat-av { width: 32px; height: 32px; flex: none; border-radius: 999px; display: grid; place-items: center; background: var(--c); color: #fff; font-weight: 700; font-size: 13px; }
.chat-row.grouped .chat-av { background: transparent; }
.chat-bubble { max-width: min(560px, 78%); padding: 8px 12px 6px; border-radius: 18px 18px 18px 6px; background: color-mix(in srgb, var(--c) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--c) 20%, transparent); }
.chat-row.mine .chat-bubble { border-radius: 18px 18px 6px 18px; background: var(--accent); border-color: transparent; color: #fff; }
.chat-name { display: block; font-size: 12px; font-weight: 700; color: color-mix(in srgb, var(--c) 80%, var(--fg)); margin-bottom: 1px; }
.chat-text { margin: 0; font-size: 15px; line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-text a { color: inherit; text-decoration: underline; }
.chat-time { display: block; text-align: right; font: 500 11px var(--mono); color: var(--muted); margin-top: 2px; }
.chat-row.mine .chat-time { color: rgba(255,255,255,.75); }
.chat-row.deleted .chat-text { font-style: italic; opacity: .6; }
.chat-del { align-self: center; width: 28px; height: 28px; flex: none; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--faint); opacity: 0; }
.chat-row:hover .chat-del, .chat-del:focus-visible { opacity: 1; }
@media (hover: none) { .chat-del { opacity: .5; } }
.chat-empty { margin: auto; text-align: center; color: var(--muted); }
.chat-typing { min-height: 20px; margin: 0; padding: 0 18px; font-size: 13px; font-style: italic; color: var(--muted); }
.chat-down { position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%); padding: 6px 14px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; box-shadow: var(--shadow-ui); }
.chat-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.chat-form textarea { flex: 1; min-height: 46px; max-height: 160px; padding: 12px 14px; border-radius: 16px; border: 1.5px solid var(--input-line); background: var(--input-bg);
  color: var(--fg); font: 400 16px/1.35 var(--font); resize: none; }
.chat-form textarea:focus { outline: none; border-color: var(--accent); }
.chat-send { width: 46px; height: 46px; flex: none; display: grid; place-items: center; border: 0; border-radius: 14px; background: var(--accent); color: #fff; box-shadow: 0 8px 18px -10px var(--accent); }
@media (max-width: 760px) {
  .chat { padding: 4px 8px 0; }
  .chat-card { height: calc(100dvh - 76px - 96px - env(safe-area-inset-bottom)); border-radius: 20px; }
  .chat-bubble { max-width: 82%; }
}

/* Chat : nom au-dessus de chaque message */
.chat-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; max-width: min(560px, 78%); }
.chat-row.mine .chat-col { align-items: flex-end; }
.chat-col .chat-bubble { max-width: 100%; }
.chat-col .chat-name { display: block; margin: 0 6px; font-size: 12px; font-weight: 700; color: color-mix(in srgb, var(--c) 80%, var(--fg)); }
.chat-row.grouped { margin-top: 8px; }
.chat-row.grouped .chat-av { background: var(--c); }
.notif-test { margin-top: 8px; }
@media (max-width: 760px) { .chat-col { max-width: 84%; } }

/* ======================================================================
   La Ferme – jeu de ferme à deux (onglet Jeux) : écran titre + interface de jeu plein écran
   ====================================================================== */
.jx-switch { display: inline-flex; gap: 4px; margin: 18px 0 0; padding: 4px; border-radius: 14px; background: rgba(243,238,227,.06); border: 1px solid var(--line-v); }
.jx-switch a { padding: 8px 14px; border-radius: 10px; color: var(--dim); font-weight: 600; text-decoration: none; }
.jx-switch a:hover { color: var(--cream); }
.jx-switch a[aria-current=page] { background: var(--cream); color: var(--ink); }

.fm { --wood: #6B4423; --wood-d: #4A2F18; --parch: #FFF6E0; --parch-d: #F3E3BD; --leaf: #4CAF50; --leaf-d: #2E7D32;
  --gold: #F5B82E; --gold-d: #B9820A; --tomato: #E0542C; --tomato-d: #9E3216; }

/* --- Boutons de jeu (relief) --- */
.gbtn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px;
  border: 2px solid var(--wood-d); border-radius: 14px; background: var(--parch); color: var(--wood-d);
  font: 800 15px/1 "Bricolage Grotesque", "Outfit", sans-serif; letter-spacing: .01em; cursor: pointer;
  box-shadow: 0 4px 0 var(--wood-d); transition: transform .06s, box-shadow .06s, filter .15s; }
.gbtn:hover { filter: brightness(1.06); }
.gbtn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--wood-d); }
.gbtn:disabled { filter: grayscale(.7); opacity: .55; cursor: not-allowed; transform: none; }
.gbtn.green { background: linear-gradient(#6CCB5F, var(--leaf)); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.35); border-color: #1F5E23; box-shadow: 0 4px 0 #1F5E23; }
.gbtn.gold { background: linear-gradient(#FFD45C, var(--gold)); border-color: #8A5F05; box-shadow: 0 4px 0 #8A5F05; color: #4A2F00; }
.gbtn.red { background: linear-gradient(#F27A55, var(--tomato)); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.35); border-color: #7A2510; box-shadow: 0 4px 0 #7A2510; }
.gbtn.ghost { background: transparent; box-shadow: none; border-color: rgba(74,47,24,.35); }
.gbtn.danger { color: #B3261E; }
.gbtn.sm { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 11px; }
.gbtn.big { min-height: 56px; font-size: 18px; }
.gbtn.wide { width: 100%; }

/* --- Écran titre (liste des fermes) --- */
.fm #lobby-view .vg-hero { position: relative; overflow: hidden; margin: 18px 0; padding: 28px 22px 92px; border-radius: 26px;
  background: linear-gradient(#8FD3F4, #CDEFFB 58%, #7CC35A 58%, #5FA84A); border: 3px solid var(--wood-d); box-shadow: 0 6px 0 var(--wood-d); }
.fm #lobby-view .vg-title h1 { color: #FFF6E0; -webkit-text-stroke: 2px var(--wood-d); paint-order: stroke fill; text-shadow: 0 5px 0 var(--wood-d); font-size: clamp(2.8rem, 9vw, 5rem); }
.fm #lobby-view .vg-title p { color: var(--wood-d); font-weight: 700; }
.fm-logo { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 20px; background: var(--parch); border: 3px solid var(--wood-d); box-shadow: 0 4px 0 var(--wood-d); font-size: 2.4rem; }
.fm-hero-row { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; font-size: clamp(1.3rem, 6.5vw, 2rem); letter-spacing: .2em; white-space: nowrap; }
.fm #lobby-view .vg-panel { background: var(--parch); color: var(--wood-d); border: 3px solid var(--wood-d); box-shadow: 0 5px 0 var(--wood-d); }
.fm #lobby-view .vg-panel h2 { color: var(--wood-d); }
.fm #lobby-view .vg-hint, .fm #lobby-view .vg-field { color: #7A5A3A; }
.fm #lobby-view .vg-field input { background: #fff; color: var(--wood-d); border: 2px solid var(--wood); }
.fm #lobby-view .vg-field input::placeholder { color: #B09A80; }
.fm #lobby-view .rules-body, .fm #lobby-view .rules-body b { color: var(--wood-d); }
.fm #lobby-view .vg-games li { background: #FFFBEF; border: 2px solid var(--parch-d); }
.fm #lobby-view .vg-games small, .fm #lobby-view .vg-empty { color: #8A6A48; }
.fm #lobby-view .faces .avatar { width: 24px; height: 24px; font-size: .7rem; margin-right: -6px; border: 2px solid #FFFBEF; }
.fm-farm-card { display: flex; align-items: center; gap: 12px; }
.fm-farm-lv { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: linear-gradient(#FFD45C, var(--gold)); border: 2px solid #8A5F05; font: 800 1rem "Bricolage Grotesque", sans-serif; color: #4A2F00; }
.fm-farm-card .g-info { flex: 1; }

/* --- Plein écran : le site s'efface pendant la partie --- */
body.fm-playing { overflow: hidden; }
body.fm-playing .topbar { display: none; }
body.fm-playing .toasts { bottom: calc(190px + env(safe-area-inset-bottom)); }
.fm-game { position: fixed; inset: 0; z-index: 40; background: linear-gradient(#7CC7F0, #D4F0FA); color: var(--wood-d);
  font-family: "Outfit", system-ui, sans-serif; user-select: none; -webkit-user-select: none; }
.fm-game[hidden] { display: none; }
.fm-scroll { position: absolute; inset: 0; overflow: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.fm-scroll::-webkit-scrollbar { display: none; }
.fm-world { display: block; touch-action: none; will-change: transform; }  /* gestes gérés par le jeu : glisser, pincer */
.fm-world.pointing { cursor: pointer; }
.fm-world.dragging { cursor: grabbing; }

/* --- Barre du haut (HUD) --- */
.hud-top { position: absolute; z-index: 2; top: calc(10px + env(safe-area-inset-top)); left: 10px; right: 10px;
  display: flex; align-items: center; gap: 8px; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.hud-round { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--wood-d);
  background: var(--parch); color: var(--wood-d); font: 800 20px/1 "Bricolage Grotesque", sans-serif; box-shadow: 0 3px 0 var(--wood-d); cursor: pointer; }
.hud-round:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--wood-d); }
.hud-farm { flex: 1; min-width: 0; display: grid; gap: 4px; }
.hud-farm > b { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 10px; border-radius: 10px;
  background: rgba(74,47,24,.82); color: #FFF6E0; font: 800 .95rem "Bricolage Grotesque", sans-serif; }
.hud-mates { display: flex; gap: 6px; flex-wrap: wrap; }
.hud-mate { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px; background: rgba(255,246,224,.94);
  border: 2px solid var(--wood-d); font-weight: 700; font-size: .8rem; max-width: 220px; }
.hud-mate .avatar { position: relative; width: 26px; height: 26px; font-size: .75rem; }
.hud-mate .dot { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--parch); }
.hud-mate .dot.on { background: #34C759; }
.hud-mate .dot.off { background: #9A9A9A; }
.hud-mate > span:last-child { display: grid; line-height: 1.1; min-width: 0; }
.hud-mate small { font-weight: 600; color: #7A5A3A; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.hud-level { flex: none; display: flex; align-items: center; }
.hud-star { position: relative; z-index: 1; display: grid; place-items: center; width: 50px; height: 50px; margin-right: -14px;
  background: linear-gradient(#FFE07A, var(--gold)); clip-path: polygon(50% 0, 62% 33%, 98% 35%, 70% 57%, 80% 92%, 50% 72%, 20% 92%, 30% 57%, 2% 35%, 38% 33%);
  filter: drop-shadow(0 2px 0 var(--wood-d)); }
.hud-star b { margin-top: 4px; font: 800 1rem "Bricolage Grotesque", sans-serif; color: #4A2F00; }
.hud-xp { position: relative; width: 92px; height: 22px; border-radius: 0 11px 11px 0; background: rgba(74,47,24,.85); border: 2px solid var(--wood-d); overflow: hidden; }
.hud-xp i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(#8EE07C, #4CAF50); transition: width .5s; }
.hud-xp span { position: relative; display: block; padding-left: 14px; text-align: center; font: 800 .7rem/18px "Outfit", sans-serif; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.5); }
.hud-coins { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px 0 8px; border-radius: 999px;
  background: var(--parch); border: 3px solid var(--wood-d); box-shadow: 0 3px 0 var(--wood-d); font-size: 1.1rem; }
.hud-coins b { font: 800 1.05rem "Bricolage Grotesque", sans-serif; color: #8A5F05; font-variant-numeric: tabular-nums; min-width: 2ch; }
.hud-coins.bump { animation: hud-bump .45s ease-out; }
.hud-coins.drop { animation: hud-drop .35s ease-out; }
@keyframes hud-bump { 40% { transform: scale(1.18); background: #FFF0B3; } }
@keyframes hud-drop { 40% { transform: scale(.92); } }
@media (max-width: 560px) {
  .hud-top { flex-wrap: wrap; }
  .hud-farm { order: 5; flex-basis: 100%; }
  .hud-level { margin-left: auto; }
  .hud-xp { width: 70px; }
}

.hud-left { position: absolute; z-index: 1; left: 10px; top: calc(160px + env(safe-area-inset-top)); display: grid; gap: 8px; justify-items: start; pointer-events: none; max-width: min(70vw, 340px); }
@media (min-width: 561px) { .hud-left { top: calc(84px + env(safe-area-inset-top)); } }
.fm-active { display: flex; flex-wrap: wrap; gap: 6px; }
.fm-chip { padding: 5px 10px; border-radius: 999px; background: rgba(74,47,24,.82); color: #FFF6E0; font-weight: 700; font-size: .8rem; }
.fm-chip.boost { background: rgba(240,179,35,.95); color: #4A2F00; }
.hud-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; justify-items: start; }
.hud-feed li { padding: 6px 12px; border-radius: 12px; background: rgba(91,79,224,.92); color: #fff; font-weight: 600; font-size: .85rem;
  box-shadow: 0 3px 10px rgba(0,0,0,.2); animation: feed-in .3s ease-out; transition: opacity .4s, transform .4s; }
.hud-feed li.out { opacity: 0; transform: translateX(-12px); }
@keyframes feed-in { from { opacity: 0; transform: translateX(-16px); } }

.hud-right { position: absolute; z-index: 1; right: 10px; top: 50%; transform: translateY(-50%); display: grid; gap: 8px; }
.hud-join { position: absolute; z-index: 2; left: 50%; top: calc(130px + env(safe-area-inset-top)); transform: translateX(-50%); margin: 0;
  display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 16px; background: var(--parch); border: 3px solid var(--wood-d); font-weight: 700; white-space: nowrap; }

/* --- Bas de l'écran : fiche, boutique, dock --- */
.hud-bottom { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; display: grid; gap: 8px; padding: 0 10px calc(8px + env(safe-area-inset-bottom)); pointer-events: none; }
.hud-bottom > * { pointer-events: auto; }
.hud-fab { position: absolute; left: 14px; top: -78px; width: 66px; height: 66px; border-radius: 50%; border: 3px solid #8A5F05;
  background: radial-gradient(circle at 35% 30%, #FFE68A, var(--gold)); box-shadow: 0 5px 0 #8A5F05, 0 8px 18px rgba(0,0,0,.25); font-size: 2rem; cursor: pointer;
  animation: fab-bob 1.6s ease-in-out infinite; }
.hud-fab[hidden] { display: none; }
.hud-fab b { position: absolute; top: -6px; right: -6px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--tomato); color: #fff; border: 2px solid #fff; font: 800 .85rem/22px "Outfit", sans-serif; }
@keyframes fab-bob { 50% { transform: translateY(-5px); } }
.hud-card { position: relative; justify-self: center; width: min(100%, 560px); padding: 12px 14px; border-radius: 18px; background: var(--parch);
  border: 3px solid var(--wood-d); box-shadow: 0 5px 0 var(--wood-d), 0 10px 24px rgba(0,0,0,.2); display: grid; gap: 8px; animation: card-in .2s ease-out; }
.hud-card[hidden] { display: none; }
@keyframes card-in { from { transform: translateY(10px); opacity: 0; } }
.hud-x { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--wood-d); background: #fff; color: var(--wood-d); font-weight: 800; cursor: pointer; }
.fm-info-head { display: flex; align-items: center; gap: 12px; padding-right: 34px; }
.fm-info-head > div { display: grid; gap: 2px; min-width: 0; }
.fm-info-head b { font: 800 1.02rem "Bricolage Grotesque", sans-serif; }
.fm-info-head small { color: #7A5A3A; line-height: 1.35; }
.fm-info-emo { font-size: 2.1rem; }
.fm-prog { height: 10px; border-radius: 5px; background: rgba(74,47,24,.2); overflow: hidden; border: 1px solid rgba(74,47,24,.3); }
.fm-prog i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6CCB5F, #A6E88F); }
.hud-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hud-actions:empty { display: none; }

.hud-tray { justify-self: center; max-width: 100%; display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
.hud-tray::-webkit-scrollbar { display: none; }
.hud-tray[hidden] { display: none; }
.tray-item { flex: none; scroll-snap-align: start; display: grid; justify-items: center; gap: 1px; width: 76px; padding: 6px 4px 7px; border-radius: 16px;
  border: 3px solid var(--wood-d); background: var(--parch); color: var(--wood-d); font: 700 12px "Outfit", sans-serif; cursor: pointer; box-shadow: 0 3px 0 var(--wood-d);
  transition: transform .12s; }
.tray-item .tray-emo { font-size: 1.75rem; line-height: 1.15; }
.tray-item b { font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tray-item small { font-size: .7rem; color: #8A5F05; font-weight: 800; }
.tray-item.on { background: linear-gradient(#FFF3C4, #FFE07A); border-color: #8A5F05; transform: translateY(-6px); box-shadow: 0 6px 0 #8A5F05; }
.tray-item:disabled { filter: grayscale(.9); opacity: .55; cursor: not-allowed; }
.tray-hint { margin: 0; padding: 10px 14px; border-radius: 14px; background: var(--parch); border: 3px solid var(--wood-d); font-weight: 600; font-size: .9rem; }

.hud-dock { justify-self: center; display: flex; align-items: stretch; gap: 6px; padding: 7px; border-radius: 22px;
  background: linear-gradient(#8B5A2B, var(--wood)); border: 3px solid var(--wood-d); box-shadow: 0 5px 0 var(--wood-d), 0 10px 26px rgba(0,0,0,.3); max-width: 100%; }
.dock-tools { display: flex; gap: 6px; }
.dock-sep { width: 2px; margin: 6px 1px; border-radius: 1px; background: rgba(0,0,0,.25); }
.dock-btn { position: relative; display: grid; justify-items: center; align-content: center; gap: 1px; width: 58px; min-height: 58px; padding: 4px 2px;
  border: 2px solid var(--wood-d); border-radius: 15px; background: var(--parch); color: var(--wood-d); font: 800 10.5px "Outfit", sans-serif; cursor: pointer;
  box-shadow: 0 3px 0 var(--wood-d); }
.dock-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--wood-d); }
.dock-btn .dock-ic { font-size: 1.55rem; line-height: 1.1; }
.dock-btn.on { background: linear-gradient(#8EE07C, #4CAF50); color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.4); border-color: #1F5E23; box-shadow: 0 3px 0 #1F5E23; }
.dock-badge { position: absolute; top: -7px; right: -7px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--tomato); color: #fff;
  border: 2px solid #fff; font: 800 .72rem/18px "Outfit", sans-serif; }
.dock-badge[hidden] { display: none; }
@media (max-width: 420px) {
  .hud-dock { gap: 4px; padding: 5px; }
  .dock-tools { gap: 4px; }
  .dock-btn { width: 46px; min-height: 52px; font-size: 9.5px; border-radius: 12px; }
  .dock-btn .dock-ic { font-size: 1.3rem; }
}

/* --- Passage de niveau --- */
.hud-levelup { position: absolute; z-index: 5; left: 50%; top: 38%; transform: translate(-50%, -50%); width: min(86vw, 380px); box-sizing: border-box; display: grid; justify-items: center; gap: 6px;
  padding: 22px 30px; border-radius: 24px; background: var(--parch); border: 4px solid #8A5F05; box-shadow: 0 6px 0 #8A5F05, 0 20px 60px rgba(0,0,0,.35);
  text-align: center; animation: lu-in .5s cubic-bezier(.2,1.6,.4,1); pointer-events: none; }
.hud-levelup[hidden] { display: none; }
.hud-levelup b { font: 800 2rem "Bricolage Grotesque", sans-serif; color: #8A5F05; }
.hud-levelup span { max-width: 300px; font-weight: 600; }
.lu-burst { font-size: 3.4rem; animation: lu-spin 1.4s ease-out; }
@keyframes lu-in { from { transform: translate(-50%, -50%) scale(.3); opacity: 0; } }
@keyframes lu-spin { from { transform: rotate(-180deg) scale(.2); } }

/* --- Panneaux (dialog natif) : feuille du bas sur téléphone, fenêtre sur ordinateur --- */
.fm-sheet { width: min(520px, 100vw); max-height: 86vh; padding: 0 18px 20px; border: 4px solid var(--wood-d); border-radius: 24px; background: var(--parch);
  color: var(--wood-d); box-shadow: 0 8px 0 var(--wood-d), 0 24px 60px rgba(0,0,0,.4); overflow-y: auto; font-family: "Outfit", sans-serif; }
.fm-sheet[open] { animation: sheet-in .25s ease-out; }
.fm-sheet::backdrop { background: rgba(30,20,8,.55); }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
@media (max-width: 560px) {
  .fm-sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 24px 24px 0 0; border-bottom: 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
}
.fm-sheet header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; margin: 0 -18px 12px; padding: 14px 56px 12px 18px;
  background: linear-gradient(#8B5A2B, var(--wood)); border-bottom: 3px solid var(--wood-d); }
.fm-sheet h2 { margin: 0; color: #FFF6E0; font: 800 1.25rem "Bricolage Grotesque", sans-serif; text-shadow: 0 2px 0 var(--wood-d); }
.fm-sheet h3 { margin: 16px 0 8px; font: 800 1rem "Bricolage Grotesque", sans-serif; }
.fm-sheet header .hud-x { top: 50%; transform: translateY(-50%); right: 12px; }
.sheet-hint { margin: 0 0 10px; color: #7A5A3A; font-size: .88rem; line-height: 1.45; }
.sheet-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.sheet-flash { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: #E3F6DD; border: 2px solid #4CAF50; font-weight: 700; animation: card-in .2s ease-out; }
.sheet-flash.err { background: #FDE3DC; border-color: var(--tomato); }
.fm-barn { list-style: none; margin: 10px 0 14px; padding: 0; display: grid; gap: 8px; }
.fm-barn li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: #FFFBEF; border: 2px solid var(--parch-d); }
.fm-barn li .g-info { flex: 1; display: grid; gap: 2px; min-width: 0; }
.fm-barn li small { color: #7A5A3A; }
.fm-barn li.vg-empty { color: #8A6A48; justify-content: center; }
.fm-barn .fm-emo { font-size: 1.7rem; }
.fm-barn.small li { padding: 6px 10px; }
.fm-barn.small .fm-emo { font-size: 1.2rem; }
.fm-barn .avatar { flex: none; }
.fm-trend { font-size: .78rem; font-weight: 800; color: #8A6A48; }
.fm-trend.up { color: #2E7D32; }
.fm-trend.down { color: #C0392B; }
.fm-quotes summary { cursor: pointer; color: #7A5A3A; margin-top: 14px; font-weight: 700; }
.fm-log { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto; font-size: .9rem; }
.fm-log li { padding: 6px 0; border-bottom: 1px dashed rgba(74,47,24,.25); }
.fm-log time { color: #8A6A48; font-variant-numeric: tabular-nums; margin-right: 4px; }
.fm-wheel { position: relative; width: min(300px, 80vw); aspect-ratio: 1; margin: 18px auto 18px; }
.fm-wheel canvas { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 7px var(--wood), 0 0 0 10px var(--wood-d), 0 12px 26px rgba(0,0,0,.35);
  transition: transform 4.2s cubic-bezier(.15,.7,.15,1); }
.fm-pointer { position: absolute; z-index: 1; left: 50%; top: -14px; width: 0; height: 0; margin-left: -15px;
  border: 15px solid transparent; border-top: 28px solid var(--tomato); filter: drop-shadow(0 2px 0 var(--wood-d)); }
@media (prefers-reduced-motion: reduce) {
  .fm-wheel canvas { transition-duration: .5s; }
  .hud-fab, .hud-coins.bump, .lu-burst { animation: none; }
}
.pen-acts { display: flex; gap: 6px; flex: none; }
.tray-item .tray-img { width: 44px; height: 38px; object-fit: contain; filter: drop-shadow(0 2px 1px rgba(0,0,0,.25)); }

/* Enveloppes DL */
.env-preview { display: block; width: 100%; aspect-ratio: 2 / 1; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .08); }
#env-form textarea { display: block; width: 100%; margin: 4px 0 12px; padding: 8px 10px; border: 1.5px solid var(--input-line, var(--line)); border-radius: 12px; background: var(--input-bg, var(--bg)); color: var(--fg); font: inherit; font-weight: 400; resize: vertical; }
.env-howto { margin: 16px 0 0; padding: 14px; border-radius: 14px; background: var(--accent-soft); }
.env-howto figcaption { font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.env-howto svg { display: block; width: 100%; max-width: 360px; margin: 0 auto; }
.env-howto ol { margin: 8px 0 4px; padding-left: 1.4em; font-size: .88rem; line-height: 1.45; }
.env-howto .hint { margin-bottom: 0; }
.eh-tray { fill: var(--surface-solid); stroke: var(--muted); stroke-width: 2; stroke-linejoin: round; }
.eh-rail { stroke: var(--muted); stroke-width: 2; stroke-dasharray: 4 4; }
.eh-env { fill: #fff; stroke: var(--fg); stroke-width: 2; }
.eh-flap { stroke: #888; stroke-width: 1.5; stroke-dasharray: 5 4; }
.eh-logo { fill: #0b348c; }
.eh-txt { stroke: #9a9a9a; stroke-width: 2; stroke-linecap: round; fill: none; }
.eh-guide { fill: var(--accent); }
.eh-arrow { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.eh-body { fill: var(--surface-solid); stroke: var(--fg); stroke-width: 2.5; }
.eh-panel { fill: var(--line); }
.eh-out { fill: var(--line); stroke: var(--muted); stroke-width: 1.5; }
.eh-led { fill: var(--ok); }
.eh-num circle { fill: var(--accent); }
.eh-num text { fill: var(--accent-fg); font: 700 12px system-ui, sans-serif; text-anchor: middle; }

/* ======================================================================
   ACCUEIL « pro » (2026-10-08) : en-tête sobre, indicateurs en bandeau,
   cartes de liste neutres (couleur de la liste en liseré). Placé en dernier.
   ====================================================================== */
body.dash .home { gap: 20px; padding-top: 22px; }
.home-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
body.dash .greet { padding: 0; gap: 6px; }
body.dash .greet-date { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
body.dash .greet h1 { font-size: 30px; font-weight: 650; letter-spacing: -0.03em; }
body.dash .greet h1 .accent-text { color: var(--fg); }
body.dash .home-head .search { flex: 0 1 380px; max-width: none; height: 42px; border-radius: 10px; color: var(--muted); }
body.dash .home-head .search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
body.dash .home-head .search kbd { background: var(--row-line); color: var(--muted); }

body.dash .home .stats { max-width: none; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(23,22,42,.04); }
body.dash .home .stat { flex-direction: column-reverse; justify-content: flex-end; gap: 6px; padding: 16px 20px; border-radius: 0; background: transparent; }
body.dash .home .stat + .stat { border-left: 1px solid var(--line); }
body.dash .home .stat b { font: 650 28px/1.1 var(--font); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--fg); }
body.dash .home .stat span { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
body.dash .home .stat span::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--dot, var(--faint)); }
body.dash .home .stat.s0 { --dot: var(--accent); }
body.dash .home .stat.s2 { --dot: var(--ok); }

body.dash .lists-head h2 { font-size: 16px; font-weight: 650; }
body.dash .lists-head .btn.primary { height: 36px; border-radius: 10px; box-shadow: none; }

body.dash .board { gap: 14px; }
body.dash .board .note { border: 1px solid var(--line); border-top: 3px solid var(--nc-bar); border-radius: 14px; box-shadow: 0 1px 2px rgba(23,22,42,.04); }
body.dash .board .note:hover { transform: none; box-shadow: 0 6px 20px -10px rgba(23,22,42,.18); }
body.dash .note-band { gap: 10px; padding: 14px 16px; background: transparent; border-bottom: 1px solid var(--row-line); }
body.dash .note .emoji-btn { width: 36px; height: 36px; border-radius: 10px; font-size: 18px; background: var(--nc-band); }
body.dash .note .emoji-btn:hover { background: var(--nc-band); filter: brightness(.97); }
body.dash .note .note-title { font-size: 16px; font-weight: 650; color: var(--fg); }
body.dash .note .count { font-size: 12.5px; color: var(--muted); }
body.dash .note .note-grip { color: var(--faint); }
body.dash .note .menu-btn { width: 34px; height: 34px; border-radius: 8px; background: transparent; color: var(--muted); }
body.dash .note .menu-btn:hover { background: var(--row-line); color: var(--fg); }
body.dash .note .note-band .progress { height: 4px; background: var(--row-line); }
body.dash .note-body { gap: 10px; padding: 2px 16px 16px; }
body.dash .note .items li { min-height: 52px; }
body.dash .it-tile { width: 30px; height: 30px; border-radius: 8px; font-size: 13px; }
body.dash .note .note-body .add-item input { height: 42px; border-radius: 10px; border: 1px solid var(--line); }
body.dash .note .note-body .add-item input:focus { border-color: var(--nc-bar); box-shadow: 0 0 0 3px var(--nc-band); }
body.dash .note .note-body .add { width: 42px; height: 42px; border-radius: 10px; }
body.dash .note .shop-btn { height: 40px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--fg); font-weight: 600; }
body.dash .note .shop-btn:hover { background: var(--row-line); filter: none; }
body.dash .board .add-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 120px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }
body.dash .board .add-card:hover { background: var(--surface); border-color: var(--accent); color: var(--accent-text); }
body.dash .board .add-card .plus { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); }
body.dash .tips { margin: 12px 0 0; max-width: none; padding-top: 16px; border-top: 1px solid var(--line); text-align: left; font-size: 12.5px; }
@media (max-width: 640px) {
  body.dash .home { gap: 16px; padding-top: 14px; }
  body.dash .home-head { padding-bottom: 16px; }
  body.dash .greet h1 { font-size: 25px; }
  body.dash .home-head .search { flex: 1 1 100%; }
  body.dash .home .stat { padding: 12px 14px; }
  body.dash .home .stat b { font-size: 22px; }
  body.dash .home .stat span { font-size: 12px; }
}

/* ======================================================================
   JEUX : choix du jeu en cartes (/jeux) ; VIRAGE est sur /virage.
   ====================================================================== */
.jx-head { margin: 30px 0 22px; }
.jx-head h1 { margin: 0; font-size: clamp(2.2rem, 6vw, 3.4rem); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.jx-head p { margin: 8px 0 0; color: var(--dim); }
.jx-cards { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.jx-card { display: flex; flex-direction: column; overflow: hidden; border-radius: 22px; border: 1px solid var(--line-v); background: rgba(243,238,227,.06); color: var(--cream); text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s; }
.jx-card:hover, .jx-card:focus-visible { transform: translateY(-3px); border-color: rgba(243,238,227,.3); box-shadow: 0 18px 40px -18px rgba(0,0,0,.7); }
.jx-art { position: relative; height: 170px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.jx-virage .jx-art { background: radial-gradient(circle at 50% 120%, #1F4652, var(--felt) 70%); }
.jx-c { display: grid; place-items: center; width: 64px; height: 92px; margin: 0 -8px; border-radius: 10px; border: 4px solid var(--paper); color: #fff; font: 800 1.5rem "Bricolage Grotesque", sans-serif; box-shadow: 0 8px 18px -6px rgba(0,0,0,.6); transition: transform .2s; }
.jx-c.r { background: var(--braise); transform: rotate(-14deg) translateY(8px); }
.jx-c.y { background: var(--moutarde); color: var(--ink); transform: rotate(-5deg); }
.jx-c.g { background: var(--sapin); transform: rotate(5deg); }
.jx-c.b { background: var(--myrtille); transform: rotate(14deg) translateY(8px); }
.jx-card:hover .jx-c.r { transform: rotate(-20deg) translate(-8px, 6px); }
.jx-card:hover .jx-c.b { transform: rotate(20deg) translate(8px, 6px); }
.jx-ferme .jx-art { background: linear-gradient(#8FD3F4 0 55%, #7CC66B 55% 100%); }
.jx-emo { font-size: 2.6rem; letter-spacing: .1em; filter: drop-shadow(0 4px 2px rgba(0,0,0,.2)); transition: transform .2s; }
.jx-card:hover .jx-emo { transform: scale(1.06); }
.jx-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.jx-title { display: flex; align-items: center; gap: 12px; }
.jx-title h2 { margin: 0; font-size: 1.5rem; }
.jx-ico { font-size: 1.4rem; }
.jx-body p { margin: 0; color: var(--dim); font-size: .93rem; line-height: 1.45; }
.jx-body .jx-status { color: var(--cream); font-weight: 600; font-size: .88rem; }
.jx-body .jx-status.hot { color: var(--moutarde); }
.jx-go { margin-top: auto; align-self: flex-start; }
.jx-back { display: inline-flex; margin: 18px 0 0; padding: 6px 2px; color: var(--dim); font-weight: 600; text-decoration: none; }
.jx-back:hover { color: var(--cream); }
@media (prefers-reduced-motion: reduce) { .jx-card, .jx-c, .jx-emo { transition: none; } }

/* ======================================================================
   LA FERME : ateliers, outil zone, Route de l'Élixyr (2026-10-08)
   ====================================================================== */
.tray-hint.area { flex: none; align-self: center; max-width: 230px; font-size: .8rem; padding: 8px 12px; }
.fm-sheet.elx { width: min(640px, 100vw); }
.elx-route { list-style: none; display: flex; gap: 0; margin: 0 -18px 12px; padding: 6px 18px 10px; overflow-x: auto; scroll-snap-type: x proximity; }
.elx-route li { flex: none; position: relative; display: grid; justify-items: center; gap: 4px; width: 84px; scroll-snap-align: center; text-align: center; }
.elx-route li::before { content: ""; position: absolute; top: 22px; left: -50%; width: 100%; border-top: 4px dotted rgba(74,47,24,.35); z-index: 0; }
.elx-route li:first-child::before { display: none; }
.elx-route li.done::before, .elx-route li.here::before { border-top-style: solid; border-color: var(--leaf); }
.elx-node { position: relative; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #E9DDC3; border: 3px solid rgba(74,47,24,.4); font-size: 1.3rem; filter: grayscale(.8); opacity: .7; }
.elx-route li.done .elx-node { background: var(--leaf); border-color: var(--leaf-d); color: #fff; font-weight: 900; filter: none; opacity: 1; }
.elx-route li.here .elx-node { width: 52px; height: 52px; margin-top: -4px; background: #FFF3C4; border-color: var(--gold-d); box-shadow: 0 0 0 4px rgba(245,184,46,.45); filter: none; opacity: 1; animation: elx-pulse 1.6s ease-in-out infinite; }
.elx-route small { font-size: .68rem; font-weight: 700; line-height: 1.15; color: #7A5A3A; }
.elx-route li.here small { color: var(--wood-d); }
@keyframes elx-pulse { 50% { box-shadow: 0 0 0 9px rgba(245,184,46,.15); } }

.elx-scene { --c1: #9BE07A; --c2: #3E9B52; position: relative; overflow: hidden; padding: 14px; border-radius: 20px; border: 3px solid var(--wood-d);
  background: radial-gradient(120% 70% at 50% 0%, rgba(255,255,255,.55), transparent 60%), linear-gradient(170deg, var(--c1), var(--c2)); box-shadow: 0 4px 0 var(--wood-d); }
.elx-scene-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.elx-scene-head > div { padding: 6px 12px; border-radius: 12px; background: rgba(27,26,46,.45); }
.elx-scene-head b { display: block; font: 800 1.15rem "Bricolage Grotesque", sans-serif; }
.elx-scene-head small { font-weight: 700; opacity: .95; }
.elx-realm-emo { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: rgba(255,255,255,.85); border: 3px solid var(--wood-d); font-size: 1.8rem; text-shadow: none; }
.elx-monuments { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 560px) { .elx-monuments { grid-template-columns: repeat(5, 1fr); } }
.elx-mon { display: grid; justify-items: center; align-content: start; gap: 3px; padding: 10px 6px; border-radius: 16px; background: rgba(255,251,239,.92); border: 2px solid rgba(74,47,24,.25); text-align: center; }
.elx-mon b { font-size: .8rem; line-height: 1.2; color: var(--wood-d); }
.elx-mon-emo { font-size: 2.1rem; line-height: 1.1; transition: transform .25s, filter .25s; }
.elx-mon.s0 .elx-mon-emo { filter: grayscale(1) brightness(1.15); opacity: .45; transform: scale(.8); }
.elx-mon.s1 .elx-mon-emo { transform: scale(.9); }
.elx-mon.s3 { background: linear-gradient(#FFF7D6, #FFE7A0); border-color: var(--gold-d); }
.elx-mon.s3 .elx-mon-emo { transform: scale(1.12); filter: drop-shadow(0 0 6px rgba(255,210,80,.9)); }
.elx-stars { color: var(--gold-d); font-size: .85rem; letter-spacing: 1px; }
.elx-mon .gbtn { width: 100%; padding: 0 6px; font-size: .74rem; }
.elx-done { font-weight: 800; color: var(--leaf-d); }

.elx-machine { margin-top: 14px; padding: 14px; border-radius: 20px; background: linear-gradient(#3A2470, #1E1340); border: 3px solid var(--gold-d); box-shadow: 0 4px 0 #5A3D07; }
.elx-reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.elx-reels span { display: grid; place-items: center; height: 76px; border-radius: 14px; background: linear-gradient(#FFFFFF, #EDE6D6 45%, #FFFFFF); border: 3px solid var(--gold); font-size: 2.6rem; box-shadow: inset 0 6px 10px rgba(0,0,0,.18); }
.elx-reels.spinning span:not([data-stop]) { filter: blur(1.5px); transform: translateY(2px); }
.elx-reels.win span { animation: elx-win .3s ease-in-out 4 alternate; }
@keyframes elx-win { to { transform: scale(1.08); box-shadow: 0 0 18px 4px rgba(255,214,80,.9); } }
.elx-timer { margin: 8px 0 0; text-align: center; color: #E8DCFF; font-size: .82rem; font-weight: 600; }
.elx-flask { display: flex; align-items: center; gap: 12px; margin: 14px 0 10px; padding: 10px 12px; border-radius: 16px; background: linear-gradient(90deg, #FFE4F1, #F3E4FF); border: 2px solid #C04A8A; }
.elx-flask .g-info { flex: 1; display: grid; gap: 2px; min-width: 0; }
.elx-flask b { color: #8A1F5C; }
.elx-flask small { color: #7A4A6A; }
.elx-flask-emo { font-size: 2rem; filter: drop-shadow(0 0 6px rgba(192,74,138,.6)); }
@media (prefers-reduced-motion: reduce) { .elx-route li.here .elx-node, .elx-reels.win span { animation: none; } }

/* ======================================================================
   ADMINISTRATION + DEVIS (2026-10-08)
   ====================================================================== */
/* Menu : autant de colonnes que d'onglets ouverts au compte */
@media (max-width: 760px) {
  .tabs { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .tabs:has(> .tab:nth-child(7)) .tab { font-size: 9.5px; }
}
.tab.t-devis[aria-current=page] { background: var(--bleu); color: var(--blue-fg); }
.admin-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--violet); color: var(--violet-fg); }
.admin-btn:hover { filter: brightness(.97); }

/* ---------- Administration ---------- */
.adm { max-width: 980px; }
.adm-users { display: grid; gap: 14px; margin-bottom: 14px; }
.adm-user header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.adm-user .avatar.big { width: 48px; height: 48px; font-size: 20px; flex: none; }
.adm-user h2 { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 18px; text-transform: capitalize; }
.adm-user .hint { margin: 2px 0 0; }
.adm-badge { padding: 2px 8px; border-radius: 999px; background: var(--violet); color: var(--violet-fg); font-size: 12px; font-weight: 600; text-transform: none; }
.adm-badge.off { background: var(--rose); color: var(--pink-fg); }
.adm-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.page-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.adm-app { position: relative; display: block; cursor: pointer; }
.adm-app input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.adm-app span { white-space: nowrap; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--input-bg); color: var(--muted); font-weight: 600; transition: background .15s, border-color .15s; }
.adm-app span::after { content: ""; margin-left: auto; width: 34px; height: 20px; border-radius: 999px; background: var(--check-off); box-shadow: inset -14px 0 0 2px var(--check-off), inset 0 0 0 2px var(--check-off); background-image: radial-gradient(circle at 10px 10px, #fff 7px, transparent 7.5px); transition: background-position .15s, background-color .15s; }
.adm-app input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--fg); }
.adm-app input:checked + span::after { background-color: var(--accent); box-shadow: none; background-position: 14px 0; }
.adm-app input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.adm-app input:disabled + span { opacity: .6; cursor: not-allowed; }
.adm-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.adm-row .btn.danger { margin-left: auto; color: var(--err); }
.adm-user.blocked { opacity: .85; border: 1.5px dashed var(--err); }

/* ---------- Devis (v2 : tableau de bord, éditeur en deux colonnes) ---------- */
.dv-page { --lma: #0B348C; --lma-soft: #E8EEFA; }
:root[data-theme=dark] .dv-page { --lma: #8FB0FF; --lma-soft: rgba(80,120,230,.18); }
.dv { max-width: 1240px; display: flex; flex-direction: column; gap: 18px; padding-top: 18px; }
.dv-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.dv-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
.dv-brand h1 { margin: 0; font-size: 28px; font-weight: 650; letter-spacing: -0.03em; }
.dv-logo { flex: none; height: 56px; width: auto; padding: 8px 12px; border-radius: 12px; background: #FFFFFF; border: 1px solid var(--line); }
.dv-top-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dv .btn { border-radius: 10px; }
.dv .btn.primary, .dv-dialog .btn.primary { background: var(--lma); box-shadow: none; }
:root[data-theme=dark] .dv .btn.primary, :root[data-theme=dark] .dv-dialog .btn.primary { color: #0F0E17; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn.danger { color: var(--err); }

.dv-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.dv-kpis[hidden] { display: none; }
.dv-kpi { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; min-width: 0; }
.dv-kpi + .dv-kpi { border-left: 1px solid var(--line); }
.dv-kpi span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dv-kpi b { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dv-kpi small { font-size: 12px; color: var(--muted); }

.dv-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); }
.dv-tabs[hidden] { display: none; }
.dv-tabs button { padding: 10px 2px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 600; font-size: 15px; }
.dv-tabs button[aria-selected=true] { color: var(--fg); border-bottom-color: var(--lma); }
.dv-tabs button:hover { color: var(--fg); }

.dv-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.dv-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dv-search { flex: 1 1 280px; max-width: 440px; }
.dv-search input { width: 100%; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--input-bg); color: var(--fg); font: inherit; box-sizing: border-box; }
.dv-search input:focus { outline: none; border-color: var(--lma); box-shadow: 0 0 0 3px var(--lma-soft); }
.dv-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.dv-filter { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; }
.dv-filter span { min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--row-line); font-size: 11.5px; text-align: center; }
.dv-filter[aria-checked=true] { border-color: var(--lma); background: var(--lma-soft); color: var(--lma); }

.dv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.dv-table th { padding: 8px 10px; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.dv-table td { padding: 12px 10px; border-bottom: 1px solid var(--row-line); vertical-align: middle; }
.dv-table tbody tr { cursor: pointer; }
.dv-table tbody tr:hover, .dv-table tbody tr:focus-visible { background: var(--row-line); outline: none; }
.dv-table tr:last-child td { border-bottom: 0; }
.dv-num { font: 600 13px var(--mono); white-space: nowrap; color: var(--lma); }
.dv-who b { display: block; font-weight: 600; }
.dv-who small, .dv-date { color: var(--muted); font-size: 12.5px; }
.dv-obj { color: var(--muted); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-amount { font-weight: 650; }
.dv-row-acts { text-align: right; }
.sr-th { font-size: 0 !important; }
.dv-none td { padding: 24px; text-align: center; color: var(--muted); cursor: default; }
.num { text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dim { color: var(--muted); }
.dv-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--row-line); color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.dv-chip.envoye { background: var(--bleu); color: var(--blue-fg); }
.dv-chip.accepte { background: var(--vert); color: var(--green-fg); }
.dv-chip.refuse { background: var(--rose); color: var(--pink-fg); }
.dv-chip.emise { background: var(--bleu); color: var(--blue-fg); }
.dv-chip.payee { background: var(--vert); color: var(--green-fg); }
.dv-chip.retard { background: var(--rose); color: var(--pink-fg); }
.dv-empty { padding: 26px; text-align: center; color: var(--muted); list-style: none; }
.dv-empty p { margin: 0 0 6px; }
.dv-empty .btn { margin-top: 8px; }

/* éditeur */
.dv-editor { display: flex; flex-direction: column; gap: 14px; }
.dv-editor[hidden] { display: none; }
.dv-ed-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.dv-ed-title { display: flex; align-items: center; gap: 10px; }
.dv-ed-title h2 { margin: 0; font-size: 22px; font-weight: 650; letter-spacing: -0.02em; }
.dv-ed-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.dv-ed-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dv-ed-side { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 12px; }
.dv-sec { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 15px; font-weight: 650; }
.dv-sec span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--lma-soft); color: var(--lma); font-size: 12.5px; }
.dv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.dv-grid .dv-wide { grid-column: 1 / -1; }
.dv-grid > [hidden] { display: none; }
.dv-lines :disabled, .dv .field :disabled { opacity: .75; cursor: default; }
.dv .field, .dv-dialog .field { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dv .field input, .dv .field select, .dv .field textarea, .dv-dialog .field input, .dv-dialog .field select, .dv-dialog .field textarea {
  display: block; width: 100%; margin-top: 5px; padding: 9px 11px; border-radius: 9px; border: 1px solid var(--line); background: var(--input-bg);
  color: var(--fg); font: inherit; font-size: 15px; font-weight: 400; box-sizing: border-box; }
.dv .field :is(input, select, textarea):focus, .dv-dialog .field :is(input, select, textarea):focus { outline: none; border-color: var(--lma); box-shadow: 0 0 0 3px var(--lma-soft); }
.dv textarea, .dv-dialog textarea { resize: vertical; }
.dv-client-pick { display: flex; gap: 8px; align-items: flex-end; }
.dv-client-pick .field { flex: 1; min-width: 0; }
.dv-client-pick .field select { margin-top: 0; }
.dv-client-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: 10px; background: var(--lma-soft); }
.dv-client-card > div:first-child { display: grid; gap: 2px; font-size: 14px; }
.dv-client-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.dv-lines-wrap { overflow-x: auto; margin: 0 -6px; }
.dv-lines { width: 100%; border-collapse: collapse; font-size: 14px; }
.dv-lines th { padding: 0 6px 8px; text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); white-space: nowrap; }
.dv-lines td { padding: 8px 6px; border-bottom: 1px solid var(--row-line); vertical-align: top; }
.dv-lines td.dv-d { width: 100%; min-width: 220px; }
.dv-lines :is(input, select, textarea) { width: 100%; padding: 7px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--input-bg); color: var(--fg); font: inherit; font-size: 14px; box-sizing: border-box; }
.dv-lines :is(input, select, textarea):focus { outline: none; border-color: var(--lma); }
.dv-lines textarea { resize: none; overflow: hidden; line-height: 1.4; }
.dv-lines [data-k=q] { width: 64px; text-align: right; }
.dv-lines [data-k=u] { width: 70px; }
.dv-lines [data-k=p] { width: 100px; text-align: right; }
.dv-lines select { width: 80px; }
.dv-lt { padding-top: 15px !important; font-weight: 600; }
.dv-x { width: 32px; }
.dv-del { width: 30px; height: 34px; color: var(--muted); }
.dv-del:hover { color: var(--err); }
.franchise .tva-col { display: none; }
.dv-add { margin-top: 12px; }

.dv-summary h3, .dv-send h3 { margin: 0 0 12px; font-size: 13px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.dv-totals { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; margin: 0 0 14px; }
.dv-totals dt { color: var(--muted); font-size: 14px; }
.dv-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.dv-totals .big { padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--line); font-size: 20px; font-weight: 700; color: var(--lma); }
.dv-totals dt.big { font-size: 15px; align-self: end; }
.dv-saved { margin: 8px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.btn.wide { width: 100%; }
.dv-send { display: grid; gap: 6px; }
.dv-act { display: grid; gap: 1px; width: 100%; padding: 10px 12px; text-align: left; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); }
.dv-act:hover { border-color: var(--lma); background: var(--lma-soft); }
.dv-act b { font-size: 14px; font-weight: 600; }
.dv-act small { font-size: 12px; color: var(--muted); }
.dv-act[hidden] { display: none; }
.dv-more { display: flex; justify-content: space-between; gap: 8px; padding: 12px 18px; }

/* clients */
.dv-clients { list-style: none; margin: 0; padding: 0; display: grid; }
.dv-client { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--row-line); }
.dv-client:last-child { border-bottom: 0; }
.dv-client .avatar { flex: none; width: 40px; height: 40px; font-size: 16px; }
.dv-client-info { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 14px; }
.dv-client-info span { overflow-wrap: anywhere; }
.dv-client .dv-chip { flex: none; }

/* fenêtres */
.dv-dialog { width: min(640px, calc(100vw - 24px)); max-height: 92vh; padding: 0 20px 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-solid); color: var(--fg); box-shadow: var(--shadow-ui); }
.dv-dialog.small { width: min(440px, calc(100vw - 24px)); }
.dv-dialog::backdrop { background: rgba(15,14,23,.5); }
.dv-dialog header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; margin: 0 -20px 16px; padding: 14px 20px; background: var(--surface-solid); border-bottom: 1px solid var(--line); }
.dv-dialog h2 { margin: 0; font-size: 18px; font-weight: 650; }
.dv-dialog .err { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--rose); color: var(--pink-fg); font-weight: 600; }
.dv-dialog .hint { color: var(--muted); font-size: 13px; }
.dv-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.dv-actions .btn.danger { margin-left: auto; }
.dv-attach { margin: 14px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--lma-soft); font-size: 14px; font-weight: 600; }

/* page Imprimer : arrivée depuis une fiche client */
.env-from-client { box-shadow: 0 0 0 3px var(--accent); }

@media (max-width: 1000px) {
  .dv-ed-layout { grid-template-columns: minmax(0, 1fr); }
  .dv-ed-side { position: static; }
}
@media (max-width: 760px) {
  .dv { gap: 14px; padding-top: 10px; }
  .dv-brand h1 { font-size: 23px; }
  .dv-logo { height: 44px; }
  .dv-top-actions { width: 100%; }
  .dv-top-actions .btn { flex: 1; }
  .dv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dv-kpi { padding: 12px 14px; }
  .dv-kpi:nth-child(3) { border-left: 0; }
  .dv-kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .dv-kpi b { font-size: 19px; }
  .dv-panel { padding: 14px; }
  /* liste des devis : une carte par devis */
  .dv-table thead { display: none; }
  .dv-table, .dv-table tbody { display: block; }
  .dv-table tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px 4px; border-bottom: 1px solid var(--row-line); }
  .dv-table td { padding: 0; border: 0; }
  .dv-num { grid-column: 1; }
  .dv-st { grid-column: 2; grid-row: 1; text-align: right; }
  .dv-who { grid-column: 1 / -1; }
  .dv-obj { grid-column: 1 / -1; max-width: none; font-size: 13px; }
  .dv-date { grid-column: 1; }
  .dv-amount { grid-column: 2; grid-row: 4; }
  .dv-row-acts { display: none; }
  /* lignes du devis : une carte par ligne */
  .dv-lines thead { display: none; }
  .dv-lines, .dv-lines tbody { display: block; }
  .dv-lines tr { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line); position: relative; }
  .dv-lines td { padding: 0; border: 0; }
  .dv-lines td.dv-d { grid-column: 1 / -1; min-width: 0; padding-right: 36px; }
  .dv-lines td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-align: left; }
  .dv-lines [data-k] { width: 100% !important; }
  .dv-lt { grid-column: 1 / -1; padding-top: 0 !important; }
  .dv-x { position: absolute; top: 10px; right: 0; }
  .dv-client { flex-wrap: wrap; }
  .dv-client-acts { width: 100%; padding-left: 54px; }
}

/* Devis : fiches d'identifiants des clients */
.dv-showpw { margin: 0 0 10px; font-weight: 500; }
.dv-acc-lines td, .dv-acc-lines td.dv-d { width: 25%; min-width: 130px; }
.dv-acc-lines td.dv-x { width: 32px; min-width: 0; }
.dv-acc-lines [data-k=i], .dv-acc-lines [data-k=m] { font-family: Consolas, ui-monospace, monospace; }
@media (max-width: 760px) {
  .dv-acc-lines tr { grid-template-columns: 1fr 1fr; }
  .dv-acc-lines td, .dv-acc-lines td.dv-d { width: auto; min-width: 0; }
  .dv-acc-lines td:nth-child(4) { grid-column: 1 / -1; }
}

/* Devis sur téléphone (≤ 700 px) : accueil en cartes, listes en cartes, barre d'actions collée en bas.
   Hors téléphone, l'accueil et les barres restent cachés : l'ordinateur ne change pas. */
.dv-hub-view, .dv-mbar, .dv-bar { display: none; }
@media (max-width: 700px) {
  .dv-top-actions, .dv-tabs, .dv-kpis { display: none; }
  .dv:not([data-v=hub]) .dv-top { display: none; }
  .dv-hub-view:not([hidden]) { display: block; }
  .dv-hub { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .dv-card { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 3px; min-height: 104px; padding: 14px; border-radius: 16px;
    border: 1px solid var(--line); background: var(--surface); color: var(--fg); text-align: left; font: inherit; min-width: 0; }
  .dv-card:active { background: var(--lma-soft); }
  .dv-card:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 88px; }
  .dv-card-ic { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 6px; border-radius: 12px; background: var(--lma-soft); color: var(--lma); }
  .dv-card b { font-size: 16px; font-weight: 650; }
  .dv-card small { font-size: 12.5px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
  .dv-hub-new { margin-top: 14px; min-height: 50px; font-size: 16px; }
  /* en-tête collant d'une rubrique */
  .dv:not([data-v=hub]):not([data-v=editor]):not([data-v=acc]) .dv-mbar { display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 5; padding: 8px 0; background: var(--bg); }
  .dv-mbar h2 { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -0.02em; }
  .dv-mback { min-height: 44px; padding: 0 14px 0 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--lma); font: inherit; font-weight: 650; }
  /* listes en cartes */
  #v-list, #v-factures, #v-clients, #v-acces { padding: 0; border: 0; background: none; }
  .dv-toolbar { margin-bottom: 12px; }
  .dv-search { flex-basis: 100%; max-width: none; }
  .dv-table tbody tr { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px; min-height: 56px; margin-bottom: 10px; padding: 12px 14px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .dv-table tr:last-child td { border: 0; }
  .dv-who { grid-column: 1 / 3; grid-row: 1; }
  .dv-amount { grid-column: 3; grid-row: 1; font-size: 18px; text-align: right; }
  .dv-num { grid-column: 1; grid-row: 2; font-size: 12px; }
  .dv-date { grid-column: 2; grid-row: 2; }
  .dv-st { grid-column: 3; grid-row: 2; text-align: right; }
  .dv-obj { grid-column: 1 / -1; grid-row: 3; }
  .dv-obj.none { display: none; }
  .dv-table tbody tr.dv-none { display: block; padding: 18px; text-align: center; }
  .dv-clients { gap: 10px; }
  .dv-client { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .dv-client:last-child { border-bottom: 1px solid var(--line); }
  .dv-client-acts { padding-left: 0; }
  .dv-client-acts .btn { min-height: 40px; }
  /* barre d'actions des éditeurs, au-dessus de la barre de navigation du téléphone */
  .dv-bar { display: flex; gap: 8px; position: sticky; bottom: calc(100px + env(safe-area-inset-bottom)); z-index: 6; padding: 8px; border: 1px solid var(--line);
    border-radius: 16px; background: var(--surface-solid); box-shadow: var(--shadow-ui); }
  .dv-bar .btn { flex: 1; min-height: 46px; }
  .dv-bar .btn.primary { flex: 1.5; }
  .dv-bar [hidden] { display: none; }
}

/* Rappels personnels (2026-10-14) */
.rp { max-width: 760px; }
.rp-form { width: 100%; max-height: none; }
.rp-form h2, .rp-h2 { margin: 0 0 12px; font-size: 17px; }
.rp-form h2 { margin: 0; }
.rp-warn { margin: 0; font-size: 14px; }
.rp-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; padding: 12px 14px;
  border-radius: 14px; background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-left: 5px solid var(--accent); }
.rp-item.done { opacity: .6; border-left-color: var(--muted); }
.rp-item.hl { box-shadow: 0 0 0 2px var(--accent); }
.rp-body { display: grid; gap: 3px; min-width: 0; flex: 1 1 220px; }
.rp-body strong { font-size: 16px; overflow-wrap: anywhere; }
.rp-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.rp-acts .btn { min-height: 44px; padding: 0 14px; font-size: 14px; }
.rp-acts .rp-del { color: var(--err); }
.rp-form { overflow: visible; }
@media (max-width: 560px) { .rp-form .ag-row > .ag-field { flex-basis: 100%; } }
.rp .rp-form { border-radius: 24px; max-height: none; padding-bottom: 20px; }
/* Choix des pages + suivi d'impression (2026-10-14) */
.drop.loading { opacity: .7; pointer-events: none; }
.pick { display: grid; gap: 10px; margin: 12px 0 4px; }
.pick[hidden] { display: none; }
.pick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pick-btns { display: flex; gap: 8px; }
.pick-btns .btn { min-height: 44px; padding: 0 16px; font-size: 14px; }
.pick-err { color: var(--err); font-size: 13px; font-weight: 600; }
.pick-err[hidden] { display: none; }
.pick-field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pick-field input { min-height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--input-line, var(--line)); background: var(--input-bg); color: var(--fg); font: 500 16px var(--font); }
.pick-field input:focus { outline: none; border-color: var(--accent); }
.pick-field input[aria-invalid] { border-color: var(--err); }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; padding: 2px; }
.pick-page { position: relative; display: grid; border-radius: 10px; border: 2px solid var(--line); background: #fff; overflow: hidden; cursor: pointer;
  touch-action: manipulation; transition: border-color .15s ease-out, opacity .15s ease-out; }
.pick-page:active { transform: scale(.97); }
.pick-page img { width: 100%; height: auto; display: block; aspect-ratio: 210 / 297; object-fit: contain; }
.pick-page input { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.pick-page span { position: absolute; right: 6px; bottom: 6px; min-width: 24px; padding: 1px 6px; border-radius: 999px; background: rgba(15,14,23,.75); color: #fff; font: 600 12px var(--mono, monospace); text-align: center; }
.pick-page:has(input:checked) { border-color: var(--accent); }
.pick-page:not(:has(input:checked)) { opacity: .45; }
.pick-page:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.print-progress .pp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.print-progress .pp-big { font-size: 20px; font-variant-numeric: tabular-nums; }
.print-progress .pp-eta { color: var(--muted); font-size: 13px; }
/* Pastille d'impression : en bas à droite (ordinateur), au-dessus de la barre d'onglets (téléphone) : ne cache ni l'en-tête ni le contenu */
.fh-printbar { position: fixed; z-index: 70; right: 20px; bottom: max(20px, env(safe-area-inset-bottom)); width: min(380px, calc(100% - 24px));
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 6px 10px; min-height: 52px; padding: 10px 14px; border-radius: 14px;
  background: var(--surface); color: var(--fg); text-decoration: none; touch-action: manipulation;
  border: 1px solid var(--card-border, var(--line)); box-shadow: var(--shadow-ui, 0 10px 30px rgba(0,0,0,.15)); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fh-printbar[hidden] { display: none; }
.fh-printbar:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.fh-printbar svg { grid-row: span 2; color: var(--accent); }
.fh-printbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fh-printbar i { display: block; height: 6px; border-radius: 999px; background: var(--input-bg); overflow: hidden; }
.fh-printbar b { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease-out; }
.fh-printbar.done b { background: var(--ok); }
.fh-printbar.done svg { color: var(--ok); }
.fh-printbar.error { border-color: var(--err); }
.fh-printbar.error b { background: var(--err); }
.fh-printbar.error svg { color: var(--err); }
@media (max-width: 760px) { .fh-printbar { left: 12px; right: 12px; width: auto; bottom: calc(100px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .fh-printbar b, .print-progress .pp-bar b, .pick-page { transition: none; } .pick-page:active { transform: none; } }