/* Zéphir Studio — feuille de style principale
   Charte : chocolat, cuivre, acajou, rose sable, ivoire. Lisibilité d'abord. */

@font-face { font-family: "Atkinson Hyperlegible"; src: url("/assets/fonts/Atkinson-Hyperlegible-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/assets/fonts/Atkinson-Hyperlegible-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/assets/fonts/Atkinson-Hyperlegible-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("/assets/fonts/Atkinson-Hyperlegible-700-italic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("/assets/fonts/Lexend-variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "OpenDyslexic"; src: url("/assets/fonts/OpenDyslexic-400-normal.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --chocolat: #330D04;
  --cuivre-fonce: #843F26;
  --acajou: #551D10;
  --cuivre: #B87656;
  --rose-sable: #EAC9BD;
  --rose-clair: #F6E7E0;
  --ivoire: #FFFCF7;

  --font-atkinson: "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-lexend: "Lexend", system-ui, sans-serif;
  --font-opendyslexic: "OpenDyslexic", "Atkinson Hyperlegible", system-ui, sans-serif;
  --font: var(--font-atkinson);

  --fs: 18px;
  --lh: 1.6;
  --ls: 0;
  --radius: 14px;
  --radius-sm: 10px;
  --tap: 48px;
  --topbar-h: 64px;
  --shadow: 0 2px 10px rgba(51, 13, 4, .08);

  --bg: var(--ivoire);
  --bg-card: #FFFFFF;
  --bg-soft: var(--rose-clair);
  --bg-bar: var(--chocolat);
  --text: var(--chocolat);
  --text-bar: var(--ivoire);
  --muted: #6E4A3C;
  --border: var(--rose-sable);
  --accent: var(--cuivre-fonce);
  --primary: var(--cuivre);
  --primary-text: var(--chocolat);
  --focus: #1565C0;
  --ok: #2E7D32;
  --warn: #B26A00;
  --danger: #C62828;

  /* Teintes des étiquettes et messages : lisibles dans les deux thèmes */
  --tint-ok-bg: #E8F5E9; --tint-ok-fg: #1B5E20; --tint-ok-line: #A5D6A7;
  --tint-warn-bg: #FFF3E0; --tint-warn-fg: #8A4B00; --tint-warn-line: #FFCC80;
  --tint-danger-bg: #FFEBEE; --tint-danger-fg: #B71C1C; --tint-danger-line: #EF9A9A;
  --tint-info-bg: #FFF8EE; --tint-info-fg: #330D04; --tint-info-line: #FFCC80;

  color-scheme: light;
}

:root[data-font="lexend"] { --font: var(--font-lexend); }
:root[data-font="opendyslexic"] { --font: var(--font-opendyslexic); --fs: 17px; }
:root[data-size="1"] { --fs: 16px; }
:root[data-size="2"] { --fs: 18px; }
:root[data-size="3"] { --fs: 21px; }
:root[data-spacing="large"] { --lh: 1.85; --ls: .03em; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1F0A03; --bg-card: #2B1108; --bg-soft: #3A1A0E; --bg-bar: #140602;
    --text: var(--ivoire); --text-bar: var(--ivoire); --muted: #D9B8A8; --border: #5A2E1E;
    --accent: #E0A07E; --primary: var(--cuivre); --primary-text: var(--chocolat); --focus: #8AB4F8;
    --shadow: 0 2px 10px rgba(0, 0, 0, .4);
    --tint-ok-bg: #1E3A22; --tint-ok-fg: #A5D6A7; --tint-ok-line: #2E7D32;
    --tint-warn-bg: #3F2A0E; --tint-warn-fg: #FFCC80; --tint-warn-line: #B26A00;
    --tint-danger-bg: #3F1414; --tint-danger-fg: #EF9A9A; --tint-danger-line: #C62828;
    --tint-info-bg: #3A1A0E; --tint-info-fg: #FFFCF7; --tint-info-line: #B87656;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1F0A03; --bg-card: #2B1108; --bg-soft: #3A1A0E; --bg-bar: #140602;
  --text: var(--ivoire); --text-bar: var(--ivoire); --muted: #D9B8A8; --border: #5A2E1E;
  --accent: #E0A07E; --primary: var(--cuivre); --primary-text: var(--chocolat); --focus: #8AB4F8;
  --shadow: 0 2px 10px rgba(0, 0, 0, .4);
  --tint-ok-bg: #1E3A22; --tint-ok-fg: #A5D6A7; --tint-ok-line: #2E7D32;
  --tint-warn-bg: #3F2A0E; --tint-warn-fg: #FFCC80; --tint-warn-line: #B26A00;
  --tint-danger-bg: #3F1414; --tint-danger-fg: #EF9A9A; --tint-danger-line: #C62828;
  --tint-info-bg: #3A1A0E; --tint-info-fg: #FFFCF7; --tint-info-line: #B87656;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); line-height: var(--lh); letter-spacing: var(--ls);
  min-height: 100dvh; display: grid;
  grid-template-areas: "top top" "side main"; grid-template-columns: 240px 1fr; grid-template-rows: auto 1fr;
  text-rendering: optimizeLegibility;
}
body.is-minimal { display: block; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; font-weight: 700; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; display: flex; align-items: center; gap: .4em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; max-width: 70ch; }
a { color: var(--accent); text-underline-offset: .15em; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9em; background: var(--bg-soft); padding: .1em .35em; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.hint { color: var(--muted); font-size: .85rem; margin: .3em 0 0; }
.hide-mobile { display: none; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--primary-text); padding: .6em 1em; border-radius: var(--radius-sm); z-index: 100; }
.skip-link:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.icon { width: 1.3em; height: 1.3em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.big-icon .icon { width: 3em; height: 3em; color: var(--accent); }

/* Barre du haut */
.topbar {
  grid-area: top; background: var(--bg-bar); color: var(--text-bar);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--topbar-h); padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top)); position: sticky; top: 0; z-index: 20;
}
.brand { color: inherit; text-decoration: none; font-weight: 700; letter-spacing: .14em; font-size: 1.05rem; }
.brand span { font-weight: 400; opacity: .85; }
.brand-big { font-size: 1.5rem; display: block; text-align: center; margin-bottom: .4rem; color: var(--text); }
.topbar-actions { display: flex; gap: .4rem; align-items: center; }
.topbar .btn-ghost { color: var(--text-bar); border-color: transparent; }
.topbar .btn-ghost:hover { background: rgba(255, 252, 247, .12); }

/* Menu gauche (tablette et ordinateur) */
.sidenav { grid-area: side; display: none; flex-direction: column; gap: .2rem; padding: 1rem .6rem; background: var(--bg-card); border-right: 1px solid var(--border); position: sticky; top: var(--topbar-h); height: calc(100dvh - var(--topbar-h)); overflow-y: auto; }
.sidenav-link { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; min-height: var(--tap); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 700; }
.sidenav-link:hover { background: var(--bg-soft); }
.sidenav-link.is-active { background: var(--primary); color: var(--primary-text); }

/* Contenu principal */
.main { grid-area: main; padding: 1rem; padding-bottom: calc(96px + env(safe-area-inset-bottom)); width: 100%; min-width: 0; }
.page-head { margin-bottom: 1rem; }
.page-sub { color: var(--muted); margin: 0; }

/* Cartes */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.grid-2 > .card { margin-bottom: 0; }
.grid-2 + .card { margin-top: 1rem; }
.stack { display: grid; gap: .9rem; }
.big-number { font-size: 1.7rem; font-weight: 700; margin: .2em 0 .4em; line-height: 1.2; }

/* Boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--tap); padding: .55em 1.1em; border-radius: var(--radius-sm); border: 2px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; color: var(--text); background: var(--bg-soft);
  transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--primary-text); }
.btn-primary:hover { background: #C98562; }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-block { width: 100%; }
.btn-icon { padding: .5em; min-width: var(--tap); }
.btn-small { min-height: 40px; padding: .3em .8em; font-size: .9rem; }
.btn[disabled] { opacity: .55; cursor: wait; }
.row-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* Formulaires */
.field { display: grid; gap: .35rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.field legend { font-weight: 700; padding: 0; margin-bottom: .3rem; }
label { font-weight: 700; }
input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"], input[type="url"], input[type="search"], textarea, select {
  font: inherit; letter-spacing: inherit; color: var(--text); background: var(--bg-card); border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: .6em .8em; min-height: var(--tap); width: 100%;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); outline: 3px solid var(--focus); outline-offset: 1px; }
input[disabled] { opacity: .6; }
textarea { resize: vertical; min-height: 7em; }
.check { display: flex; align-items: center; gap: .7rem; min-height: var(--tap); font-weight: 400; cursor: pointer; }
.check input { width: 1.4em; height: 1.4em; accent-color: var(--cuivre-fonce); flex: none; }
.field-voice { position: relative; }
.field-voice textarea { padding-right: 3.4em; }
.btn-mic { position: absolute; right: .4em; top: .4em; width: 2.6em; height: 2.6em; min-height: 0; border-radius: 50%; padding: 0; background: var(--bg-soft); border: 2px solid var(--border); }
.btn-mic.is-listening { background: var(--danger); color: #fff; border-color: var(--danger); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(198, 40, 40, .5); } 50% { box-shadow: 0 0 0 10px rgba(198, 40, 40, 0); } }

/* Messages */
.flash { padding: .8em 1em; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 2px solid; font-weight: 700; }
.flash-success { background: var(--tint-ok-bg); color: var(--tint-ok-fg); border-color: var(--tint-ok-line); }
.flash-error { background: var(--tint-danger-bg); color: var(--tint-danger-fg); border-color: var(--tint-danger-line); }
.flash-info { background: var(--bg-soft); color: var(--text); border-color: var(--border); }
.toasts { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; gap: .5rem; z-index: 80; pointer-events: none; width: min(92vw, 420px); }
.toast { pointer-events: auto; background: var(--chocolat); color: var(--ivoire); padding: .8em 1em; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-weight: 700; text-align: center; animation: toast-in .2s ease; }
.toast-error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Listes, badges, tableaux */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .7em 0; border-top: 1px solid var(--border); }
.list-item:first-child { border-top: 0; }
.badge { display: inline-block; background: var(--primary); color: var(--primary-text); border-radius: 999px; padding: .1em .6em; font-size: .8rem; font-weight: 700; }
.badge-muted { background: var(--bg-soft); color: var(--muted); }
.badge-warn { background: var(--tint-warn-bg); color: var(--tint-warn-fg); }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.chip { display: inline-flex; align-items: center; min-height: 40px; padding: .2em .9em; border-radius: 999px; background: var(--bg-soft); color: var(--text); text-decoration: none; font-weight: 700; font-size: .9rem; border: 1px solid var(--border); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .5em .6em; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { color: var(--muted); font-weight: 700; }
.details summary { cursor: pointer; font-weight: 700; padding: .6em 0; }

/* Jauges */
.gauge { height: 14px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.gauge-fill { height: 100%; background: var(--ok); border-radius: 999px; transition: width .4s ease; }
.gauge.is-warn .gauge-fill { background: var(--warn); }

/* Énergie */
.card-energy { background: linear-gradient(135deg, var(--bg-card), var(--bg-soft)); }
.energy-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: .4rem; margin-bottom: .6rem; }
.energy-btn { display: grid; justify-items: center; gap: .1rem; min-height: 64px; padding: .4em .2em; border-radius: var(--radius-sm); border: 2px solid var(--border); background: var(--bg-card); color: var(--text); font: inherit; cursor: pointer; }
.energy-num { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.energy-label { font-size: .72rem; color: var(--muted); }
.energy-btn.is-active { background: var(--primary); border-color: var(--cuivre-fonce); color: var(--primary-text); }
.energy-btn.is-active .energy-label { color: var(--primary-text); }

/* Barre du bas (téléphone) */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--bg-bar); color: var(--text-bar); padding-bottom: env(safe-area-inset-bottom);
  border-top: 1px solid rgba(255, 252, 247, .12);
}
.bottomnav-link { display: grid; justify-items: center; gap: .15rem; padding: .55rem .2rem .45rem; min-height: 60px; color: inherit; text-decoration: none; font-size: .72rem; font-weight: 700; background: none; border: 0; font-family: inherit; cursor: pointer; opacity: .8; }
.bottomnav-link .icon { width: 1.5em; height: 1.5em; }
.bottomnav-link.is-active { opacity: 1; color: var(--rose-sable); }
.bottomnav-link.is-active .icon { stroke-width: 2.6; }

/* Bouton + flottant */
.fab {
  position: fixed; right: 1rem; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 65;
  width: 64px; height: 64px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--primary); color: var(--primary-text); box-shadow: 0 6px 18px rgba(51, 13, 4, .35);
  display: grid; place-items: center;
}
.fab .icon { width: 2em; height: 2em; stroke-width: 2.8; }
.fab:active { transform: scale(.96); }

/* Feuille « Plus » */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 72; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 75; background: var(--bg-card); border-radius: var(--radius) var(--radius) 0 0; padding: .8rem .8rem calc(.8rem + env(safe-area-inset-bottom)); display: grid; gap: .2rem; box-shadow: 0 -4px 24px rgba(0, 0, 0, .25); }
.sheet form { display: contents; }
.sheet-link { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .8rem 1rem; min-height: var(--tap); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font: inherit; font-weight: 700; background: none; border: 0; cursor: pointer; text-align: left; }
.sheet-link:hover { background: var(--bg-soft); }

/* Boîte de dialogue */
.dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(94vw, 560px); background: var(--bg-card); color: var(--text); box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.dialog::backdrop { background: rgba(0, 0, 0, .5); }
.dialog-form { padding: 1.2rem; display: grid; gap: .8rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }

/* Connexion et pages minimales */
.minimal-main { min-height: 100dvh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.login-card { width: min(100%, 440px); }
.login-card .center, .login-card.center { text-align: center; }

/* Mode calme : on cache ce qui n'est pas essentiel */
body.is-calm .card:not(.card-energy):not(.card-essential) { opacity: .55; }
body.is-calm .card:not(.card-energy):not(.card-essential):hover, body.is-calm .card:not(.card-energy):not(.card-essential):focus-within { opacity: 1; }

/* Tablette et ordinateur */
@media (min-width: 900px) {
  .sidenav { display: flex; }
  .bottomnav { display: none; }
  .hide-mobile { display: block; }
  .main { padding: 1.5rem 2rem; padding-bottom: 2rem; }
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .fab { bottom: 1.5rem; right: 1.5rem; }
  .toasts { bottom: 1.5rem; }
}
@media (max-width: 899px) {
  body { grid-template-areas: "top" "main"; grid-template-columns: 1fr; }
}
/* Module Clients, recherche, boîte à trier */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row-between { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: .3em; color: var(--muted); text-decoration: none; font-size: .9rem; margin-bottom: .3rem; }
.back-link:hover { color: var(--accent); }
.field-row { display: flex; gap: .5rem; align-items: center; }
.field-row input { flex: 1; }
.filters { padding: .8rem; }
.filters .chips { margin: .6rem 0 0; align-items: center; }
.chip.is-active { background: var(--primary); color: var(--primary-text); border-color: var(--cuivre-fonce); }
.chip-select { min-height: 40px; width: auto; padding: .2em 2em .2em .8em; border-radius: 999px; font-size: .9rem; font-weight: 700; }
.topbar-search { flex: 1; max-width: 420px; }
.topbar-search input { min-height: 42px; background: rgba(255, 252, 247, .1); border-color: rgba(255, 252, 247, .25); color: var(--text-bar); }
.topbar-search input::placeholder { color: rgba(255, 252, 247, .6); }
.topbar-search input:focus { background: var(--bg-card); color: var(--text); }
.cards-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.card-link { display: flex; align-items: center; gap: .6rem; padding: .9rem 1rem; margin: 0; }
.card-link-main { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.card-link-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card-title { font-size: 1.05rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.pill { display: inline-block; padding: .1em .6em; border-radius: 999px; background: var(--bg-soft); color: var(--text); font-size: .8rem; font-weight: 700; border: 1px solid var(--border); text-decoration: none; }
.pill-warn { background: var(--tint-warn-bg); color: var(--tint-warn-fg); border-color: var(--tint-warn-line); }
.pill-danger { background: var(--tint-danger-bg); color: var(--tint-danger-fg); border-color: var(--tint-danger-line); }
.pill-ok { background: var(--tint-ok-bg); color: var(--tint-ok-fg); border-color: var(--tint-ok-line); }
.badge-ok { background: var(--tint-ok-bg); color: var(--tint-ok-fg); }
.quick-grid { display: grid; grid-template-columns: 1fr; gap: .8rem; margin-bottom: .8rem; }
.quick { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .6rem .8rem; background: var(--bg-soft); border-radius: var(--radius-sm); }
.quick-label { font-size: .8rem; color: var(--muted); font-weight: 700; width: 100%; }
.quick-value { font-weight: 700; font-size: 1.1rem; word-break: break-all; }
.inline-form { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.inline-form input[type="date"] { width: auto; min-height: 40px; }
.inline-form input.is-late { border-color: var(--danger); }
.chips-inline { display: flex; flex-wrap: wrap; gap: .3rem; margin: .4rem 0; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: .3rem .9rem; margin: .6rem 0; }
.dl dt { color: var(--muted); font-size: .9rem; }
.dl dd { margin: 0; word-break: break-word; }
.note-block { background: var(--bg-soft); border-radius: var(--radius-sm); padding: .7rem .9rem; margin-top: .6rem; }
.note-block p { white-space: pre-line; margin: .3em 0 0; }
.list-item-col { flex-direction: column; align-items: stretch; gap: .3rem; }
.list-item-col p { margin: 0; white-space: pre-line; }
.is-pinned { background: var(--bg-soft); margin: 0 -1.1rem; padding-left: 1.1rem; padding-right: 1.1rem; border-radius: var(--radius-sm); }
.sticky-actions { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); background: var(--bg); padding: .6rem 0; z-index: 5; }
.capture-raw { margin: .5rem 0 .8rem; padding: .6rem .9rem; border-left: 4px solid var(--cuivre); background: var(--bg-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-style: italic; }
.capture-fields { padding: .6rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
input[type="file"] { font: inherit; font-size: .9rem; }
@media (min-width: 700px) {
  .quick-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .sticky-actions { bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Agenda */
.agenda-nav { padding: .8rem 1rem; display: grid; gap: .6rem; }
.agenda-nav .chips { margin: 0; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.legend-item { display: inline-flex; align-items: center; gap: .4em; min-height: 36px; padding: .15em .7em; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.legend-item[aria-pressed="true"] { background: var(--bg-soft); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.legend.has-filter .legend-item[aria-pressed="false"] { opacity: .5; }
.legend-dot { width: .9em; height: .9em; border-radius: 50%; flex: none; }
.agenda-days { display: grid; gap: .8rem; }
.day { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .9rem; box-shadow: var(--shadow); }
.day.is-today { border-color: var(--cuivre); box-shadow: 0 0 0 2px var(--rose-sable); }
.day-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.day-head h2 { margin: 0; font-size: 1rem; }
.day-empty { margin: .2em 0 0; }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.event { border-left: 6px solid var(--ev-color, var(--cuivre)); border-radius: var(--radius-sm); background: var(--bg-soft); }
.event.is-free { background: repeating-linear-gradient(135deg, var(--bg-soft), var(--bg-soft) 8px, var(--bg-card) 8px, var(--bg-card) 16px); border-left-style: dashed; }
.event.is-hidden { display: none; }
.event-main { display: grid; gap: .1rem; width: 100%; text-align: left; padding: .5rem .7rem; border: 0; background: none; color: var(--text); font: inherit; cursor: pointer; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; min-height: var(--tap); }
.event-main:hover { background: rgba(184, 118, 86, .12); }
.event-when { font-size: .8rem; color: var(--muted); font-weight: 700; }
.event-title { font-weight: 700; }
.event-meta { font-size: .8rem; color: var(--muted); }
.today-events { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.today-events li { display: flex; gap: .6rem; align-items: baseline; padding-left: .6rem; border-left: 5px solid var(--ev-color, var(--cuivre)); }
.today-events .event-when { min-width: 6.5em; }
@media (min-width: 900px) {
  .agenda-days.is-week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; align-items: start; }
  .agenda-days.is-week .day { padding: .5rem .6rem; min-height: 180px; }
  .agenda-days.is-week .day-head h2 { font-size: .92rem; }
  .agenda-days.is-week .event-main { padding: .4rem .5rem; }
  .agenda-days.is-week .event-title { font-size: .9rem; line-height: 1.3; }
  .agenda-days.is-week .event-meta { display: none; }
}

/* Contenu : projets, tableau, fiche vidéo, commentaires */
.projects-grid { grid-template-columns: 1fr; }
.project-card { border-left: 6px solid var(--ev-color, var(--cuivre)); }
.gauge-thin { height: 8px; margin-top: .5rem; }
.board { display: flex; gap: .7rem; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: .2rem 0 1rem; scroll-snap-type: x proximity; margin-bottom: .4rem; }
.column { flex: 0 0 min(82vw, 300px); background: var(--bg-soft); border-radius: var(--radius); padding: .6rem; scroll-snap-align: start; display: flex; flex-direction: column; min-height: 200px; transition: box-shadow .15s ease; }
.column.is-over { box-shadow: inset 0 0 0 3px var(--accent); }
.column-head h2 { font-size: .95rem; margin: 0 0 .5rem; display: flex; justify-content: space-between; }
.column-count { background: var(--bg-card); color: var(--muted); border-radius: 999px; padding: 0 .55em; font-size: .8rem; }
.column-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; flex: 1; align-content: start; min-height: 40px; }
.kcard { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); cursor: grab; }
.kcard.is-dragging { opacity: .5; }
.kcard.is-warn { border-color: #FFCC80; }
.kcard-main { display: grid; gap: .3rem; padding: .6rem .7rem; color: inherit; text-decoration: none; }
.kcard-title { font-weight: 700; line-height: 1.3; }
.kcard-meta { display: flex; flex-wrap: wrap; gap: .3rem; }
.kcard-meta .pill { font-size: .72rem; padding: 0 .5em; }
.kcard-move { min-height: 36px; font-size: .82rem; padding: .2em .6em; border-radius: 0 0 var(--radius-sm) var(--radius-sm); border-width: 1px 0 0; background: var(--bg-soft); }
.column-add { margin-top: .5rem; }
.column-add input { min-height: 42px; font-size: .92rem; background: var(--bg-card); }
.field-copy .row-between { align-items: center; }
.card-warn { border-color: var(--tint-warn-line); background: var(--tint-info-bg); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.checklist-item { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.checklist-item .check { flex: 1; }
.checklist-item.is-done span { text-decoration: line-through; color: var(--muted); }
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.comment { border-left: 4px solid var(--border); padding-left: .8rem; }
.comment-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline; }
.comment-body { margin: .2em 0 .4em; white-space: pre-line; }
.comments-replies { margin-top: .6rem; margin-left: .4rem; }
.guest-main { min-height: 100dvh; width: 100%; max-width: 100%; min-width: 0; justify-self: stretch; }
/* La page partagée n'est pas centrée comme l'écran de connexion : pleine largeur, sinon une description longue élargit toute la page sur téléphone */
body.is-minimal:has(.guest-main) .minimal-main { display: block; padding: 0; }
.guest-body { overflow-wrap: anywhere; }
.guest-body { padding: 1rem; max-width: 1400px; margin: 0 auto; }
.board-guest .kcard { cursor: pointer; }
.board-guest .kcard:hover { border-color: var(--cuivre); }
.guest-text { margin: 0; padding: .6rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-soft); white-space: pre-line; line-height: 1.55; }
.guest-dates { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 0; }
.guest-dates dt { font-size: .85rem; color: var(--muted); }
.guest-dates dd { margin: .1rem 0 0; font-weight: 700; }
@media (min-width: 700px) {
  .projects-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1200px) {
  .projects-grid { grid-template-columns: 1fr 1fr 1fr; }
  .column { flex-basis: 0; flex-grow: 1; min-width: 220px; }
}

/* Mails */
.mail-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.mail-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.mail-item.is-unread { border-left: 6px solid var(--cuivre); }
.mail-item.is-unread .mail-subject { font-weight: 700; }
.mail-main { display: grid; gap: .15rem; padding: .7rem .9rem; color: inherit; text-decoration: none; }
.mail-top { display: flex; justify-content: space-between; gap: .6rem; }
.mail-from { font-weight: 700; }
.mail-subject { line-height: 1.3; }
.mail-summary { color: var(--muted); font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mail-meta { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .2rem; }
.mail-meta .pill { font-size: .72rem; padding: 0 .5em; }
.pill-action { background: var(--tint-info-bg); color: var(--tint-info-fg); border-color: var(--tint-info-line); }
.mail-title { font-size: 1.3rem; word-break: break-word; }
.mail-ai { border-left: 6px solid var(--cuivre); }
.mail-summary-text { font-size: 1.05rem; }
.mail-actions { margin-bottom: 1rem; }
.mail-frame { width: 100%; border: 0; min-height: 200px; background: #fff; border-radius: var(--radius-sm); }
.mail-text { white-space: pre-wrap; word-break: break-word; font: inherit; margin: 0; }

.signature-preview { background: #fff; color: #330D04; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1rem; margin-top: .4rem; overflow-x: auto; }

/* Aujourd'hui : plan du jour */
.card-plan { border-left: 6px solid var(--cuivre); }
.plan-word { font-size: 1.05rem; margin-bottom: .6em; }
.plan-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; counter-reset: plan; }
.plan-item { background: var(--bg-soft); border-radius: var(--radius-sm); padding: .6rem .8rem; }
.plan-item.is-done { opacity: .6; }
.plan-item.is-done .plan-title { text-decoration: line-through; }
.plan-check { min-height: 0; margin-bottom: .2rem; }
.plan-title { font-weight: 700; font-size: 1.05rem; }
.plan-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; padding-left: 2.1em; }
/* Finance */
.bars { display: flex; align-items: flex-end; gap: .35rem; height: 140px; padding-top: .5rem; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.bar-fill { width: 100%; background: var(--cuivre); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar.is-current .bar-fill { background: var(--cuivre-fonce); }
.bar-label { font-size: .68rem; color: var(--muted); margin-top: .2rem; }
.report h3 { margin-top: 1.1em; }
.report ul { padding-left: 1.2em; }

.is-unread-notif { background: var(--bg-soft); margin: 0 -1.1rem; padding-left: 1.1rem; padding-right: 1.1rem; }

.company-search { margin-top: .5rem; padding: .6rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.company-search .field-row select { width: auto; }
.company-search .list { margin-top: .4rem; }

.status-select { min-width: 8.5em; }
.status-select.is-paid { background: var(--tint-ok-bg); color: var(--tint-ok-fg); border-color: var(--tint-ok-line); }
.status-select.is-late { background: var(--tint-danger-bg); color: var(--tint-danger-fg); border-color: var(--tint-danger-line); }

.is-paid-row { opacity: .7; }

.bulk-bar { position: sticky; top: calc(var(--topbar-h) + .3rem); z-index: 6; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .5rem; padding: .5rem .8rem; margin-bottom: .6rem; background: var(--bg-card); border: 2px solid var(--cuivre); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.mail-item { display: flex; align-items: stretch; }
.mail-item .mail-main { flex: 1; min-width: 0; }
.mail-check { display: flex; align-items: center; padding: 0 .3rem 0 .7rem; cursor: pointer; }
.mail-check input { width: 1.4em; height: 1.4em; accent-color: var(--cuivre-fonce); }
.mail-item.is-selected { background: var(--bg-soft); }

.card-relief { border-left: 6px solid #1565C0; }

.grid-3 { display: grid; grid-template-columns: 1fr; gap: .8rem; align-items: start; }
.grid-3 > .field { align-content: start; }
@media (min-width: 600px) { .grid-3 { grid-template-columns: 1.3fr 1fr 1fr; } }

/* Repli sans script : le lien Plus ouvre la feuille par ancre */
#sheet-more:target { display: grid !important; }
#sheet-more:target ~ * { }
.bottomnav-link { -webkit-tap-highlight-color: rgba(255,252,247,.15); touch-action: manipulation; }

/* Agenda en grille horaire : les créneaux vides se voient */
.chip-sep { width: 1px; align-self: stretch; background: var(--border); margin: 0 .2rem; }
.tg-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); box-shadow: var(--shadow); margin-bottom: .6rem; }
.tg { min-width: calc(52px + var(--cols) * 104px); }
.tg-row { display: grid; grid-template-columns: 52px repeat(var(--cols), minmax(0, 1fr)); }
.tg-head { position: sticky; top: 0; z-index: 3; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.tg-corner { padding: .4rem .3rem; }
.tg-dayhead { display: flex; align-items: center; justify-content: space-between; gap: .2rem; padding: .35rem .5rem; border-left: 1px solid var(--border); min-width: 0; }
.tg-dayhead.is-today { background: var(--rose-sable); color: var(--chocolat); }
.tg-dayname { font-weight: 700; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-allday { border-bottom: 1px solid var(--border); background: var(--bg-soft); }
.tg-allcell { border-left: 1px solid var(--border); padding: .25rem; display: grid; gap: .2rem; align-content: start; min-width: 0; max-height: 5.2rem; overflow-y: auto; }
.tg-chip { border-radius: var(--radius-sm); }
.tg-chip .event-main { min-height: 0; padding: .15rem .45rem; }
.tg-chip .event-title { font-size: .82rem; }
.tg-hours { position: relative; }
.tg-hour { height: var(--hpx); position: relative; }
.tg-hour span { position: absolute; top: -.55em; right: .4rem; font-size: .75rem; color: var(--muted); }
.tg-hour:first-child span { top: .15em; }
.tg-col { position: relative; height: calc(var(--rows) * var(--hpx)); border-left: 1px solid var(--border);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--hpx) - 1px), var(--border) calc(var(--hpx) - 1px), var(--border) var(--hpx)); }
.tg-col.is-today { background-color: rgba(234, 201, 189, .14); }
.tg-ev { position: absolute; overflow: hidden; z-index: 2; box-shadow: 0 1px 4px rgba(51, 13, 4, .18); }
.tg-ev .event-main { height: 100%; min-height: 0; padding: .15rem .4rem; align-content: start; gap: 0; overflow: hidden; }
.tg-ev .event-title { font-size: .84rem; line-height: 1.2; }
.tg-ev .event-when { font-size: .72rem; }
.tg-gap { position: absolute; left: 3px; right: 3px; z-index: 1; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: repeating-linear-gradient(135deg, transparent, transparent 7px, rgba(184, 118, 86, .09) 7px, rgba(184, 118, 86, .09) 14px); color: var(--muted); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; display: grid; place-items: center; padding: 0; }
.tg-gap:hover, .tg-gap:focus-visible { border-color: var(--cuivre); color: var(--text); background-color: rgba(184, 118, 86, .12); }
.tg-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--danger, #b3261e); z-index: 4; pointer-events: none; }
.tg-now::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: var(--danger, #b3261e); }
@media (max-width: 899px) { .tg-dayname { font-size: .82rem; } }

/* Menu de gauche réductible (tablette et ordinateur) : icônes seules, choix mémorisé */
.sidenav-toggle { margin-top: auto; display: flex; align-items: center; gap: .7rem; padding: .6rem .9rem; min-height: var(--tap); border: 1px solid var(--border); border-radius: var(--radius-sm); background: none; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.sidenav-toggle:hover { background: var(--bg-soft); color: var(--text); }
.sidenav-toggle-ico { font-size: 1.4rem; line-height: 1; width: 1.3em; text-align: center; transition: transform .2s ease; }
@media (min-width: 900px) {
  body { transition: grid-template-columns .2s ease; }
  html[data-nav="mini"] body { grid-template-columns: 76px 1fr; }
  html[data-nav="mini"] .sidenav { padding-left: .4rem; padding-right: .4rem; }
  html[data-nav="mini"] .sidenav-link, html[data-nav="mini"] .sidenav-toggle { justify-content: center; padding-left: 0; padding-right: 0; }
  html[data-nav="mini"] .sidenav-link span, html[data-nav="mini"] .sidenav-toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html[data-nav="mini"] .sidenav-toggle-ico { transform: rotate(180deg); }
}
@media (max-width: 899px) { .sidenav-toggle { display: none; } }
@media (prefers-reduced-motion: reduce) { body { transition: none; } .sidenav-toggle-ico { transition: none; } }


/* Espace client */
body.is-portal:not(.is-minimal) { display: block; }
.portal-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top)); background: var(--bg-bar); color: var(--text-bar); }
.portal-who { display: flex; align-items: center; gap: .6rem; }
.portal-who .muted { color: inherit; opacity: .8; }
.portal-who { min-width: 0; }
.portal-who .muted { min-width: 0; max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.portal-top .btn-ghost { color: var(--text-bar); border-color: rgba(255, 252, 247, .35); }
.portal-nav { display: flex; gap: .3rem; overflow-x: auto; padding: .5rem 1rem; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.portal-link { display: inline-flex; align-items: center; gap: .5rem; padding: .6rem .9rem; min-height: var(--tap); border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 700; white-space: nowrap; }
.portal-link:hover { background: var(--bg-soft); }
.portal-link.is-active { background: var(--primary); color: var(--primary-text); }
.portal-main { max-width: 820px; margin: 0 auto; padding: 1rem; width: 100%; }
.portal-footer { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; justify-content: center; padding: 1.2rem 1rem 2rem; color: var(--muted); font-size: .85rem; }
.portal-guest-box { width: min(100%, 760px); }
.portal-guest-box .login-card { margin: 0 auto; }
.legal h2 { margin-top: 1.4rem; }
.legal ul { padding-left: 1.2rem; }


/* Œil afficher / masquer le mot de passe */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 3.4em; }
.pw-toggle { position: absolute; right: .35em; top: 50%; transform: translateY(-50%); width: 2.7em; height: 2.7em; min-height: 0; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.pw-toggle:hover { background: var(--bg-soft); color: var(--text); }

.offer-row { padding: .8rem 0; border-top: 1px solid var(--border); }
.offer-row.is-muted { opacity: .65; }

/* Groupes de formules : champ avec une petite croix à droite */
.offer-group { margin: .8rem 0 1.2rem; }
.group-head { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.group-field { position: relative; flex: 1; min-width: 14rem; display: block; }
.group-field input { padding-right: 3rem; font-weight: 700; }
.group-x { position: absolute; right: .3rem; top: 50%; transform: translateY(-50%); width: 2.3em; height: 2.3em; min-height: 0; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; }
.group-x:hover { background: var(--tint-danger-bg); color: var(--tint-danger-fg); }

/* Bouton aligné sur le champ (et non sur le bloc étiquette + champ) */
.row-actions.align-end { align-items: flex-end; }

/* Lecteur de vidéo */
.video-dialog { width: min(96vw, 960px); }
.video-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--radius-sm); background: #000; }


/* Résultats : onglets par réseau et graphique */
.results-tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .8rem; }
.results-tab { min-height: var(--tap); padding: .5em 1.1em; border: 2px solid var(--border); border-radius: 999px; background: var(--bg-card); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.results-tab[aria-selected="true"] { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.results-head { flex-wrap: wrap; }
.chart-controls { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-left: auto; }
.metric-toggle { display: flex; gap: .3rem; }
.year-select { width: auto; min-height: 40px; padding: .3em .8em; font-weight: 700; }
.chart { position: relative; margin: .4rem 0; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.chart-svg .axis { stroke: var(--muted); stroke-width: 1.5; }
.chart-svg .tick { fill: var(--muted); font-size: 13px; font-family: var(--font); }
.chart-svg .empty { fill: var(--muted); font-size: 16px; font-family: var(--font); }
.chart-svg .line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .area { fill: var(--accent); opacity: .12; }
.chart-svg .dot { fill: var(--accent); stroke: var(--bg-card); stroke-width: 2; cursor: pointer; }
.chart-svg .dot.is-start { fill: var(--bg-card); stroke: var(--accent); stroke-width: 3; }
.chart-svg .dot:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.chart-tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); background: var(--bg-bar); color: var(--text-bar); padding: .4em .8em; border-radius: var(--radius-sm); font-size: .85rem; pointer-events: none; white-space: nowrap; z-index: 5; display: grid; gap: .1rem; box-shadow: var(--shadow); }
.chart-tip[hidden] { display: none; }
.results-summary { margin: .4rem 0 .8rem; }
.results-history-title { margin-top: 1rem; }
@media (max-width: 560px) { .chart-controls { margin-left: 0; width: 100%; } }


/* Prospection : colonnes un peu plus étroites, défilement horizontal */
.board-prospection .column { flex-basis: 270px; min-width: 250px; }
.board-prospection .kcard-main { gap: .25rem; }


/* Validation des contenus */
.review-box { margin-top: .6rem; padding: .7rem .9rem; border: 2px solid var(--primary); border-radius: var(--radius-sm); background: var(--bg-soft); display: grid; gap: .5rem; }
.review-box.is-ok { border-color: var(--tint-ok-line); background: var(--tint-ok-bg); color: var(--tint-ok-fg); }
.review-box.is-warn { border-color: var(--tint-warn-line); background: var(--tint-warn-bg); color: var(--tint-warn-fg); }
.review-box p { margin: 0; white-space: pre-line; }
.review-history { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: .3rem; }
.review-history li { font-size: .9rem; }
.month-row { padding: .6rem 0; border-top: 1px solid var(--border); }


/* ===== Fenêtres et mobile : tout tient à l'écran, boutons toujours visibles, cibles tactiles >= 44 px ===== */
.board { position: relative; }                       /* les libellés cachés restent dans la zone défilante */
.dialog { max-width: calc(100vw - 1rem); max-height: calc(100dvh - 1rem); overflow: hidden; }
.dialog[open] { display: flex; flex-direction: column; }
.dialog > form, .dialog > .dialog-form { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.dialog-actions { position: sticky; bottom: -1.2rem; margin: 0 -1.2rem -1.2rem; padding: .7rem 1.2rem 1.2rem; background: var(--bg-card); border-top: 1px solid var(--border); z-index: 1; }
.dialog-wide { width: min(96vw, 760px); }
.grid-2.grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.dialog-wide .field { min-width: 0; }
@media (min-width: 720px) { .dialog-wide .grid-2.grid-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-height: 760px) {
  .dialog-form { padding: .9rem 1.1rem; gap: .55rem; }
  .dialog-actions { bottom: -.9rem; margin: 0 -1.1rem -.9rem; padding: .6rem 1.1rem .9rem; }
  .dialog-form h2 { margin-bottom: 0; }
  .dialog-form > p.muted.small, .dialog-form > p:not(.hint):not([data-retouche-name]) { margin-bottom: 0; }
}
@media (max-height: 600px) { .dialog-form > p.muted.small { display: none; } }
.video-dialog { width: min(96vw, 960px, calc((100dvh - 13.5rem) * 16 / 9)); }
@media (max-height: 600px) { .video-dialog { width: min(96vw, 960px, calc((100dvh - 8rem) * 16 / 9)); } }

.brand { display: inline-flex; align-items: center; min-height: 44px; }
.back-link { min-height: 44px; }
input[type="file"] { min-height: 44px; width: 100%; padding: .55em .4em; }
.kcard-move { min-height: 44px; }
.pw-toggle { width: 44px; height: 44px; right: .1em; }
.group-x { width: 42px; height: 42px; }
.portal-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.card-head h2 a { display: inline-flex; align-items: center; min-height: 44px; }
@media (max-width: 600px) { #add-doc-dialog .dialog-form > p.muted.small { display: none; } #add-doc-dialog fieldset { padding: 0; border: 0; margin: 0; } }
.dialog input, .dialog select, .dialog textarea { min-width: 0; max-width: 100%; }


/* Site vitrine : demandes de contact, avis, statistiques */
.nav-count { margin-left: auto; min-width: 1.6em; height: 1.6em; padding: 0 .4em; border-radius: 999px; background: var(--cuivre); color: var(--chocolat); font-size: .8rem; display: inline-grid; place-items: center; }
.request-list, .review-list { display: grid; gap: 1rem; }
.request-card.is-new { border-left: 6px solid var(--cuivre); }
.request-name { font-size: 1.1rem; display: block; margin: 0; }
.request-service { display: flex; align-items: center; gap: .4rem; margin: .6rem 0 0; }
.request-message { margin: .6rem 0; padding: .7rem .9rem; background: var(--bg-soft); border-radius: var(--radius-sm); white-space: normal; overflow-wrap: anywhere; }
.request-contact { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0; }
.request-contact .btn { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.review-card.status-refuse { opacity: .7; }
.review-quote { margin: .6rem 0; padding: .7rem 1rem; border-left: 4px solid var(--cuivre); background: var(--bg-soft); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; overflow-wrap: anywhere; }
.stars { color: var(--cuivre); letter-spacing: .1em; margin: .3rem 0; font-size: 1.1rem; }
.stars span { opacity: .3; }
.kpi-grid { display: grid; gap: .8rem; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 1rem; }
@media (min-width: 900px) { .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.kpi { margin: 0; }
.kpi-label { margin: 0; font-weight: 700; font-size: .9rem; }
.kpi-value { margin: .2rem 0; font-size: 2rem; font-weight: 800; line-height: 1.1; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 160px; padding: 0 .2rem; }
.bar { flex: 1; min-width: 2px; height: max(var(--h), 3px); background: var(--cuivre); border-radius: 3px 3px 0 0; }
.bars-axis { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin: .4rem 0 0; }
.table .num, .table th.num { text-align: right; white-space: nowrap; }

/* Page publique pour laisser un avis */
.review-public { text-align: left; }
.review-public .brand-big { font-size: 1.2rem; letter-spacing: .14em; font-weight: 800; text-align: center; margin: 0 0 1rem; }
.review-public .brand-big span { font-weight: 400; }
.stars-field { border: 0; padding: 0; margin: 0; }
.stars-field legend { font-weight: 700; padding: 0; margin-bottom: .4rem; }
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: .2rem; }
.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-input label { cursor: pointer; width: 56px; height: 56px; display: grid; place-items: center; color: var(--rose-sable, #EAC9BD); }
.star-input label svg { width: 40px; height: 40px; fill: currentColor; stroke: var(--cuivre-fonce, #843F26); stroke-width: 1.2; stroke-linejoin: round; transition: transform .15s ease; }
.star-input label:hover svg { transform: scale(1.12); }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: var(--cuivre, #B87656); }
.star-input input:focus-visible + label { outline: 3px solid var(--focus); border-radius: 12px; }
.thanks { text-align: center; }
.thanks-emoji { font-size: 3.4rem; margin: 0; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
@media (max-width: 600px) { #review-dialog .dialog-form > p.muted.small { display: none; } }

/* Paiement en plusieurs fois */
.installments { border: 1px solid var(--border); border-radius: 12px; padding: .7rem .9rem; }
.installments[hidden], .installments-body[hidden], [data-kind-only][hidden] { display: none; }
.installments-body { margin-top: .6rem; }
.installments-preview { font-weight: 700; margin: .4rem 0 0; }
.installments-preview:empty { display: none; }
.installments-schedule { margin-top: .6rem; }
.installments-schedule .list-item { flex-wrap: wrap; gap: .5rem; }

/* Plusieurs formules sur une fiche : un séparateur entre chacune */
.plan-block + .plan-block { border-top: 1px solid var(--border); margin-top: 1rem; padding-top: 1rem; }
.steps-simple { margin: 0; padding-left: 1.3rem; display: grid; gap: .4rem; }

/* Minuteur de temps de travail */
.timer-pill { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 999px; background: var(--cuivre, #B87656); color: var(--chocolat, #330D04); font-weight: 700; text-decoration: none; font-variant-numeric: tabular-nums; min-height: 36px; }
.timer-pill.is-paused { background: var(--rose-sable, #EAC9BD); }
.timer-big { font-size: 2.4rem; font-weight: 800; font-variant-numeric: tabular-nums; margin: 0; }
.timer-start { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .8rem; }
.time-list .list-item, .week-bars .list-item { flex-wrap: wrap; gap: .5rem; }
.week-bar { flex: 1; min-width: 6rem; height: .6rem; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.week-bar > span { display: block; height: 100%; background: var(--cuivre, #B87656); }

/* Échéances modifiables */
.installments-schedule .list-item { align-items: center; }
.inst-edit { flex-basis: 100%; }
.inst-edit .row-actions .field { min-width: 8rem; flex: 1; margin: 0; }

/* Minuteur sur une fiche vidéo ou un projet */
.timer-widget { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.timer-widget form { margin: 0; }
.page-head-actions { flex-wrap: wrap; justify-content: flex-end; }

/* Paiements modifiables directement dans le formulaire */
.inst-rows { display: grid; gap: .4rem; margin-top: .4rem; }
.inst-row { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.inst-row .field { margin: 0; flex: 1; min-width: 8rem; }
.inst-n { font-weight: 700; min-width: 1.4rem; }
[data-inst-sum].is-off { color: var(--danger, #B3261E); font-weight: 700; }
