/* R'Béton — Devis. Mobile d'abord. */
:root {
  --pink: #da4398;
  --pink-d: #b8327d;
  --pink-l: #fbe9f3;
  --grey: #6d6e71;
  --ink: #1f1f22;
  --muted: #6b6b71;
  --line: #e4e4e7;
  --bg: #f4f4f5;
  --card: #fff;
  --ok: #1e7b3c;
  --ok-l: #e7f6ec;
  --warn: #8a5a00;
  --warn-l: #fff4dc;
  --err: #a12626;
  --err-l: #fdecec;
  --blue: #3949ab;
  --blue-l: #eef0fb;
  --r: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--pink); }
.splash { min-height: 100vh; display: grid; place-items: center; }
.splash img { width: 200px; opacity: .9; }

/* --- Structure ---------------------------------------------------------- */
.top {
  position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: calc(var(--safe-t) + 10px) 16px 10px;
  display: flex; align-items: center; gap: 10px; min-height: 56px;
}
.top h1 { font-size: 18px; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top .logo { height: 30px; }
.top .back { border: 0; background: none; color: var(--pink); font-weight: 600; padding: 6px 4px; font-size: 16px; cursor: pointer; }
.top .back-quote { text-decoration: none; background: var(--pink-l); color: var(--pink-d); border-radius: 20px; padding: 7px 12px; font-size: 14.5px; white-space: nowrap; }
.top:has(.back-quote) h1 { font-size: 16px; }
.top .tag { font-size: 12px; color: var(--muted); }
main.view { max-width: 760px; margin: 0 auto; padding: 14px 14px calc(96px + var(--safe-b)); }
main.view.has-bar { padding-bottom: calc(170px + var(--safe-b)); }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(255,255,255,.97); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); display: flex; padding-bottom: var(--safe-b);
}
.tabs a {
  flex: 1; text-align: center; padding: 8px 0 7px; font-size: 11.5px; color: var(--muted); text-decoration: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 500;
}
.tabs a svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tabs a.on { color: var(--pink); }
.tabs .dot { position: absolute; margin-left: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); }

/* --- Cartes et formulaires ---------------------------------------------- */
.card { background: var(--card); border-radius: var(--r); padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.card > h2, .sec-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--pink); margin: 0 0 10px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sec-title { margin: 22px 4px 8px; }
.card > h2 .aside { text-transform: none; letter-spacing: 0; color: var(--muted); font-weight: 500; font-size: 13px; }
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field > label, .lbl { display: block; font-size: 13px; font-weight: 600; color: #4a4a50; margin-bottom: 5px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], input[type=date], input[type=search], input[inputmode], select, textarea {
  width: 100%; padding: 11px 12px; border: 1px solid #d3d3d8; border-radius: 10px; background: #fff; font-size: 16px; outline: none;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b6b71' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
textarea { min-height: 76px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--pink); box-shadow: 0 0 0 3px rgba(218,67,152,.15); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.with-unit { position: relative; }
.with-unit input { padding-right: 52px; }
.with-unit span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 14px; pointer-events: none; }

.seg { display: flex; background: #ececef; border-radius: 11px; padding: 3px; gap: 3px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 9px 6px; border-radius: 9px; font-weight: 600; font-size: 14.5px; color: #55555b; cursor: pointer; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.seg-filter { margin-bottom: 12px; }
.seg-filter button { font-size: 14px; padding: 8px 2px; min-width: 0; white-space: nowrap; }
@media (max-width: 340px) { .seg-filter button { font-size: 12.5px; } }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; cursor: pointer; }
.switch input { display: none; }
.switch i { width: 46px; height: 28px; border-radius: 14px; background: #d6d6db; position: relative; flex: none; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + i { background: var(--pink); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch .t { font-size: 15px; }
.switch .t small { display: block; color: var(--muted); font-size: 12.5px; }

/* --- Boutons --------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 600; cursor: pointer; text-decoration: none; font-size: 15.5px; line-height: 1.2; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-pink { background: var(--pink); color: #fff; }
.btn-pink:active { background: var(--pink-d); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-light { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-soft { background: var(--pink-l); color: var(--pink-d); }
.btn-danger { background: #fff; color: var(--err); border: 1px solid #f0c9c9; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 12px; font-size: 14px; border-radius: 10px; }
.link-btn { border: 0; background: none; color: var(--pink); font-weight: 600; cursor: pointer; padding: 6px 0; font-size: 15px; }
.icon-btn { border: 0; background: #f1f1f3; color: #55555b; width: 36px; height: 36px; border-radius: 10px; display: inline-grid; place-items: center; cursor: pointer; flex: none; font-size: 18px; }
.icon-btn.del { color: var(--err); background: #fbeeee; }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fab { position: fixed; right: 16px; bottom: calc(72px + var(--safe-b)); z-index: 25; border-radius: 28px; padding: 15px 20px; box-shadow: 0 6px 18px rgba(218,67,152,.4); }

/* --- Barre d'actions en bas ------------------------------------------------- */
.bar {
  position: fixed; left: 0; right: 0; bottom: calc(58px + var(--safe-b)); z-index: 24; background: #fff; border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0,0,0,.06); padding: 10px 14px;
}
.bar-in { max-width: 760px; margin: 0 auto; }
.bar .tot { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.bar .tot b { font-size: 22px; color: var(--pink); }
.bar .tot span { color: var(--muted); font-size: 13.5px; }
.bar .acts { display: grid; grid-template-columns: auto 1fr 1.4fr; gap: 8px; }
.saved { font-size: 12px; color: var(--muted); }
/* Clavier ouvert : on masque les barres du bas pour libérer l'écran */
body.kb-open .bar, body.kb-open .tabs, body.kb-open .fab { display: none; }

/* --- Liste des devis --------------------------------------------------------- */
.search { position: relative; margin-bottom: 10px; }
.search input { padding-left: 38px; background: #fff; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: #999; fill: none; stroke-width: 2; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 13px; font-size: 14px; white-space: nowrap; cursor: pointer; color: #45454b; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.qitem { display: flex; gap: 12px; align-items: center; background: #fff; border-radius: var(--r); padding: 13px 14px; margin-bottom: 8px; text-decoration: none; color: inherit; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.qitem .main { flex: 1; min-width: 0; }
.qitem .who { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qitem .sub { font-size: 13px; color: var(--muted); }
.qitem .amt { text-align: right; font-weight: 700; white-space: nowrap; }
.qitem .amt .badge { margin-top: 4px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.s-brouillon { background: #f0f0f2; color: #5d5d63; }
.s-envoye { background: var(--blue-l); color: var(--blue); }
.s-accepte { background: var(--ok-l); color: var(--ok); }
.s-refuse, .s-annule, .s-remplace { background: #f3f3f4; color: #8a8a90; }
.s-expire { background: var(--warn-l); color: var(--warn); }
.empty { text-align: center; color: var(--muted); padding: 40px 20px; }
.empty b { display: block; color: var(--ink); font-size: 17px; margin-bottom: 4px; }

/* --- Alertes ------------------------------------------------------------------- */
.alert { border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; font-size: 14.5px; }
.alert b { display: block; margin-bottom: 2px; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert-warn { background: var(--warn-l); color: var(--warn); }
.alert-err { background: var(--err-l); color: var(--err); white-space: pre-line; }
.alert-ok { background: var(--ok-l); color: var(--ok); }
.alert-info { background: var(--blue-l); color: var(--blue); }
.alert a { color: inherit; font-weight: 600; }

/* --- Lignes du devis -------------------------------------------------------------- */
.line { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.line-head { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.line-head select { flex: 1; }
.line-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 10px; align-items: start; }
.line-grid .stepper, .line-grid .with-unit input { height: 46px; }
.line-grid .stepper input { height: 46px; }
.line-total { display: flex; justify-content: space-between; margin-top: 8px; font-size: 14px; color: var(--muted); }
.line-total b { color: var(--ink); }
.stepper { display: flex; align-items: stretch; }
.stepper button { width: 42px; border: 1px solid #d3d3d8; background: #f7f7f8; font-size: 20px; cursor: pointer; color: #444; }
.stepper button:first-child { border-radius: 10px 0 0 10px; border-right: 0; }
.stepper button:last-child { border-radius: 0 10px 10px 0; border-left: 0; }
.stepper input { border-radius: 0; text-align: center; padding-left: 4px; padding-right: 4px; min-width: 0; }
.qty-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.calcbox { background: #f7f7f8; border-radius: 12px; padding: 12px; margin-top: 10px; font-size: 14.5px; }
.calcbox .big { font-size: 20px; font-weight: 700; color: var(--ink); }
.calcbox .muted { color: var(--muted); font-size: 13px; }
.suggest { border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; overflow: hidden; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.suggest button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 11px 12px; cursor: pointer; font-size: 15px; }
.suggest button:last-child { border-bottom: 0; }
.suggest button small { display: block; color: var(--muted); font-size: 12.5px; }

/* --- Détail d'un devis émis ------------------------------------------------------ */
.qhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.qhead .num { font-size: 21px; font-weight: 700; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { text-align: right; }
.rows .r { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.rows .r small { display: block; color: var(--muted); font-size: 13px; }
.rows .r b { white-space: nowrap; }
.totals .kv { border: 0; padding: 4px 0; }
.totals .ttc { font-size: 19px; font-weight: 700; color: var(--pink); }
.totals .ttc span:first-child { color: var(--pink); }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 20px; font-size: 14px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: var(--pink); }
.timeline li::after { content: ""; position: absolute; left: 7px; top: 16px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline small { display: block; color: var(--muted); font-size: 12.5px; }

/* --- Formules / barème --------------------------------------------------------------- */
.fitem { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; background: #fff; }
.fitem.off { opacity: .6; }
.fitem .fhead { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.fitem .fhead input { font-weight: 700; }
.price-in input { font-size: 20px; font-weight: 700; }
.price-in.missing input { border-color: #f0b35b; background: #fffaf0; }
.band { display: grid; grid-template-columns: 1fr 1.1fr 1fr auto; gap: 8px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line); }
.band:last-of-type { border-bottom: 0; }
.band .lbl { font-size: 12px; }
.band { grid-template-columns: 1fr 1.15fr 1.05fr 36px; gap: 6px; }
.band .with-unit input { padding-left: 9px; padding-right: 26px; }
.band .with-unit span { right: 8px; font-size: 13px; }
.band select { padding-left: 9px; padding-right: 24px; background-position: right 8px center; }
.band .icon-btn { width: 36px; height: 44px; }
.line-grid .with-unit input { padding-right: 30px; }
.line-grid .with-unit span { right: 10px; }
.sim { background: var(--pink-l); border-radius: 12px; padding: 14px; }
.sim .res { font-size: 22px; font-weight: 700; color: var(--pink-d); margin-top: 8px; }
.sim .res small { display: block; font-size: 13px; font-weight: 500; color: #7d3c62; }

/* --- Connexion ------------------------------------------------------------------------- */
.login { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 24px; max-width: 420px; margin: 0 auto; }
.login img { width: 230px; margin: 0 auto 26px; display: block; }
.login h1 { font-size: 21px; text-align: center; margin: 0 0 6px; }
.login p { text-align: center; color: var(--muted); margin: 0 0 20px; }

/* --- Divers ----------------------------------------------------------------------------- */
#toast { position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 24px; font-size: 14.5px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 12px; }
.center { text-align: center; }
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
dialog { border: 0; border-radius: 16px; padding: 20px; max-width: 92vw; width: 420px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20,20,25,.45); }
dialog h3 { margin: 0 0 8px; }
dialog .acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

@media (min-width: 700px) {
  main.view { padding-top: 22px; }
  .tabs { justify-content: center; }
  .tabs a { flex: 0 0 120px; }
}

/* Champ sur une ligne qui s'agrandit si le texte déborde */
textarea.autogrow { min-height: 0; resize: none; overflow: hidden; }

/* Bouton Supprimer dans l'en-tête */
.top-del { display: inline-flex; align-items: center; gap: 5px; border: 1px solid #f0c9c9; background: #fff; color: var(--err); border-radius: 10px; padding: 7px 10px; font-size: 14px; font-weight: 600; cursor: pointer; flex: none; }
.top-del svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Jamais de défilement horizontal : les textes longs (empreintes, e-mails, adresses) passent à la ligne */
html { overflow-x: clip; } /* « clip » et non « hidden » : garde l'en-tête et le panneau collants au défilement */
main.view, .card, .alert, .timeline li, .kv span, .rows .r > div { overflow-wrap: anywhere; min-width: 0; }

/* En-tête de l'éditeur : numéro du devis affiché en entier */
.top:has(.top-del) { gap: 8px; padding-left: 12px; padding-right: 12px; }
.top:has(.top-del) h1 { font-size: 16px; letter-spacing: -.01em; }
.top:has(.top-del) .back { padding: 6px 0; }
.top-del { padding: 7px 9px; font-size: 13.5px; gap: 4px; }

/* --- En-tête et panneau : éléments réservés à l'ordinateur ----------------- */
.top .brand, .topnav, .side-title, .side-detail { display: none; }
.side { display: contents; }
.side-title { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--pink); font-weight: 700; margin-bottom: 6px; }
.top-right { display: contents; }

/* --- Ordinateur ------------------------------------------------------------ */
@media (min-width: 900px) {
  body { background: #efeff1; }
  /* En-tête sur une ligne, identique sur toutes les pages :
     logo et menu calés sur la largeur de la page Devis (liste), 732 px. */
  .top { --wrap: 732px; }
  .top {
    display: grid; grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand . nav";
    align-items: center; column-gap: 0; row-gap: 0; min-height: 0;
    padding: 0 max(16px, calc((100% - var(--wrap)) / 2));
    box-shadow: 0 1px 0 var(--line); background: #fff; backdrop-filter: none;
  }
  .top .logo { display: none; }
  .top .back { display: none; } /* le menu « Devis » fait déjà le retour */
  /* Boutons d'action : dans la bande sous l'en-tête, pour que logo et menu ne bougent jamais */
  .top .back-quote { display: inline-block; grid-row: 2; grid-column: 1 / -1; justify-self: start; margin: 8px 0; position: relative; z-index: 1; }
  .top .brand { display: block; grid-area: brand; justify-self: start; line-height: 0; padding: 10px 0; }
  .top .brand img { height: 46px; }
  .top h1, .top:has(.top-del) h1, .top:has(.back-quote) h1 {
    grid-row: 2; grid-column: 1 / -1; text-align: center; font-size: 18px; margin: 0; padding: 9px 0 10px; background: #fafafb;
    /* bande pleine largeur au-delà de la colonne */
    box-shadow: 0 0 0 100vmax #fafafb; clip-path: inset(0 -100vmax);
  }
  .top-right { display: block; grid-row: 2; grid-column: 1 / -1; justify-self: end; position: relative; z-index: 1; }
  .top:has(.top-del) { padding-left: max(16px, calc((100% - var(--wrap)) / 2)); padding-right: max(16px, calc((100% - var(--wrap)) / 2)); }
  .topnav { display: flex; grid-area: nav; justify-content: flex-end; align-self: stretch; gap: 30px; }
  .topnav a {
    display: flex; align-items: center; gap: 8px; padding: 0 2px; border-top: 3px solid transparent; color: var(--muted); text-decoration: none;
    font-weight: 600; font-size: 15px; border-bottom: 3px solid transparent; transition: color .15s, border-color .15s;
  }
  .topnav a svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .topnav a:hover { color: var(--ink); }
  .topnav a.on { color: var(--pink); border-bottom-color: var(--pink); }
  .tabs { display: none; }

  /* Pages principales : le menu suffit, pas de titre répété */
  .top.is-root h1 { display: none; }

  main.view { padding-top: 28px; }
  .fab { bottom: 28px; right: max(24px, calc(50% - 380px)); }

  /* Deux colonnes : formulaire à gauche, panneau prix/actions à droite qui suit le défilement */
  .layout.with-side {
    display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start;
    max-width: 1160px; margin: 0 auto; padding: 0 28px;
  }
  .layout.with-side main.view { max-width: none; margin: 0; padding: 28px 0 48px !important; }
  .side { display: block; position: sticky; top: calc(var(--head-h, 170px) + 20px); margin-top: 28px; }
  .side .bar {
    position: static; transform: none; width: auto; left: auto; right: auto; bottom: auto;
    border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 6px 24px rgba(0,0,0,.06); padding: 20px;
  }
  .side .bar .bar-in { max-width: none; }
  .side .side-title { display: block; }
  .side .bar .tot { flex-direction: column; align-items: flex-start; gap: 2px; margin-bottom: 14px; }
  .side .bar .tot b { font-size: 30px; }
  .side .bar .tot .right { text-align: left; }
  .side .bar .tot .right #ht, .side .bar .tot .right br { display: none; } /* le HT figure déjà dans le détail */
  .side .side-detail { display: block; border-top: 1px solid var(--line); padding-top: 8px; margin-bottom: 16px; }
  .side .side-detail .kv { font-size: 14.5px; padding: 6px 0; }
  .side .side-detail .kv.strong span { font-weight: 700; color: var(--ink); }
  .side .bar .acts { grid-template-columns: 1fr 1fr; }
  .side .bar .acts #issue { order: -1; grid-column: 1 / -1; padding: 15px; font-size: 16.5px; }
  /* Sur ordinateur, le panneau reste visible pendant la saisie (pas de clavier qui cache l'écran) */
  body.kb-open .side .bar { display: block; }
  #toast { bottom: 150px; }
}

/* Réglages : boutons « Enregistrer » par section sur téléphone, panneau à droite sur ordinateur */
.bar.desktop-only { display: none; }
@media (min-width: 900px) {
  .side .bar.desktop-only { display: block; }
  .sec-save { display: none; }
}

/* Mise en évidence du champ à compléter (lien « À compléter ») */
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 3px var(--pink), 0 1px 2px rgba(0,0,0,.04); } 100% { box-shadow: 0 0 0 0 rgba(218,67,152,0), 0 1px 2px rgba(0,0,0,.04); } }
.flash { animation: flash 2.2s ease-out; }

/* Formules : « Ajouter » en haut de la liste sur téléphone, dans le panneau de droite sur ordinateur */
.desktop-only-btn { display: none; }
@media (min-width: 900px) {
  .mobile-only { display: none; }
  .side .desktop-only-btn { display: flex; margin-bottom: 10px; }
}

/* Formules : texte d'aide et alerte dans le panneau de droite sur ordinateur */
.side-info { display: none; }
@media (min-width: 900px) {
  .side .side-info { display: block; margin-top: 14px; }
  .side .side-info p { margin: 0 0 10px; }
  .side .side-info .alert { margin: 0; }
}

/* Téléphone, pages principales : logo centré, sans titre (les onglets du bas indiquent la page) */
@media (max-width: 899px) {
  .top.is-root { justify-content: center; }
  .top.is-root h1 { display: none; }
  .top.is-root .logo { height: 34px; }
  /* « Devis en cours » : bande sous le logo, pleine largeur (évite de toucher le logo sur petits écrans) */
  .top.is-root:has(.back-quote) { flex-wrap: wrap; row-gap: 8px; }
  .top.is-root .back-quote { order: 2; flex: 1 0 100%; text-align: center; font-size: 14px; padding: 7px 12px; }
}
