:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --ink: #1c2233;
  --ink-2: #3a4152;
  --muted: #777265;
  --line: #e6e0d3;
  --line-2: #d8d0bf;
  --accent: #4b5bd7;
  --accent-ink: #3442b5;
  --accent-soft: #eef0ff;
  --coral: #ef7f7f;
  --ok: #2f8a5b;
  --warn: #b7791f;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 34, 51, .05), 0 6px 24px -12px rgba(28, 34, 51, .18);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
small { font-size: .82em; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ------------------------------------------------------------ barre haute */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem clamp(16px, 4vw, 40px);
  background: rgba(244, 241, 234, .86);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar nav { display: flex; gap: .4rem; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: conic-gradient(from 200deg, #7b8cff, #b48cff, #ff8fa3, #ffb38a, #6fe3d6, #7b8cff);
  box-shadow: inset 0 0 0 5px var(--bg);
}
.save-state { font-size: .82rem; color: var(--muted); display: flex; align-items: center; gap: .4rem; }
.save-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.save-state.pending::before { background: var(--warn); }
.save-state.error { color: #b42318; }
.save-state.error::before { background: #b42318; }

.wrap { max-width: 1040px; margin: 0 auto; padding: clamp(18px, 4vw, 40px) clamp(16px, 4vw, 40px) 80px; }

/* ------------------------------------------------------------ boutons */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: 999px;
  padding: .62rem 1.15rem; font: 500 .92rem/1 var(--sans); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  text-decoration: none; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #fff; }
.btn.primary:hover { background: #2b3350; }
.btn.primary.big { padding: .9rem 1.6rem; font-size: 1rem; background: linear-gradient(135deg, #4b5bd7, #8a5bd7 55%, #e0708a); box-shadow: 0 8px 24px -10px rgba(75, 91, 215, .7); }
.btn.primary.big:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--surface); }
.btn.wide { width: 100%; }
.btn.mic { background: var(--accent-soft); color: var(--accent-ink); border-color: #d9ddff; padding: .6rem 1rem .6rem .8rem; }
.btn.mic:hover { background: #e3e7ff; }
.mic-ico {
  width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(135deg, #4b5bd7, #b06ad6);
  position: relative; flex: none;
}
.mic-ico::before { content: ""; position: absolute; left: 8px; top: 4px; width: 6px; height: 10px; border-radius: 3px; background: #fff; }
.mic-ico::after { content: ""; position: absolute; left: 6px; top: 9px; width: 10px; height: 7px; border: 1.6px solid #fff; border-top: 0; border-radius: 0 0 6px 6px; }
.icon-btn { appearance: none; border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; }
.icon-btn:hover { background: #f0ebe1; color: #b42318; }

/* ------------------------------------------------------------ formulaires */
.field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.field > span { font-size: .78rem; font-weight: 500; color: var(--muted); letter-spacing: .01em; }
.field.inline { flex-direction: row; align-items: center; gap: .5rem; }
.field.inline > span { white-space: nowrap; }
input, select, textarea {
  font: inherit; color: var(--ink); width: 100%;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: .6rem .75rem; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(75, 91, 215, .12); }
.upper input, input.up { text-transform: uppercase; }
.check { display: flex; gap: .6rem; align-items: center; margin-top: 1rem; font-size: .92rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.grid { display: grid; gap: 14px 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span4 { grid-column: 1 / -1; }
@media (max-width: 760px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g2 { grid-template-columns: 1fr; }
  .span4, .g2 .span2 { grid-column: 1 / -1; }
}

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px); margin-bottom: 18px; box-shadow: var(--shadow);
}
.card h2 { font-size: 1.15rem; margin-bottom: 1rem; }

/* ------------------------------------------------------------ accueil */
.hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.hero p { margin: .3rem 0 0; }
.search input { background: var(--surface); margin-bottom: 1rem; padding: .75rem 1rem; border-radius: 12px; }
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list li { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list a { flex: 1; display: grid; grid-template-columns: 1fr auto auto; grid-template-areas: "name badge date" "meta badge date"; gap: 2px 18px; align-items: center; padding: 14px 8px 14px 20px; color: inherit; text-decoration: none; min-width: 0; }
.list a:hover { background: var(--surface-2); }
.li-name { grid-area: name; font-weight: 600; }
.li-meta { grid-area: meta; font-size: .84rem; color: var(--muted); }
.li-date { grid-area: date; font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.badge { grid-area: badge; font-size: .74rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; }
.badge.ok { background: #e3f4ea; color: var(--ok); }
.badge.wip { background: var(--accent-soft); color: var(--accent-ink); }
.badge.draft { background: #f3eee4; color: var(--muted); }
.list .del { margin-right: 10px; }
.empty { text-align: center; padding: 3rem 1rem; color: var(--ink-2); }

/* ------------------------------------------------------------ fiche */
.fiche-title { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 1.2rem; }
.steps { display: flex; gap: 6px; margin-bottom: 1.6rem; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.steps button {
  appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: .45rem .95rem .45rem .45rem; font: 500 .88rem var(--sans); cursor: pointer;
  display: flex; align-items: center; gap: .5rem; white-space: nowrap;
}
.steps button i { font-style: normal; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #f1ece2; font-size: .78rem; }
.steps button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.steps button.active i { background: rgba(255, 255, 255, .16); }
.nav-steps { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; gap: 1rem; }
.intro { color: var(--ink-2); margin: 0 0 1.2rem; max-width: 60ch; }

table.kids { width: 100%; border-collapse: separate; border-spacing: 0 8px; margin-bottom: .5rem; }
table.kids th { text-align: left; font-size: .78rem; font-weight: 500; color: var(--muted); padding: 0 6px; }
table.kids td { padding: 0 6px 0 0; }
table.kids td:last-child { width: 36px; }
.age-col { width: 92px; }
.age { font-size: .85rem; color: var(--muted); white-space: nowrap; }
@media (max-width: 760px) {
  table.kids thead { display: none; }
  table.kids, table.kids tbody, table.kids tr, table.kids td { display: block; width: 100% !important; }
  table.kids tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.kids td { padding: 0; }
}

.dict .dict-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .9rem; flex-wrap: wrap; }
.dict h2 { margin-bottom: .2rem; }
.dict .dict-head p { margin: 0; font-size: .88rem; }
.dict-btns { display: flex; align-items: center; gap: .3rem; }
.visite-meta { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.visite-meta h2 { margin: 0; }
.visite-meta input { width: auto; padding: .45rem .6rem; }
.dict-text { min-height: 72px; background: #fdfcf9; }
.dict-text.flash { animation: flash .9s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 4px rgba(75, 91, 215, .35); } 100% { box-shadow: 0 0 0 4px rgba(75, 91, 215, 0); } }
#add-visite { margin: -4px 0 18px; }

/* ------------------------------------------------------------ studio de dictée */
.studio {
  position: fixed; inset: 0; z-index: 100;
  background:
    radial-gradient(1200px 700px at 50% 35%, rgba(90, 100, 220, .28), transparent 60%),
    radial-gradient(800px 500px at 80% 90%, rgba(239, 127, 127, .14), transparent 60%),
    #0d0f1f;
  color: #eef0ff;
  display: grid; place-items: center;
  animation: studioIn .35s ease;
  overflow-y: auto;
}
@keyframes studioIn { from { opacity: 0; } to { opacity: 1; } }
.studio-inner { width: min(680px, 100%); padding: 28px 20px; display: flex; flex-direction: column; align-items: center; }
.studio-top { width: 100%; display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.studio-label { font-family: var(--serif); font-size: 1.25rem; }
.studio-timer { font-variant-numeric: tabular-nums; font-size: .95rem; color: rgba(238, 240, 255, .7); display: flex; align-items: center; gap: .5rem; }
.studio-timer::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ff5f6d; box-shadow: 0 0 10px #ff5f6d; animation: rec 1.4s ease-in-out infinite; }
.studio.paused .studio-timer::before { background: #8a8fb3; box-shadow: none; animation: none; }
@keyframes rec { 50% { opacity: .35; } }
.orb-wrap { position: relative; display: grid; place-items: center; margin: 4px 0 6px; }
.orb-btn {
  position: absolute; width: 84px; height: 84px; border-radius: 50%;
  border: 0; background: transparent; cursor: pointer; display: grid; place-items: center;
}
.orb-btn span { display: block; transition: opacity .2s; opacity: .9; }
.ico-pause { width: 22px; height: 26px; border-left: 7px solid #fff; border-right: 7px solid #fff; }
.ico-play { width: 0; height: 0; border-style: solid; border-width: 15px 0 15px 25px; border-color: transparent transparent transparent #fff; margin-left: 6px; }
.studio-state { font-size: .92rem; color: rgba(238, 240, 255, .72); min-height: 1.4em; text-align: center; }
.transcript {
  width: 100%; margin-top: 18px; padding: 16px 18px; max-height: 26vh; min-height: 96px; overflow-y: auto;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .09); border-radius: 14px;
  font-size: 1rem; line-height: 1.6; white-space: pre-wrap;
}
.transcript .final { color: #f3f4ff; }
.transcript .interim { color: rgba(200, 205, 255, .55); }
.studio-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; justify-content: center; }
.btn.dark { background: rgba(255, 255, 255, .08); color: #eef0ff; border-color: rgba(255, 255, 255, .14); }
.btn.dark:hover { background: rgba(255, 255, 255, .14); }
.btn.light { background: #fff; color: #14172b; font-weight: 600; }
.btn.light:hover { background: #e9ebff; }
.studio-tip { font-size: .78rem; color: rgba(238, 240, 255, .45); margin: 14px 0 0; }

/* ------------------------------------------------------------ chargement */
.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(244, 241, 234, .82); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; }
.loader-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 32px 30px; max-width: 420px; text-align: center; box-shadow: var(--shadow); }
.loader-card h3 { margin: 18px 0 6px; font-size: 1.25rem; }
.loader-card p { margin: 0; min-height: 3em; }
.loader-orb {
  width: 74px; height: 74px; margin: 0 auto; border-radius: 50%;
  background: conic-gradient(from 0deg, #7b8cff, #b48cff, #ff8fa3, #ffb38a, #6fe3d6, #7b8cff);
  -webkit-mask: radial-gradient(circle, transparent 52%, #000 54%);
  mask: radial-gradient(circle, transparent 52%, #000 54%);
  animation: spin 1.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ rédaction */
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tb-left, .tb-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tb-right input { padding: .45rem .6rem; width: auto; }
.refine { display: flex; gap: 8px; margin-bottom: 8px; }
.refine input { background: var(--surface); }
.hint { font-size: .82rem; color: var(--muted); margin: 0 0 16px; }

.paper-wrap { overflow-x: auto; padding-bottom: 20px; }
.paper {
  width: 794px; min-height: 1123px; margin: 0 auto; background: #fff;
  padding: 40px 72px 80px; box-shadow: 0 2px 4px rgba(0, 0, 0, .06), 0 20px 50px -20px rgba(0, 0, 0, .25);
  font: 14.6px/1.32 Arial, "Liberation Sans", Helvetica, sans-serif; color: #000;
  position: relative;
}
.paper::after { content: ""; display: block; height: 70px; margin: 30px -72px -80px; background: url(doc-pied.jpg) center bottom / 100% auto no-repeat; }
.paper p { margin: 0 0 4px; }
.paper .d-logo { width: 230px; display: block; margin: 0 0 2px -10px; }
.paper .d-pole { color: #548dd4; font-weight: 700; font-size: 10.6px; margin: 0 0 18px 64px; }
.paper .d-title { text-align: center; font-weight: 700; margin: 18px 0 20px; }
.paper .d-center { text-align: center; margin: 18px 0 12px; }
.paper table { border-collapse: collapse; width: 100%; }
.paper .d-id td, .paper .d-grid td { padding: 2px 4px 2px 0; vertical-align: top; }
.paper .d-id { margin-bottom: 12px; }
.paper .d-grid { margin-bottom: 12px; }
.paper .d-kids th, .paper .d-kids td { border: 1px solid #000; padding: 7px 6px; font-weight: 400; text-align: left; }
.paper .d-kids td.c { text-align: center; }
.paper .d-dots { margin: 16px 0; padding-left: 22px; }
.paper .d-h { font-weight: 700; text-decoration: underline; margin: 18px 0 8px; }
.paper .d-tabs { display: grid; grid-template-columns: 1fr 1fr; }
.paper .d-inter { font-weight: 700; text-decoration: underline; margin: 14px 0 4px; }
.paper .d-visite { font-weight: 700; text-decoration: underline; margin: 22px 0 6px; }
.paper .d-prop { font-weight: 700; margin: 10px 0 2px; }
.paper .d-doc { font-weight: 700; margin: 8px 0 4px; }
.paper .d-note { margin-left: 48px; }
.paper .d-concl { margin: 18px 0 12px; }
.paper .d-concl .ed { font-weight: 700; }
.paper ul.d-list { list-style: none; margin: 0 0 4px; padding-left: 48px; }
.paper ul.d-list li { position: relative; margin: 0 0 2px; }
.paper ul.d-list li::before { content: "➢"; position: absolute; left: -24px; font-size: .95em; }
.paper ul.d-list li.sub { margin-left: 48px; }
.paper ul.d-list li.sub::before { content: "-"; left: -16px; }
.paper .d-bilan { margin-top: 6px; }
.paper .d-bilan th, .paper .d-bilan td { border: 1px solid #000; padding: 6px 7px; vertical-align: top; text-align: left; }
.paper .d-bilan th { background: #f2f2f2; }
.paper .d-bilan th:nth-child(1), .paper .d-bilan td:nth-child(1) { width: 22%; }
.paper .d-bilan th:nth-child(2), .paper .d-bilan td:nth-child(2) { width: 46%; }
.paper .d-bilan th:nth-child(3), .paper .d-bilan td:nth-child(3) { width: 32%; }
.paper .d-bilan ul.d-list { padding-left: 22px; }
.paper .d-bilan ul.d-list li::before { left: -20px; }
.paper .d-statut { font: inherit; text-decoration: underline; border: 0; background: transparent; padding: 0; margin: 0 0 6px; width: auto; border-radius: 4px; cursor: pointer; }
.paper .d-statut:hover { background: var(--accent-soft); }
.paper .d-sig { display: grid; grid-template-columns: 1.1fr 1fr .8fr; margin-top: 26px; }

.paper .d-fixed { border-radius: 6px; margin: -4px -8px; padding: 4px 8px; cursor: pointer; transition: background .15s; }
.paper .d-fixed:hover { background: #f6f7ff; box-shadow: inset 0 0 0 1px #dfe3ff; }
.paper .ed { outline: none; border-radius: 3px; transition: background .12s, box-shadow .12s; }
.paper .ed:hover { background: #fffbe8; }
.paper .ed:focus { background: #fff8d6; box-shadow: 0 0 0 2px #f3d36b; }

/* ------------------------------------------------------------ dialogues / connexion */
.dialog { border: 0; border-radius: 18px; padding: 26px; width: min(520px, calc(100% - 32px)); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .35); }
.dialog::backdrop { background: rgba(28, 34, 51, .35); backdrop-filter: blur(3px); }
.dialog h2 { margin-bottom: 1rem; }
.dialog .field { margin-bottom: 1rem; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }

body.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(380px, 100%); background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 34px 28px; box-shadow: var(--shadow); text-align: center; }
.login-card .brand-mark { width: 54px; height: 54px; margin: 0 auto 16px; box-shadow: inset 0 0 0 10px #fff; }
.login-card h1 { font-size: 1.6rem; }
.login-card p { margin: .3rem 0 1.4rem; }
.login-card .field { text-align: left; margin-bottom: 1rem; }
.alert { background: #fdecea; color: #b42318; border-radius: 10px; padding: .6rem .8rem; font-size: .9rem; }

@media (max-width: 860px) {
  .paper { transform-origin: top left; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ------------------------------------------------------------ import, visites figées, toast */
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.drop { display: grid; place-items: center; min-height: 120px; border: 2px dashed var(--line-2); border-radius: 14px; background: var(--surface-2); cursor: pointer; color: var(--ink-2); font-weight: 500; margin: 14px 0; text-align: center; padding: 16px; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.import-progress .bar { height: 6px; background: #eee8dc; border-radius: 99px; overflow: hidden; }
.import-progress .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4b5bd7, #e0708a); transition: width .2s; }
.import-progress p { font-size: .88rem; margin: .6rem 0; }
.import-progress ul { list-style: none; padding: 0; margin: 0 0 1rem; max-height: 220px; overflow: auto; font-size: .82rem; }
.import-progress li { padding: 3px 0; border-bottom: 1px solid var(--line); }
.import-progress li.ok { color: var(--ok); }
.import-progress li.ign { color: var(--muted); }
.import-progress li.err { color: #b42318; }
.sec-title { font-size: 1.05rem; margin: 6px 0 4px; }
.small { font-size: .86rem; margin: 0 0 12px; }
.card.figee { padding: 0; margin-bottom: 10px; }
.card.figee summary { padding: 14px 18px; cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: .6rem; }
.card.figee summary::-webkit-details-marker { display: none; }
.card.figee summary::before { content: "✓"; width: 22px; height: 22px; border-radius: 50%; background: #e3f4ea; color: var(--ok); display: grid; place-items: center; font-size: .75rem; flex: none; }
.card.figee[open] summary { border-bottom: 1px solid var(--line); }
.figee-txt { white-space: pre-wrap; padding: 14px 18px; font-size: .88rem; color: var(--ink-2); max-height: 320px; overflow: auto; }
#figees { margin-bottom: 8px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: .8rem 1.2rem; border-radius: 12px; z-index: 200; box-shadow: var(--shadow); font-size: .92rem; max-width: calc(100% - 32px); transition: opacity .4s, transform .4s; }
.toast.out { opacity: 0; transform: translate(-50%, 10px); }

/* ------------------------------------------------------------ téléphone */
@media (max-width: 760px) {
  body { font-size: 15px; }
  input, select, textarea { font-size: 16px; }           /* évite le zoom auto d'iOS */
  .topbar { padding: .6rem 16px; }
  .topbar nav .btn { padding: .5rem .8rem; font-size: .85rem; }
  .brand { font-size: .95rem; }
  .wrap { padding: 16px 16px 110px; }
  .hero { align-items: stretch; }
  .hero-actions, .hero-actions form, .hero-actions .btn { width: 100%; }
  .hero-actions { flex-direction: column-reverse; }
  .list a { grid-template-columns: 1fr auto; grid-template-areas: "name badge" "meta date"; padding: 12px 6px 12px 14px; }
  .fiche-title { font-size: 1.5rem; margin-bottom: .8rem; }
  .steps { margin: 0 -16px 1.2rem; padding: 0 16px 4px; }
  .steps button { padding: .4rem .8rem .4rem .4rem; font-size: .82rem; }
  .card { padding: 16px; border-radius: 12px; }
  .nav-steps { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(244, 241, 234, .94); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .nav-steps .btn { flex: 1; }
  .nav-steps .btn.big { padding: .8rem 1rem; font-size: .95rem; }
  .dict .dict-head { flex-direction: column; align-items: stretch; }
  .dict .btn.mic { width: 100%; padding: .8rem; font-size: 1rem; }
  .dict-btns { justify-content: space-between; }
  .dict-btns .btn.mic { flex: 1; }
  .visite-meta { gap: .5rem; }
  .visite-meta .field.inline { flex: 1 1 140px; }
  .visite-meta input { width: 100%; }
  .toolbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(244, 241, 234, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .tb-left { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .step[data-step="5"] { padding-bottom: 60px; }
  .tb-right { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .tb-right .field.inline { display: none; }
  .tb-right .btn { width: 100%; }
  .refine { flex-direction: column; }
  .paper-wrap { margin: 0 -16px; overflow-x: hidden; }
  .paper { width: 100%; min-height: 0; padding: 22px 16px 40px; font-size: 13.5px; box-shadow: none; border-top: 1px solid var(--line); }
  .paper::after { margin: 20px -16px -40px; height: 40px; }
  .paper .d-logo { width: 170px; margin-left: 0; }
  .paper .d-pole { margin-left: 48px; }
  .paper .d-id td, .paper .d-grid td { display: block; padding: 1px 0; }
  .paper .d-grid tr { display: block; }
  .paper ul.d-list { padding-left: 26px; }
  .paper ul.d-list li::before { left: -20px; }
  .paper .d-note { margin-left: 20px; }
  .paper .d-tabs, .paper .d-sig { grid-template-columns: 1fr; }
  .paper .d-bilan { table-layout: fixed; font-size: 11.5px; line-height: 1.3; }
  .paper .d-bilan th, .paper .d-bilan td { padding: 4px 4px; word-wrap: break-word; hyphens: auto; }
  .paper .d-bilan th { font-size: 10.5px; hyphens: none; }
  .paper .d-bilan ul.d-list { padding-left: 12px; }
  .paper .d-bilan ul.d-list li::before { left: -12px; font-size: .8em; }
  .paper .d-kids th, .paper .d-kids td { padding: 5px 4px; font-size: 12px; }
  .studio-inner { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); }
  .studio-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr 1.3fr; }
  .studio-actions .btn { padding: .8rem .5rem; }
  .transcript { max-height: 22vh; }
  .toast { bottom: 90px; }
}
.search { display: flex; gap: 8px; margin-bottom: 1rem; }
.search input { margin-bottom: 0; flex: 1; }
.search select { width: auto; background: var(--surface); border-radius: 12px; }
.list li.groupe { display: block; padding: 10px 20px 6px; background: var(--surface-2); font-family: var(--serif); font-weight: 600; font-size: .95rem; color: var(--ink-2); }
@media (max-width: 760px) { .search { flex-direction: column; } .search select { width: 100%; } }

/* ------------------------------------------------------------ téléphone : finitions */
.paper .d-toggle { display: none; }
@media (max-width: 760px) {
  .grid { align-items: end; }
  .steps { gap: 6px; scroll-snap-type: x proximity; }
  .steps button { scroll-snap-align: center; }
  .steps button:not(.active) { padding: .4rem; font-size: 0; gap: 0; }
  .steps button:not(.active) i { font-size: .8rem; width: 30px; height: 30px; }
  .steps button.active { flex: none; }
  .toolbar { position: static; background: none; border: 0; padding: 0; backdrop-filter: none; margin-bottom: 10px; }
  .tb-right { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: rgba(244, 241, 234, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
  .tb-left .btn { padding: .55rem .6rem; font-size: .85rem; }
  .step[data-step="5"] { padding-bottom: 20px; }
  .paper .d-toggle { display: block; width: 100%; margin: 0 0 14px; padding: .7rem; border: 1px dashed var(--line-2); border-radius: 10px; background: var(--surface-2); font: 500 .85rem var(--sans); color: var(--ink-2); cursor: pointer; }
  .paper:not(.entete-ouverte) .d-fixed { display: none; }
  .paper .d-fixed:hover { background: none; box-shadow: none; }
  .dialog { padding: 20px; }
  .list .del { width: 40px; height: 40px; }
}
@media (max-width: 760px) {
  .topbar { gap: .5rem; }
  .brand { min-width: 0; font-size: .9rem; line-height: 1.15; }
  .topbar nav { flex: none; }
}
@media (max-width: 430px) {
  .brand span.brand-txt { display: none; }
}

/* ------------------------------------------------------------ sélection multiple */
.selbar { position: sticky; top: 60px; z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--ink); color: #fff; border-radius: 14px; box-shadow: var(--shadow); }
.selbar #sel-n { font-weight: 600; font-size: .9rem; margin-right: 4px; }
.selbar .btn.ghost { color: #fff; border-color: rgba(255,255,255,.25); padding: .5rem .8rem; font-size: .85rem; }
.selbar .btn.ghost:hover { background: rgba(255,255,255,.1); }
.sel-sep { flex: 1; }
.btn.danger { background: #c2412d; color: #fff; padding: .5rem .9rem; font-size: .85rem; }
.btn.danger-ghost { background: transparent; color: #ffb4a8; border-color: rgba(255,180,168,.4); padding: .5rem .9rem; font-size: .85rem; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.list .sel { display: flex; align-items: center; padding-left: 16px; cursor: pointer; }
.list .sel[hidden] { display: none; }
.list .sel input { width: 22px; height: 22px; accent-color: var(--accent); margin: 0; }
.mode-sel .list .del { display: none; }
.list li.coche { background: var(--accent-soft); }
@media (max-width: 760px) {
  .selbar { top: 56px; }
  .selbar #sel-n { width: 100%; }
  .selbar .btn { flex: 1 1 40%; }
  .sel-sep { display: none; }
}
.bilan-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: linear-gradient(135deg, #fff, #f6f4ff); }
.bilan-card h2 { margin-bottom: .3rem; }
.bilan-card p { margin: 0; max-width: 52ch; font-size: .9rem; }
@media (max-width: 760px) { .bilan-card .btn { width: 100%; padding: .85rem; } .tb-left { grid-template-columns: 1fr 1fr 1fr; } }
.top-right { display: flex; align-items: center; gap: 12px; }
.btn-fiches { padding: .5rem .95rem; }
@media (max-width: 760px) {
  .tb-left .btn { white-space: normal; line-height: 1.15; padding: .5rem .4rem; font-size: .8rem; }
  .btn-fiches { padding: .45rem .8rem; font-size: .85rem; }
  .save-state { font-size: .75rem; }
}
#btn-annuler { background: #fff6e0; border-color: #f0d48a; color: #7a5a00; }
#btn-annuler:hover { background: #ffefc7; }
@media (max-width: 760px) { #btn-annuler { grid-column: 1 / -1; } }
