/* Au Chaudron Fleuri — thème « parchemin » (clair) et « nuit violette » (sombre) */
:root {
  --bg: #f7f1e6; --bg-2: #efe6d6; --surface: #fffdf9; --surface-2: #f6efe3; --line: #e6dccb; --line-2: #d9ccb5;
  --ink: #2b1f33; --muted: #6e6375; --faint: #9b90a0;
  --plum: #5d356f; --plum-2: #7a4f8f; --plum-soft: #efe5f3; --on-plum: #fff;
  --gold: #8f6a1f; --gold-bg: #d8b65d; --gold-soft: #f6ecd2; --on-gold: #2a1d05;
  --leaf: #2f6b4f; --leaf-soft: #e2efe5; --rose: #a83d56; --rose-soft: #f8e4e8; --sky: #3b6589; --sky-soft: #e3edf5;
  --warn: #9a5b00; --warn-soft: #fff3dc;
  --shadow: 0 1px 2px rgba(43, 31, 51, .06), 0 8px 24px rgba(43, 31, 51, .07);
  --shadow-lg: 0 24px 60px rgba(30, 18, 40, .28);
  --r: 16px; --r-sm: 11px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --side: 268px; --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #160e1d; --bg-2: #1d1326; --surface: #22172d; --surface-2: #2a1d37; --line: #3a2b47; --line-2: #4a3859;
    --ink: #f4eee6; --muted: #c1b6ca; --faint: #8f8299;
    --plum: #b78ccb; --plum-2: #cba6dc; --plum-soft: #34233f; --on-plum: #1a0f22;
    --gold: #e2c26f; --gold-bg: #d8b65d; --gold-soft: #3a2f17; --on-gold: #21180a;
    --leaf: #8fc59d; --leaf-soft: #20332a; --rose: #e98ba0; --rose-soft: #3b1f29; --sky: #8fb6d8; --sky-soft: #1d2b39;
    --warn: #f0c060; --warn-soft: #3a2c12;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #160e1d; --bg-2: #1d1326; --surface: #22172d; --surface-2: #2a1d37; --line: #3a2b47; --line-2: #4a3859;
  --ink: #f4eee6; --muted: #c1b6ca; --faint: #8f8299;
  --plum: #b78ccb; --plum-2: #cba6dc; --plum-soft: #34233f; --on-plum: #1a0f22;
  --gold: #e2c26f; --gold-bg: #d8b65d; --gold-soft: #3a2f17; --on-gold: #21180a;
  --leaf: #8fc59d; --leaf-soft: #20332a; --rose: #e98ba0; --rose-soft: #3b1f29; --sky: #8fb6d8; --sky-soft: #1d2b39;
  --warn: #f0c060; --warn-soft: #3a2c12;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 70px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); min-height: 100vh; min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(circle at 8% -10%, color-mix(in srgb, var(--plum) 14%, transparent), transparent 38%), radial-gradient(circle at 105% 0%, color-mix(in srgb, var(--leaf) 12%, transparent), transparent 35%); }
a { color: var(--plum); }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; letter-spacing: .005em; }
h3 { font-size: 1.12rem; margin: 0 0 12px; color: var(--plum); }
.muted { color: var(--muted); } .small { font-size: .85rem; } .hide { display: none !important; } .center { text-align: center; } .r { text-align: right; }
.prewrap { white-space: pre-wrap; }
.ic { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

/* ---------- Coquille ---------- */
.side { display: none; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: calc(8px + var(--safe-t)) 14px 8px; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.top-brand img { width: 44px; height: 36px; object-fit: contain; display: block; }
#page-name { flex: 1; font-family: var(--serif); font-size: 1.12rem; color: var(--plum); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .78rem; text-decoration: none; white-space: nowrap; }
.sync i { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.sync.ok i { background: #3fae6a; box-shadow: 0 0 0 3px color-mix(in srgb, #3fae6a 22%, transparent); }
.sync.busy i { background: #e0a930; } .sync.off i { background: var(--faint); } .sync.err i { background: #d9485f; }
.sync.local i { background: var(--sky); }
@media (max-width: 420px) { .sync span { display: none; } .sync { padding: 9px; } }
main { padding: 16px 14px calc(var(--tab-h) + 28px + var(--safe-b)); max-width: 1180px; margin: 0 auto; outline: none; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; }
.tabbar a.on { color: var(--plum); }
.tabbar a.on .ic { background: var(--plum-soft); border-radius: 12px; padding: 3px 14px; width: 54px; height: 30px; stroke-width: 1.9; }
body.gated .tabbar, body.gated .topbar, body.gated .side { display: none !important; }
body.gated main { padding-bottom: 30px; }

@media (min-width: 900px) {
  #app { display: grid; grid-template-columns: var(--side) 1fr; }
  .side { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; padding: 18px 14px 24px; background: var(--surface); border-right: 1px solid var(--line); }
  .topbar, .tabbar { display: none; }
  main { grid-column: 2; width: 100%; padding: 26px clamp(20px, 3vw, 44px) 60px; }
  body.gated #app { display: block; }
}
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 6px 18px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.brand img { width: 108px; height: 86px; object-fit: contain; filter: drop-shadow(0 6px 12px rgba(60, 30, 80, .15)); }
.brand b { font-family: var(--serif); font-size: 1.22rem; color: var(--plum); margin-top: 6px; }
.brand small { color: var(--muted); font-size: .8rem; }
.nav-group { margin: 6px 0 10px; }
.nav-title { display: flex; align-items: center; gap: 8px; padding: 8px 10px 4px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); text-decoration: none; }
.nav-item { display: flex; align-items: center; gap: 11px; padding: 8px 11px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: .93rem; }
.nav-item .ic { color: var(--muted); }
.nav-item:hover { background: var(--surface-2); }
.nav-item.on { background: var(--plum-soft); color: var(--plum); font-weight: 650; }
.nav-item.on .ic { color: var(--plum); }
.nav-item.top { font-weight: 600; margin: 2px 0; }

/* ---------- En-tête de page ---------- */
.page-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin: 2px 0 14px; }
.page-title { flex: 1 1 260px; min-width: 0; }
.page-title h1 { margin: 0; font-size: clamp(1.5rem, 4.2vw, 2.1rem); color: var(--ink); }
.page-title p { margin: 4px 0 0; color: var(--muted); font-size: .93rem; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.icon-btn.back { margin-top: 2px; }
@media (max-width: 640px) {
  .page-actions { width: 100%; }
  .page-actions .btn.primary, .page-actions .btn.gold { flex: 1; }
}

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid transparent; font-weight: 650; font-size: .95rem; text-decoration: none; white-space: nowrap; transition: transform .08s, background .15s, box-shadow .15s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn.primary { background: var(--plum); color: var(--on-plum); box-shadow: 0 6px 16px color-mix(in srgb, var(--plum) 30%, transparent); }
.btn.primary:hover { background: var(--plum-2); }
.btn.gold { background: linear-gradient(135deg, #b08a35, var(--gold-bg)); color: var(--on-gold); box-shadow: 0 6px 16px rgba(176, 138, 53, .3); }
.btn.ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.glass { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); color: #fff; backdrop-filter: blur(6px); }
.btn.danger { background: var(--rose); color: #fff; }
.btn.danger-text { color: var(--rose); }
.btn.link { background: none; border: 0; color: var(--plum); text-decoration: underline; min-height: 36px; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .86rem; border-radius: 10px; }
.btn.big { min-height: 52px; font-size: 1.02rem; padding: 12px 22px; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.icon-btn:hover { background: var(--surface-2); }
.actions { display: flex; gap: 8px; align-items: center; }
.actions.wrap { flex-wrap: wrap; } .actions.end { justify-content: flex-end; margin-top: 16px; }

/* ---------- Accueil ---------- */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: clamp(20px, 4vw, 38px); min-height: 220px; color: #fff; background: linear-gradient(125deg, #4a2a5c 0%, #5d356f 45%, #2f5d45 100%); box-shadow: var(--shadow); isolation: isolate; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: url(img/decor.webp) right -60px bottom -40px / min(640px, 75%) no-repeat; opacity: .14; }
.hero-text { position: relative; z-index: 1; max-width: min(calc(100% - min(20%, 150px) - 16px), 600px); }
.hero { min-height: 0; }
.eyebrow { display: inline-block; padding: 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .14); font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #f5dfa0; }
.hero h1 { margin: 10px 0 4px; font-size: clamp(1.7rem, 5vw, 2.7rem); color: #f7e3a6; }
.hero p { margin: 0; color: #eadff0; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
/* portrait de Sophie : discret, fondu dans le fond violet */
.hero-art { position: absolute; right: clamp(6px, 3vw, 40px); top: 50%; transform: translateY(-50%); width: min(20%, 150px); height: auto; opacity: .5; mix-blend-mode: screen; -webkit-mask-image: radial-gradient(ellipse 62% 60% at 50% 46%, #000 45%, transparent 78%); mask-image: radial-gradient(ellipse 62% 60% at 50% 46%, #000 45%, transparent 78%); pointer-events: none; }
@media (max-width: 640px) {
  .hero { min-height: 0; padding-bottom: 20px; }
  .hero-text { max-width: 100%; }
  .hero h1 { max-width: 68%; }
  .hero-art { width: 66px; top: 6px; transform: none; right: 4px; opacity: .4; }
  /* bandeau compact : une ligne de titre + une ligne de 3 boutons */
  .hero { padding: 12px 14px 12px; border-radius: 18px; }
  .hero .eyebrow { display: none; }
  .hero h1 { margin: 0; font-size: 1.4rem; max-width: calc(100% - 70px); }
  .hero p { font-size: .82rem; max-width: calc(100% - 70px); }
  .hero-actions { margin-top: 10px; gap: 6px; flex-wrap: nowrap; }
  .hero-actions .btn { flex: 1 1 0; min-height: 40px; padding: 7px 6px; font-size: .84rem; gap: 5px; }
  .hero-actions .btn .ic { width: 17px; height: 17px; }
  .hero-actions .btn { flex: 1 1 auto; }
}
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0; }
.metric { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.metric small { color: var(--muted); font-size: .8rem; }
.metric b { font-size: 1.5rem; font-family: var(--serif); color: var(--ink); }
.metric.accent b { color: var(--gold); }
@media (max-width: 760px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .metric { padding: 13px; } .metric b { font-size: 1.25rem; } }
.calm { display: flex; align-items: center; gap: 8px; color: var(--leaf); margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); margin-bottom: 14px; min-width: 0; }
.panel h3 + .list, .panel h3 + .table-wrap { margin-top: 4px; }
.panel .list + h3 { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h3 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.grid-2 > .panel { margin-bottom: 0; }
.grid-2 + .panel, .grid-2 + section { margin-top: 14px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.panel.deco { margin-top: 14px; }

/* ---------- Tuiles des espaces ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: transform .12s, border-color .12s; }
.tile:hover { transform: translateY(-2px); border-color: var(--plum-2); }
.tile-ic { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: var(--plum-soft); color: var(--plum); margin-bottom: 6px; }
.tile b { font-family: var(--serif); font-size: 1.12rem; }
.tile small { color: var(--muted); }
.tile-count { position: absolute; top: 16px; right: 16px; font-size: .76rem; font-weight: 700; color: var(--leaf); background: var(--leaf-soft); padding: 3px 9px; border-radius: 99px; }
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr 1fr; gap: 10px; } .tile { padding: 14px; } .tile small { display: none; } .tile-count { position: static; align-self: flex-start; margin-top: 6px; } .tile-ic { width: 44px; height: 44px; } }

/* ---------- Barres d'outils, puces, filtres ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -14px 12px; padding: 2px 14px 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: .86rem; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--plum); color: var(--on-plum); border-color: var(--plum); }
@media (min-width: 900px) { .chips { display: none; } }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.search { flex: 1 1 240px; display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 44px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--ink); font-size: 16px; padding: 10px 0; }
.search:focus-within { border-color: var(--plum); box-shadow: 0 0 0 3px color-mix(in srgb, var(--plum) 18%, transparent); }
.seg { display: inline-flex; gap: 3px; padding: 3px; background: var(--bg-2); border-radius: 12px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { border: 0; background: none; padding: 8px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: .86rem; white-space: nowrap; min-height: 36px; }
.seg button.on { background: var(--surface); color: var(--plum); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.seg.full { display: flex; width: 100%; margin-bottom: 14px; } .seg.full button { flex: 1; }
.dates { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .88rem; }
.dates label { display: flex; align-items: center; gap: 6px; }
.dates input { min-height: 42px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.sum-pill { margin-left: auto; padding: 8px 14px; border-radius: 99px; background: var(--gold-soft); color: var(--ink); font-size: .9rem; }

/* ---------- Listes ---------- */
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.panel .list, .sheet .list { box-shadow: none; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; color: inherit; text-decoration: none; min-height: 60px; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row:active { background: var(--bg-2); }
.row-ic { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px; background: var(--plum-soft); color: var(--plum); }
.row-img { width: 46px; height: 46px; flex: none; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-main b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.row-main small { color: var(--muted); font-size: .84rem; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.row-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; text-align: right; max-width: 40%; }
.row-right b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.row-right small { color: var(--muted); font-size: .78rem; white-space: nowrap; }
.row.faded { opacity: .55; }
.row.warn .row-ic { background: var(--warn-soft); color: var(--warn); }
.row-time { flex: none; width: 58px; padding: 6px 0 6px 10px; border-left: 4px solid var(--c, var(--plum)); font-weight: 700; display: flex; flex-direction: column; line-height: 1.2; }
.row-time small { color: var(--muted); font-weight: 500; font-size: .78rem; }
.group { margin-bottom: 16px; }
.group-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 2px 8px; font-size: 1.02rem; color: var(--ink); }
.group-title .ic { color: var(--leaf); align-self: center; }
.group-title small { font-family: var(--sans); font-weight: 500; font-size: .82rem; color: var(--muted); }
.tag { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 99px; background: var(--plum-soft); color: var(--plum); font-size: .72rem; font-weight: 750; letter-spacing: .02em; white-space: nowrap; }
.tag.leaf { background: var(--leaf-soft); color: var(--leaf); } .tag.gold { background: var(--gold-soft); color: var(--gold); }
.tag.rose { background: var(--rose-soft); color: var(--rose); } .tag.sky { background: var(--sky-soft); color: var(--sky); }
.empty { text-align: center; padding: 46px 18px; border: 1.5px dashed var(--line-2); border-radius: var(--r); color: var(--muted); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.empty .ic { color: var(--faint); }
.empty p { margin: 10px 0 16px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--plum-soft); color: var(--ink); margin: 0 0 14px; font-size: .92rem; line-height: 1.45; }
.notice .ic { color: var(--plum); margin-top: 1px; }
.notice.warn { background: var(--warn-soft); } .notice.warn .ic { color: var(--warn); }
.hint { display: block; color: var(--muted); font-size: .82rem; margin: 4px 0 0; }
.warn-text { color: var(--warn); }

/* ---------- Cartes recettes ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); text-decoration: none; color: inherit; transition: transform .12s; }
.card:hover { transform: translateY(-2px); }
.card-visual { height: 120px; display: grid; place-items: center; background: linear-gradient(135deg, var(--plum-soft), var(--leaf-soft)); }
.card-visual img { width: 100%; height: 100%; object-fit: cover; }
.card-visual.rose { background: linear-gradient(135deg, var(--rose-soft), var(--plum-soft)); }
.card-visual.gold { background: linear-gradient(135deg, var(--gold-soft), var(--rose-soft)); }
.card-visual.leaf { background: linear-gradient(135deg, var(--leaf-soft), var(--gold-soft)); }
.card-visual.sky { background: linear-gradient(135deg, var(--sky-soft), var(--leaf-soft)); }
.art { font-size: 48px; filter: saturate(.9); }
.card-visual img.art-img { width: auto; height: 80%; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(60, 30, 80, .18)); }
.recipe-visual img.art-img { width: auto; height: 170px; max-width: 90%; object-fit: contain; }
.art.big { font-size: 96px; }
.card-body { padding: 13px 15px 16px; }
.card-body h3 { margin: 7px 0 4px; color: var(--ink); font-size: 1.1rem; }
.card-body p { margin: 0; color: var(--muted); font-size: .86rem; }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr 1fr; gap: 10px; } .card-visual { height: 92px; } .card-body { padding: 10px 12px 13px; } .card-body h3 { font-size: .98rem; } .card-body p { font-size: .78rem; } }

/* ---------- Fiche recette ---------- */
.recipe-top { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: 16px; margin-bottom: 14px; }
.recipe-visual { border-radius: var(--r); min-height: 200px; display: grid; place-items: center; overflow: hidden; background: linear-gradient(135deg, var(--plum-soft), var(--leaf-soft)); border: 1px solid var(--line); }
.recipe-visual img { width: 100%; height: 100%; object-fit: cover; }
.recipe-facts { display: flex; flex-direction: column; gap: 12px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.facts > div { padding: 11px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.facts small { display: block; color: var(--muted); font-size: .74rem; }
.facts b { font-size: .98rem; overflow-wrap: anywhere; }
@media (max-width: 760px) { .recipe-top { grid-template-columns: 1fr; } .recipe-visual { min-height: 130px; } .recipe-visual img.art-img { height: 120px; } .facts { grid-template-columns: 1fr 1fr; } }
.scale { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .9rem; }
.scale input { width: 80px; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); }
.steps { display: flex; flex-direction: column; gap: 8px; }
.step { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 10px 12px; border-radius: 11px; background: var(--surface-2); }
.step span { color: var(--gold); font-weight: 650; }
.step small { width: 100%; color: var(--muted); }
.grimoire p { font-family: var(--serif); font-size: 1.06rem; line-height: 1.75; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; white-space: nowrap; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 12px; }
.dl dt { color: var(--muted); font-size: .86rem; } .dl dd { margin: 0; }
@media (max-width: 520px) { .dl { grid-template-columns: 1fr; gap: 2px; } .dl dd { margin-bottom: 8px; } }
ul.plain { margin: 0; padding-left: 18px; }

/* ---------- Formulaires ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid, .form-grid.three { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.lbl { font-size: .8rem; font-weight: 700; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 11px; background: var(--surface); color: var(--ink); outline: none; font-size: 16px; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--plum); box-shadow: 0 0 0 3px color-mix(in srgb, var(--plum) 18%, transparent); }
input:disabled { opacity: .7; background: var(--surface-2); }
input[type=file] { font-size: .9rem; padding: 8px; border: 1px dashed var(--line-2); border-radius: 11px; background: var(--surface-2); width: 100%; }
input[type=color] { width: 56px; height: 46px; border: 1px solid var(--line-2); border-radius: 11px; padding: 4px; background: var(--surface); }
.pair { display: flex; gap: 6px; } .pair > input { flex: 1.3; min-width: 0; } .pair > select { flex: 1; min-width: 86px; }
.pair2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); font-size: .92rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--plum); }
fieldset.block { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px 14px; margin: 0; min-width: 0; }
fieldset.block legend { font-family: var(--serif); font-weight: 700; color: var(--plum); padding: 0 6px; font-size: 1.02rem; }
.rep { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.rep-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.rep-row .field { flex: 1 1 120px; }
.rep-row .field.grow { flex: 2 1 180px; }
.rep-row .field.sm { flex: 1 1 90px; }
.rep-row .rm { width: 38px; height: 38px; margin-left: auto; }
.rep-row.fmt .field { flex: 1 1 130px; }
.rep-row.fmt .field:nth-of-type(2) { flex: 2 1 190px; }
.pair > input { min-width: 72px; }
.rep-row.ing .q { display: none; flex: 1.4 1 170px; }
.rep-row.ing[data-kind="fresh"] .k-fresh, .rep-row.ing[data-kind="dry"] .k-dry, .rep-row.ing[data-kind="intrant"] .k-other, .rep-row.ing[data-kind="other"] .k-other { display: flex; }
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; margin: 10px 0; }
.art-opt input { position: absolute; opacity: 0; pointer-events: none; }
.art-opt span { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: .72rem; text-align: center; cursor: pointer; }
.art-opt b { font-size: 26px; }
.art-opt input:checked + span { border-color: var(--gold-bg); background: var(--gold-soft); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold-bg) 40%, transparent); }
.img-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.img-pick img { width: 96px; height: 76px; object-fit: contain; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); padding: 4px; }
.img-pick input { flex: 1; min-width: 180px; }
.sticky-save { position: sticky; bottom: calc(var(--tab-h) + var(--safe-b) + 10px); display: flex; justify-content: flex-end; z-index: 5; }
@media (min-width: 900px) { .sticky-save { bottom: 16px; } }
.person .field.grow { flex: 3 1 160px; }

/* Lignes d'articles */
.lines { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.line { padding: 10px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.line-main, .line-nums { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.line-main .field { flex: 1 1 220px; }
.line-nums .field { flex: 1 1 96px; }
.line-nums .field:nth-child(5) { flex: 1.6 1 150px; }
.line-total { flex: none; min-width: 84px; text-align: right; font-weight: 700; padding-bottom: 12px; font-variant-numeric: tabular-nums; }
.totals-bar { display: flex; gap: 14px; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; font-size: .9rem; color: var(--muted); padding-bottom: 8px; width: 100%; }
.totals-bar b { color: var(--ink); font-variant-numeric: tabular-nums; }
.totals-bar .big b { font-size: 1.2rem; color: var(--plum); }
.foot-btns { display: flex; gap: 8px; justify-content: flex-end; width: 100%; flex-wrap: wrap; }

/* ---------- Labo ---------- */
.labo-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0 10px; }
.labo-head h3 { margin: 0; }
.labo-list { display: flex; flex-direction: column; gap: 10px; }
.labo-item { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(0, 2fr); gap: 12px; align-items: center; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.labo-need { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.labo-need strong { width: 100%; font-size: 1.15rem; color: var(--gold); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .labo-item { grid-template-columns: 1fr; } }

/* ---------- Convertisseur ---------- */
.conv-row { display: grid; grid-template-columns: 1.2fr 1fr auto 1fr; gap: 10px; align-items: end; }
.conv-row .icon-btn { margin-bottom: 2px; }
.conv-result { margin-top: 16px; padding: 22px; border-radius: 16px; text-align: center; font-family: var(--serif); font-size: clamp(1.8rem, 7vw, 2.6rem); color: var(--plum); background: linear-gradient(135deg, var(--plum-soft), var(--leaf-soft)); }
@media (max-width: 560px) { .conv-row { grid-template-columns: 1fr 1fr; } .conv-row > .field:first-child { grid-column: 1 / -1; } .conv-row .icon-btn { display: none; } }

/* ---------- Synthèse ---------- */
.bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.bar { display: grid; grid-template-columns: minmax(70px, 30%) 1fr auto; gap: 10px; align-items: center; font-size: .88rem; }
.bar-l { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-t { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-t i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--plum-2), var(--gold-bg)); }
.bar b { font-variant-numeric: tabular-nums; }

/* ---------- Documents (résumé) et clients ---------- */
.doc-summary { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.doc-summary h3 { margin: 6px 0 2px; color: var(--ink); }
.doc-summary p { margin: 0; }
.doc-summary .r { display: flex; flex-direction: column; align-items: flex-end; }
.doc-summary .big { font-size: 1.5rem; font-family: var(--serif); color: var(--plum); }
.doc-summary small { color: var(--muted); }
.client-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 10px; }
.client-logo { width: 72px; height: 72px; border-radius: 14px; object-fit: contain; background: #fff; border: 1px solid var(--line); padding: 4px; }
.checklist { display: flex; flex-direction: column; gap: 8px; }
.check-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--plum); }
.check-row span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.check-row small { color: var(--muted); }
.code-box { display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 14px; background: var(--gold-soft); margin: 10px 0 14px; }
.code-box b { font-size: 1.8rem; letter-spacing: .25em; font-family: ui-monospace, monospace; color: var(--ink); }

/* ---------- Agenda ---------- */
.agenda-bar { justify-content: space-between; }
.ag-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ag-nav input[type=date] { width: auto; min-height: 42px; }
.ag-label { margin: 0 0 10px; font-size: 1.15rem; text-transform: capitalize; color: var(--plum); }
.ag-scroll { max-height: min(70vh, 760px); overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); -webkit-overflow-scrolling: touch; }
.ag-day { display: grid; grid-template-columns: 54px repeat(var(--cols), minmax(150px, 1fr)); grid-template-rows: auto var(--h); position: relative; }
.ag-head { position: sticky; top: 0; z-index: 4; padding: 10px; font-weight: 700; background: var(--surface); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.ag-corner { border-left: 0; left: 0; z-index: 5; }
.ag-times { position: sticky; left: 0; z-index: 3; background: var(--surface); height: var(--h); }
.ag-times span { position: absolute; left: 8px; transform: translateY(-50%); font-size: .72rem; color: var(--muted); }
.ag-times span:first-child { transform: none; }
.ag-lane { position: relative; height: var(--h); border-left: 1px solid var(--line); cursor: copy; background: repeating-linear-gradient(to bottom, transparent 0, transparent 51px, var(--line) 51px, var(--line) 52px); }
.ag-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--rose); z-index: 2; }
.ag-now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--rose); }
.ag-ev { position: absolute; left: 4px; right: 4px; z-index: 3; overflow: hidden; padding: 5px 8px; border: 0; border-left: 4px solid var(--c); border-radius: 8px; background: color-mix(in srgb, var(--c) 18%, var(--surface)); color: var(--ink); text-align: left; font-size: .8rem; line-height: 1.25; box-shadow: 0 2px 6px rgba(0, 0, 0, .08); }
.ag-ev b, .ag-ev span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-ev span { color: var(--muted); font-size: .74rem; }
.ag-month { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.ag-wd { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2); font-size: .74rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.ag-wd span { padding: 8px; text-align: center; }
.ag-cells { display: grid; grid-template-columns: repeat(7, 1fr); }
.ag-cell { display: flex; flex-direction: column; gap: 2px; min-height: 96px; padding: 6px; border: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); background: none; text-align: left; overflow: hidden; min-width: 0; }
.ag-cell:nth-child(7n+1) { border-left: 0; }
.ag-cell.out { opacity: .4; }
.ag-cell .n { font-weight: 700; font-size: .86rem; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.ag-cell.today .n { background: var(--plum); color: var(--on-plum); }
.ag-cell i { display: block; font-style: normal; font-size: .7rem; padding: 1px 5px; border-radius: 5px; background: color-mix(in srgb, var(--c) 20%, transparent); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-cell small { font-size: .7rem; color: var(--muted); }
@media (max-width: 640px) { .ag-cell { min-height: 64px; padding: 4px; } .ag-cell i { font-size: 0; height: 6px; padding: 0; border-left-width: 0; background: var(--c); } }

/* ---------- Agenda tactile (modèle du salon) ---------- */
:root { --ppm: 1.15px; }
@media (min-width: 700px) { :root { --ppm: 1.3px; } }
.daybar { display: flex; align-items: center; gap: 8px; padding: 4px 0 10px; }
.datepick { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; cursor: pointer; }
.datepick b { font-family: var(--serif); font-size: 1.3rem; color: var(--ink); text-transform: capitalize; line-height: 1.15; }
.datepick small { color: var(--muted); font-size: .84rem; }
.datepick input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; min-height: 0 !important; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding-bottom: 10px; }
.week button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0 7px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-size: .72rem; text-transform: capitalize; }
.week button b { font-size: 1.08rem; color: var(--ink); }
.week button.today b { color: var(--rose); }
.week button.on { background: var(--plum); color: var(--on-plum); }
.week button.on b { color: var(--on-plum); }
.week .occ { display: flex; gap: 3px; height: 9px; align-items: center; }
.week .occ i { min-width: 7px; height: 7px; border-radius: 4px; background: var(--c); font-style: normal; font-size: 0; }
.seg.who { margin-left: auto; }
.agenda-home .seg.who { margin: 0 0 10px; }
.cols { display: grid; grid-template-columns: 36px repeat(var(--n), minmax(0, 1fr)); gap: 0 6px; }
.colhead { position: sticky; top: calc(56px + var(--safe-t)); z-index: 5; background: var(--bg); padding: 6px 0; display: flex; flex-direction: column; font-weight: 700; font-size: .9rem; color: var(--c); min-width: 0; }
.panel .colhead { background: var(--surface); }
@media (min-width: 900px) { .colhead { top: 0; } }
.colhead small { font-weight: 500; color: var(--muted); font-size: .76rem; }
.hours { position: relative; font-size: .7rem; color: var(--faint); }
.hours span { position: absolute; left: 0; transform: translateY(-50%); }
.hours span:first-child { transform: none; }
.lane { position: relative; border-radius: 10px; cursor: copy; background: repeating-linear-gradient(var(--line) 0 1px, transparent 1px calc(var(--ppm) * 30)), var(--surface-2); background-size: 100% calc(var(--ppm) * 60); }
.ev { position: absolute; left: 2px; right: 2px; z-index: 2; overflow: hidden; padding: 3px 7px; border: 0; border-left: 4px solid var(--c); border-radius: 8px; background: color-mix(in srgb, var(--c) 20%, var(--surface)); color: var(--ink); text-align: left; font-size: .78rem; line-height: 1.25; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.ev b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev span { display: block; color: var(--muted); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.short { display: flex; gap: 4px; align-items: center; padding-block: 0; }
.lane .ev { cursor: grab; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.ev .rz { position: absolute; left: 0; right: 0; bottom: 0; height: 14px; cursor: ns-resize; touch-action: none; }
.ev .rz::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 26px; height: 3px; margin-left: -13px; border-radius: 2px; background: currentColor; opacity: 0; transition: opacity .15s; }
.ev:hover .rz::after, .ev.dragging .rz::after { opacity: .5; }
@media (hover: none) { .ev .rz { height: 20px; } .ev .rz::after { opacity: .35; } }
.ev.dragging { z-index: 30; box-shadow: var(--shadow-lg); transform: scale(1.03); cursor: grabbing; }
.ev.clash { outline: 2px solid var(--rose); outline-offset: -2px; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; }
body.is-dragging { overscroll-behavior: none; }
.lane .now { position: absolute; left: -5px; right: 0; height: 2px; background: var(--rose); z-index: 3; pointer-events: none; }
.lane .now::before { content: ""; position: absolute; left: -2px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--rose); }
.dragtip { margin: 0 0 8px; }
.agenda-wide { display: grid; grid-template-columns: 250px 1fr; gap: 18px; align-items: start; }
.agenda-wide aside { position: sticky; top: 16px; }
.minimonth { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; box-shadow: var(--shadow); }
.mm-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.mm-head b { text-transform: capitalize; font-family: var(--serif); }
.mm-head .icon-btn { width: 34px; height: 34px; }
.mm-wd, .mm-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.mm-wd span { font-size: .7rem; color: var(--faint); padding: 2px 0; }
.mm-grid button { position: relative; aspect-ratio: 1; border: 0; background: none; border-radius: 50%; font-size: .82rem; color: var(--ink); }
.mm-grid button.out { color: var(--faint); }
.mm-grid button.today { color: var(--rose); font-weight: 700; }
.mm-grid button.on { background: var(--plum); color: var(--on-plum); }
.mm-grid button i { position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--gold-bg); }
.agenda-home { padding-bottom: 14px; }
.cols.compact { --ppm: .95px; }
@media (min-width: 700px) { .cols.compact { --ppm: 1.05px; } }
.toast.has-action { display: flex; align-items: center; gap: 14px; pointer-events: auto; text-align: left; }
.toast button { flex: none; border: 0; background: none; color: #f2d58a; font-weight: 800; padding: 6px 4px; }

/* ---------- Labo : modes et mise en contenant ---------- */
.step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--plum); color: var(--on-plum); font-family: var(--sans); font-size: .85rem; margin-right: 6px; }
.labo .panel h3 { display: flex; align-items: center; }
.mode-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.mode input { position: absolute; opacity: 0; pointer-events: none; }
.mode span { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--surface-2); text-align: center; cursor: pointer; color: var(--muted); height: 100%; }
.mode b { color: var(--ink); font-size: .9rem; }
.mode input:checked + span { border-color: var(--plum); background: var(--plum-soft); color: var(--plum); }
.mode input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--plum) 25%, transparent); }
.plan { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--gold-soft); }
.labo-item.ref { border-color: var(--gold-bg); box-shadow: 0 0 0 1px var(--gold-bg) inset; }
.labo-need small { width: 100%; }
.fill-rows, .extra-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.fill-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.fill-name { flex: 1 1 160px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.fill-row .fr-count, .fill-row .ad-rem { width: 110px; flex: none; }
.fill-row.extra .fx-type { flex: 1 1 120px; width: auto; }
.fill-row.extra .pair { flex: 1 1 170px; }
.yield-line { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--leaf-soft); }
.yield-line .ic { color: var(--leaf); margin-top: 2px; }
.yield-line:empty { display: none; }
@media (max-width: 560px) { .mode-pick { grid-template-columns: 1fr; } .mode span { flex-direction: row; justify-content: flex-start; padding: 10px 12px; } }

/* ---------- Couleurs par rubrique ---------- */
.tile-ic { background: linear-gradient(145deg, color-mix(in srgb, var(--vc, var(--plum)) 82%, #fff), var(--vc, var(--plum))); color: #fff; box-shadow: 0 6px 14px color-mix(in srgb, var(--vc, var(--plum)) 32%, transparent), inset 0 1px 0 rgba(255, 255, 255, .25); }
.tile-ic .ic { stroke-width: 1.9; }
.tile:hover { border-color: var(--vc, var(--plum-2)); }
.tile-count { color: var(--vc, var(--leaf)); background: color-mix(in srgb, var(--vc, var(--leaf)) 13%, transparent); }
.nav-item .ic { color: var(--vc, var(--muted)); }
.nav-item.on { background: color-mix(in srgb, var(--vc, var(--plum)) 14%, transparent); color: var(--ink); }
.nav-item.on .ic { color: var(--vc, var(--plum)); }
.chip .ic { color: var(--vc, var(--muted)); }
.chip.on { background: var(--vc, var(--plum)); border-color: var(--vc, var(--plum)); color: #fff; }
.chip.on .ic { color: #fff; }

/* ---------- Fenêtres (feuilles) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 10, 28, .5); opacity: 0; transition: opacity .18s; backdrop-filter: blur(2px); }
.sheet { position: relative; width: 100%; max-height: calc(100dvh - 24px - var(--safe-t)); display: flex; flex-direction: column; background: var(--surface); border-radius: 22px 22px 0 0; box-shadow: var(--shadow-lg); transform: translateY(40px); opacity: 0; transition: transform .2s ease, opacity .18s; }
.sheet-wrap.open .sheet { transform: none; opacity: 1; }
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.closing .sheet { transform: translateY(40px); opacity: 0; } .sheet-wrap.closing .sheet-backdrop { opacity: 0; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.sheet-head h2 { flex: 1; margin: 0; font-size: 1.18rem; color: var(--plum); overflow: hidden; text-overflow: ellipsis; }
.sheet-body { flex: 1; overflow-y: auto; padding: 16px 18px 22px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.sheet-body > h3 { margin-top: 18px; }
.sheet-foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; padding: 12px 14px calc(12px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--surface); border-radius: 0 0 22px 22px; }
.sheet-foot > .btn.danger-text:first-child { margin-right: auto; }
@media (max-width: 560px) { .sheet-foot > .btn { flex: 1 1 auto; } .sheet-foot > .btn.danger-text:first-child { flex: 0 0 auto; } }
.sheet-photo { width: 100%; max-height: 280px; object-fit: cover; border-radius: 14px; margin-bottom: 14px; }
.confirm-text { font-size: 1.02rem; margin: 4px 0; }
body.sheet-open { overflow: hidden; }
@media (min-width: 700px) {
  .sheet-wrap { align-items: center; padding: 20px; }
  .sheet { max-width: 640px; border-radius: 22px; max-height: min(880px, calc(100dvh - 40px)); transform: translateY(16px) scale(.98); }
  .sheet.wide { max-width: 940px; }
  .sheet-foot { border-radius: 0 0 22px 22px; }
}

/* ---------- Messages ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 300; transform: translate(-50%, 30px); max-width: min(92vw, 460px); padding: 12px 18px; border-radius: 14px; background: #2b1f33; color: #fff; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .22s; font-size: .93rem; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #8e2a3f; }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* ---------- Connexion ---------- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: 100%; max-width: 420px; padding: 28px 22px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); text-align: center; }
.gate-card .form { text-align: left; margin-top: 6px; }
.gate-logo { width: 150px; height: 120px; object-fit: contain; }
.gate-card h1 { margin: 6px 0 2px; color: var(--plum); }
.gate-card .btn.big { width: 100%; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); margin: 16px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.loading { display: grid; place-items: center; min-height: 60vh; text-align: center; color: var(--muted); }
.loading img { width: 140px; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* ---------- Impression ---------- */
#print-root { display: none; }
body.printing #app, body.printing #sheet-root { display: none; }
body.printing #print-root { display: block; background: var(--bg-2); min-height: 100vh; padding-bottom: 40px; }
.print-bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 14px 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
.print-bar b { flex: 1; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.print-help { text-align: center; color: var(--muted); font-size: .88rem; padding: 0 16px; }
.print-pages { padding: 16px 8px; overflow-x: auto; }
.page { width: 210mm; min-height: 297mm; margin: 0 auto 16px; padding: 14mm 14mm 18mm; background: #fff; color: #222; box-shadow: 0 4px 24px rgba(0, 0, 0, .18); font: 10.5pt/1.45 Georgia, "Times New Roman", serif; position: relative; }
.page.landscape { width: 297mm; min-height: 210mm; padding: 9mm 10mm 12mm; font-size: 8.6pt; }
@media (max-width: 860px) { .print-pages { zoom: .5; } }
@media (max-width: 460px) { .print-pages { zoom: .42; } }
.page h1 { font-size: 20pt; margin: 0; color: #5d356f; }
.page h2 { font-size: 13pt; margin: 4px 0; color: #2f5d45; }
.page h3 { font-size: 10.5pt; margin: 12px 0 5px; color: #2f5d45; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid #c9d4cc; padding-bottom: 2px; }
.page .small, .page small { font-size: 8pt; color: #555; }
.doc-head { display: grid; grid-template-columns: auto 1fr 1.2fr; gap: 14px; align-items: center; border-bottom: 2px solid #5d356f; padding-bottom: 8px; margin-bottom: 8px; }
.doc-head.two { grid-template-columns: 1fr 1fr; align-items: start; }
.doc-head .r { text-align: right; }
.doc-head .r h1 { font-size: 24pt; color: #30343b; text-transform: uppercase; letter-spacing: .06em; }
.doc-logo { width: 110px; height: 80px; object-fit: contain; }
.doc-title small { color: #5d356f; font-weight: bold; letter-spacing: .1em; }
.doc-title em { color: #666; font-size: 8pt; }
.doc-meta { font-size: 8.5pt; }
.page .brand { color: #24493a; font-size: 14pt; border: 0; padding: 0; margin: 4px 0 2px; display: block; text-align: left; }
.doc-center { text-align: center; margin-bottom: 10px; }
.doc-center .doc-logo { width: 130px; height: 90px; }
.page .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
table.grid { width: 100%; border-collapse: collapse; margin: 4px 0; }
table.grid th, table.grid td { border: 1px solid #c9d4cc; padding: 3px 6px; text-align: left; vertical-align: top; }
table.grid th { background: #e9f1ec; font-size: .92em; }
table.grid .r, .page .r { text-align: right; }
table.kv { width: 100%; border-collapse: collapse; margin: 4px 0 6px; }
table.kv th { width: 32%; text-align: left; vertical-align: top; padding: 4px 8px 4px 0; color: #333; }
table.kv td { padding: 4px 0; border-bottom: 1px solid #eee; }
.parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 10px 0; }
.parties > div { padding: 8px 10px; background: #faf7f1; border-radius: 6px; }
.parties small { color: #777; font-weight: bold; letter-spacing: .08em; }
table.totals { margin: 8px 0 10px auto; border-collapse: collapse; min-width: 260px; }
table.totals th { text-align: left; padding: 4px 16px 4px 0; font-weight: normal; }
table.totals td { text-align: right; padding: 4px 0; font-variant-numeric: tabular-nums; }
table.totals tr.big th, table.totals tr.big td { font-weight: bold; font-size: 12pt; border-top: 2px solid #5d356f; padding-top: 6px; }
.legal { border-top: 1px solid #ddd; margin-top: 10px; padding-top: 6px; font-size: 8.5pt; color: #444; }
.legal p { margin: 2px 0; }
.sign { margin-top: 12px; }
.sign img { max-width: 160px; max-height: 70px; }
.sign.box { border: 1px dashed #aaa; border-radius: 6px; padding: 8px 10px 40px; width: 55%; margin-left: auto; font-size: 9pt; }
.stamp { display: inline-block; margin-top: 4px; padding: 2px 8px; border: 2px solid #2f7351; color: #2f7351; border-radius: 4px; font-weight: bold; transform: rotate(-3deg); }
.doc-foot { position: absolute; left: 14mm; right: 14mm; bottom: 7mm; text-align: center; font-size: 7.5pt; color: #888; border-top: 1px solid #eee; padding-top: 3px; }
/* Planches d'étiquettes A4 (dimensions réelles en mm) */
.page.labels { padding: var(--lt) 0 0 var(--ll); display: grid; grid-template-columns: repeat(var(--cols), var(--lw)); grid-auto-rows: var(--lh); column-gap: var(--gx); row-gap: var(--gy); align-content: start; font-size: 7pt; }
.label { overflow: hidden; padding: 2mm 2.6mm; display: flex; flex-direction: column; gap: .7mm; border: 1px dashed #d8d0c4; border-radius: 2mm; font: 6.4pt/1.25 Georgia, serif; color: #222; }
.label.blank { border-color: #eee; background: repeating-linear-gradient(135deg, transparent 0 6px, #f4f1ec 6px 12px); }
@media print { .label.blank { background: none; } }
.lb-top { display: flex; align-items: center; gap: 2mm; }
.lb-top img { height: 9mm; width: auto; flex: none; }
.lb-top div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lb-name { font-size: 9pt; color: #5d356f; line-height: 1.1; }
.lb-legal { font-size: 6pt; color: #555; }
.lb-net { font-size: 9pt; white-space: nowrap; }
.lb-ing { margin: 0; flex: 1; overflow: hidden; font-size: 5.8pt; }
.lb-bottom { display: flex; justify-content: space-between; gap: 2mm; font-size: 6pt; }
.lb-cons, .lb-maker { margin: 0; font-size: 5.6pt; color: #444; }
.label:not(.small) { font-size: 8pt; padding: 3.5mm 4mm; gap: 1.5mm; }
.label:not(.small) .lb-top img { height: 14mm; }
.label:not(.small) .lb-name, .label:not(.small) .lb-net { font-size: 12pt; }
.label:not(.small) .lb-ing { font-size: 7.4pt; }
.label:not(.small) .lb-bottom { font-size: 7.6pt; }
.label:not(.small) .lb-cons, .label:not(.small) .lb-maker { font-size: 7pt; }
@media print { .label { border-color: transparent; } .page.labels { height: 297mm; } }
@page { size: A4; margin: 0; }
@page land { size: A4 landscape; margin: 0; }
@media print {
  body { background: #fff !important; }
  body::before { display: none; }
  .no-print { display: none !important; }
  body.printing #print-root { background: #fff; padding: 0; }
  .print-pages { padding: 0 !important; zoom: 1 !important; overflow: visible; }
  .page { margin: 0; box-shadow: none; page-break-after: always; break-after: page; min-height: 0; height: 296mm; overflow: hidden; }
  .page.landscape { page: land; height: 209mm; }
  .page:last-child { page-break-after: auto; break-after: auto; }
}
