/* ------------------------------------------------------------------ *
   My Company.io — feuille de style unique.
   Parti pris : fond blanc, typographie système, une seule couleur d'accent,
   des bordures fines plutôt que des ombres. Lisible en plein soleil sur un
   téléphone de chantier.
 * ------------------------------------------------------------------ */

@font-face {
  font-family: "Manrope"; src: url("/static/fonts/manrope-latin.woff2") format("woff2");
  font-weight: 400 800; font-display: swap;
}
@font-face {
  font-family: "Unbounded"; src: url("/static/fonts/unbounded-latin.woff2") format("woff2");
  font-weight: 500 900; font-display: swap;
}

/* Identité My Company.io : orange chantier, gris chauds, fond très pâle sous des cartes blanches.
   Orange foncé (#c2410c) pour que le texte blanc des boutons reste lisible, même en petit. */
:root {
  --accent: #c2410c;
  --accent-soft: #fff1e8;
  --accent-dark: #9a3412;
  --accent-line: #fed7c3;
  --brand-gradient: linear-gradient(135deg, #f97316, #c2410c);

  --ink: #1c1917;
  --ink-2: #44403c;
  --ink-3: #6f6760;
  --ink-4: #a29a93;

  --bg: #ffffff;
  --bg-soft: #faf8f6;
  --bg-sunk: #f4f1ed;

  --line: #ece7e2;
  --line-strong: #ddd5cd;

  --ok: #17803d;
  --ok-soft: #e9f7ee;
  --warn: #9a6400;
  --warn-soft: #fdf4e3;
  --bad: #be123c;
  --bad-soft: #fdecf0;

  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(20, 18, 31, .04), 0 8px 24px rgba(20, 18, 31, .06);
  --shadow-card: 0 1px 2px rgba(20, 18, 31, .04);

  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Unbounded", "Manrope", -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg-soft);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0; font-weight: 640; letter-spacing: -.011em; line-height: 1.25; }
h1 { font-size: 26px; letter-spacing: -.02em; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 12px; }
small { font-size: 13px; }

hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }

.muted { color: var(--ink-3); }
.dim { color: var(--ink-4); }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .92em; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.stack > * + * { margin-top: 14px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------------------------------------------------------- */
/* Structure applicative                                             */
/* ---------------------------------------------------------------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: none;
  border-right: 1px solid var(--line);
  padding: 18px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--bg);
}

.brand { display: flex; align-items: center; gap: 9px; padding: 0 8px; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; flex: none;
  background: var(--brand-gradient); color: #fff;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 800; font-size: 12px; letter-spacing: -.02em;
  box-shadow: 0 2px 10px rgba(194, 65, 12, .35);
}
.brand-name { font-family: var(--display); font-weight: 700; letter-spacing: -.035em; font-size: 15.5px; color: var(--ink); }

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-group { margin-top: 14px; }
.nav-label {
  font-size: 11px; font-weight: 640; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-4); padding: 0 10px 6px;
}
.nav-more > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px;
  border-radius: 8px; padding-top: 6px;
}
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary::after {
  content: ''; width: 6px; height: 6px; margin-top: -3px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform .15s;
}
.nav-more[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.nav-more > summary:hover { color: var(--ink-2); }
.nav a {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px; border-radius: 8px;
  color: var(--ink-2); font-size: 14.5px; font-weight: 500;
  text-decoration: none;
}
.nav a:hover { background: var(--bg-sunk); color: var(--ink); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.nav a .ico { width: 16px; height: 16px; flex: none; opacity: .75; }
.nav a.active .ico { opacity: 1; }
.nav .badge { margin-left: auto; }

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(8px); z-index: 20;
}
.topbar h1 { font-size: 20px; }
.topbar .sub { color: var(--ink-3); font-size: 13.5px; margin-top: 1px; }

.content { padding: 24px 28px 64px; max-width: 1240px; width: 100%; }
.content.narrow { max-width: 820px; }

.burger { display: none; }

/* ---------------------------------------------------------------- */
/* Cartes, grilles                                                   */
/* ---------------------------------------------------------------- */

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg);
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.card.flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.card-head h2 { font-size: 15.5px; }
.card-body { padding: 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: var(--bg-soft); }

.grid { display: grid; gap: 16px; }
.grid.k2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.k3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.side { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }

.kpi { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 15px 16px; }
.kpi .label { font-size: 12.5px; color: var(--ink-3); font-weight: 520; }
.kpi .value { font-size: 25px; font-weight: 660; letter-spacing: -.025em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.kpi .foot { font-size: 12.5px; color: var(--ink-4); margin-top: 3px; }
.kpi .foot.up { color: var(--ok); }
.kpi .foot.down { color: var(--bad); }

/* ---------------------------------------------------------------- */
/* Tableaux                                                          */
/* ---------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 12px; font-weight: 620; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: .05em;
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-link { color: var(--ink); font-weight: 560; }
.table-link:hover { color: var(--accent); }

.empty { padding: 44px 20px; text-align: center; color: var(--ink-3); }
.empty .big { font-size: 15px; color: var(--ink-2); font-weight: 560; margin-bottom: 4px; }

/* ---------------------------------------------------------------- */
/* Boutons                                                           */
/* ---------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--bg);
  color: var(--ink); font: inherit; font-size: 14px; font-weight: 560;
  cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--bg-sunk); text-decoration: none; }
.btn:active { transform: translateY(.5px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(20, 18, 31, .08), 0 4px 14px rgba(194, 65, 12, .22); }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg-sunk); }
.btn.danger { color: var(--bad); border-color: #f0c6c6; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 7px; }
.btn.lg { padding: 11px 20px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .ico { width: 15px; height: 15px; }

.btn.ai { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.btn.ai:hover { background: #e6e0fd; }

/* ---------------------------------------------------------------- */
/* Formulaires                                                       */
/* ---------------------------------------------------------------- */

.field { display: block; margin-bottom: 14px; }
.field > label, .lbl {
  display: block; font-size: 13px; font-weight: 580; color: var(--ink-2); margin-bottom: 5px;
}
.field .hint { font-size: 12.5px; color: var(--ink-4); margin-top: 4px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=month], input[type=tel], input[type=url], input[type=search],
select, textarea {
  width: 100%; padding: 8px 11px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  font: inherit; font-size: 14.5px; color: var(--ink); background: var(--bg);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.5; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 8l3-3.5' fill='none' stroke='%236b7280' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }
input[type=file] { font-size: 14px; }
input[type=color] { width: 44px; height: 34px; padding: 3px; }
input[type=range] { width: 100%; accent-color: var(--accent); }

.inline-fields { display: flex; gap: 12px; flex-wrap: wrap; }
.inline-fields > .field { flex: 1; min-width: 160px; margin-bottom: 14px; }

.check { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; }
.check input { width: auto; margin-top: 3px; accent-color: var(--accent); }

fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 18px; }
legend { font-size: 13px; font-weight: 620; color: var(--ink-2); padding: 0 6px; }

/* ---------------------------------------------------------------- */
/* Pastilles, badges                                                 */
/* ---------------------------------------------------------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--bg-sunk); color: var(--ink-2);
}
.badge.ok   { background: var(--ok-soft);   color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad  { background: var(--bad-soft);  color: var(--bad); }
.badge.info { background: var(--accent-soft); color: var(--accent-dark); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: var(--bg-sunk); color: var(--ink-2);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 650;
}
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }

.progress { height: 6px; border-radius: 999px; background: var(--bg-sunk); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.progress.ok > span { background: var(--ok); }
.progress.warn > span { background: #d79a1e; }

/* ---------------------------------------------------------------- */
/* Messages                                                          */
/* ---------------------------------------------------------------- */

.flash {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--radius); margin-bottom: 18px;
  font-size: 14px; border: 1px solid;
}
.flash.ok  { background: var(--ok-soft);  border-color: #c6e8d3; color: #10592c; }
.flash.err { background: var(--bad-soft); border-color: #f3c9c9; color: #8c1c1c; }
.flash.info{ background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-dark); }

.note {
  border-left: 3px solid var(--line-strong); padding: 2px 0 2px 12px;
  color: var(--ink-3); font-size: 13.5px;
}
.note.warn { border-left-color: var(--accent); background: var(--accent-soft, #fff7ed); color: var(--ink); padding: 10px 14px; border-radius: 0 10px 10px 0; }
.note.warn a { color: inherit; text-decoration: underline; }

/* ---------------------------------------------------------------- */
/* Panneau IA                                                        */
/* ---------------------------------------------------------------- */

.ai-panel {
  border: 1px solid var(--accent-line); background: linear-gradient(180deg, #faf8ff, #fff);
  border-radius: var(--radius-lg); padding: 16px;
}
.ai-panel .ai-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-size: 13px; font-weight: 640; color: var(--accent-dark);
}
.ai-out {
  white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; max-height: 460px; overflow: auto;
}
.ai-out strong { font-weight: 640; }
.ai-src { font-size: 12px; color: var(--ink-4); margin-top: 8px; }

.disclaimer {
  font-size: 12.5px; color: var(--ink-3); background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px;
}

/* ---------------------------------------------------------------- */
/* Journal & photos                                                  */
/* ---------------------------------------------------------------- */

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ''; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 1px; background: var(--line);
}
.timeline-item { position: relative; padding-bottom: 20px; }
.timeline-item::before {
  content: ''; position: absolute; left: -19px; top: 7px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.timeline-item .when { font-size: 12.5px; color: var(--ink-4); font-weight: 560; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.photo {
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-sunk);
}
.photo img { display: block; width: 100%; height: 118px; object-fit: cover; }
.photo .cap { padding: 7px 9px; font-size: 12px; color: var(--ink-3); }
.photo .cap b { display: block; color: var(--ink-2); font-weight: 580; }

/* ---------------------------------------------------------------- */
/* Planning                                                          */
/* ---------------------------------------------------------------- */

.planning { overflow-x: auto; }
.planning table { min-width: 780px; }
.planning th.day { text-align: center; }
.planning td.cell { padding: 6px; vertical-align: top; min-width: 132px; }
.slotbox {
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px;
  font-size: 12.5px; background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-dark);
  margin-bottom: 5px;
}
.slotbox b { display: block; font-weight: 620; }
.slotbox .h { color: var(--ink-3); font-size: 11.5px; }
.cell-empty { color: var(--ink-4); font-size: 12px; padding: 6px 8px; }

/* ---------------------------------------------------------------- */
/* Éditeur de devis                                                  */
/* ---------------------------------------------------------------- */

.lines th { font-size: 11.5px; }
.lines td { padding: 6px 8px; }
.lines input, .lines select, .lines textarea { font-size: 14px; padding: 6px 8px; }
.lines .drag { cursor: grab; color: var(--ink-4); user-select: none; }
.lines tr.section-row td { background: var(--bg-sunk); font-weight: 620; }
.lines .w-qty { width: 88px; }
.lines .w-unit { width: 78px; }
.lines .w-price { width: 116px; }
.lines .w-vat { width: 92px; }
.lines .w-total { width: 112px; }
.lines .w-act { width: 40px; }

.totals { margin-left: auto; width: 320px; }
.totals .line { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.totals .line.grand {
  border-top: 1px solid var(--line-strong); margin-top: 7px; padding-top: 10px;
  font-size: 17px; font-weight: 660;
}
.totals .line .k { color: var(--ink-3); }

/* ---------------------------------------------------------------- */
/* Page publique                                                     */
/* ---------------------------------------------------------------- */

.pub-nav {
  display: flex; align-items: center; gap: 22px;
  padding: 16px 32px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(255,255,255,.9);
  backdrop-filter: saturate(180%) blur(10px); z-index: 30;
}
.pub-nav .links { display: flex; gap: 20px; margin-left: 28px; }
.pub-nav .links a { color: var(--ink-2); font-size: 14.5px; font-weight: 520; }
.pub-nav .links a:hover { color: var(--ink); text-decoration: none; }
.pub-nav .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.hero { padding: 84px 0 64px; text-align: center; }
.hero h1 {
  font-size: 50px; line-height: 1.08; letter-spacing: -.035em;
  max-width: 17ch; margin: 0 auto 18px;
}
.hero p.lede {
  font-size: 18.5px; color: var(--ink-2); max-width: 60ch; margin: 0 auto 28px; line-height: 1.55;
}
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .fine { margin-top: 14px; font-size: 13px; color: var(--ink-4); }

.eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--accent-soft); color: var(--accent-dark);
  padding: 4px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 620; margin-bottom: 20px;
}

.section { padding: 64px 0; border-top: 1px solid var(--line); }
.section-head { text-align: center; max-width: 62ch; margin: 0 auto 40px; }
.section-head h2 { font-size: 32px; letter-spacing: -.028em; margin-bottom: 12px; }
.section-head p { color: var(--ink-2); font-size: 16.5px; }

.feature { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.feature .ico-box {
  width: 34px; height: 34px; border-radius: 9px; background: var(--accent-soft);
  color: var(--accent-dark); display: grid; place-items: center; margin-bottom: 13px;
}
.feature h3 { font-size: 15.5px; margin-bottom: 6px; }
.feature p { color: var(--ink-3); font-size: 14px; margin: 0; }

.price-card {
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px 22px;
  display: flex; flex-direction: column;
}
.price-card.featured { border-color: var(--accent); border-width: 1.5px; position: relative; }
.price-card .tag {
  position: absolute; top: -11px; left: 22px;
  background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 640;
  padding: 3px 10px; border-radius: 999px;
}
.price-card h3 { font-size: 17px; }
.price-card .who { color: var(--ink-3); font-size: 13.5px; margin: 5px 0 16px; min-height: 38px; }
.price-card .amount { font-size: 38px; font-weight: 680; letter-spacing: -.035em; }
.price-card .per { color: var(--ink-3); font-size: 14px; font-weight: 500; }
.price-card .billed { color: var(--ink-4); font-size: 12.5px; margin-top: 3px; min-height: 19px; }
.price-card ul { list-style: none; padding: 0; margin: 20px 0 22px; display: flex; flex-direction: column; gap: 9px; }
.price-card li { display: flex; gap: 9px; font-size: 14px; color: var(--ink-2); align-items: flex-start; }
.price-card li svg { flex: none; margin-top: 3px; color: var(--ok); }
.price-card .btn { margin-top: auto; }

/* ---------------------------------------------------------------- */
/* Tarifs, prix fondateur et paywall                                 */
/* ---------------------------------------------------------------- */

.founder {
  display: flex; gap: 18px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  border: 1.5px solid var(--accent); background: var(--accent-soft); border-radius: var(--radius-lg);
  padding: 14px 18px; margin: 0 auto 22px; max-width: 1080px;
}
.founder-text { display: grid; gap: 2px; }
.founder-text strong { display: inline-flex; gap: 7px; align-items: center; color: var(--accent-dark); font-size: 15px; }
.founder-text span { font-size: 13.5px; color: var(--ink-2); }
.founder-meter { display: grid; gap: 6px; min-width: 190px; }
.founder-left { font-size: 13px; color: var(--ink-2); }
.founder-left b { font-size: 16px; color: var(--ink); font-variant-numeric: tabular-nums; }
.founder-bar { height: 6px; border-radius: 999px; background: #ddd5fd; overflow: hidden; }
.founder-bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

.period {
  display: flex; width: max-content; max-width: 100%; margin: 0 auto 22px;
  background: var(--bg-sunk); border-radius: 999px; padding: 4px; gap: 2px;
}
.period input { position: absolute; opacity: 0; pointer-events: none; }
.period label {
  padding: 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 580; color: var(--ink-3);
  cursor: pointer; display: inline-flex; gap: 8px; align-items: center;
}
.period input:checked + label { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgba(15,17,21,.08); }
.period input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 1px; }
.period .gift { font-size: 11.5px; font-weight: 660; color: var(--ok); background: var(--ok-soft); padding: 2px 8px; border-radius: 999px; }

.billing:has(input[name=period][value=annuel]:checked) .when-mensuel,
.billing:has(input[name=period][value=mensuel]:checked) .when-annuel { display: none; }
.price-line { display: flex; align-items: baseline; gap: 2px; flex-wrap: wrap; }
.price-line .was { margin-left: 8px; color: var(--ink-4); font-size: 15px; }
.price-card .billed b { color: var(--ok); font-weight: 600; }
.price-card .seats { font-size: 12.5px; margin-bottom: 14px; }
.billing-fine { text-align: center; color: var(--ink-3); font-size: 13.5px; margin-top: 18px; }

/* Cartes sélectionnables du paywall */
.price-card.pick { cursor: pointer; position: relative; transition: border-color .12s, box-shadow .12s; }
.price-card.pick > input { position: absolute; opacity: 0; pointer-events: none; }
.price-card.pick .pick-mark {
  margin-top: auto; display: flex; justify-content: center; align-items: center; gap: 6px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 8px; font-size: 13.5px;
  font-weight: 600; color: var(--ink-3);
}
.price-card.pick .pick-mark svg { visibility: hidden; }
.price-card.pick:has(> input:checked) { border-color: var(--accent); border-width: 1.5px; box-shadow: 0 0 0 4px var(--accent-soft); }
.price-card.pick:has(> input:checked) .pick-mark { background: var(--accent); border-color: var(--accent); color: #fff; }
.price-card.pick:has(> input:checked) .pick-mark svg { visibility: visible; }
.price-card.pick:has(> input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.price-card.pick:not(:has(> input:checked)) .pick-mark::before { content: attr(data-choose); }
.price-card.pick:not(:has(> input:checked)) .pick-mark { font-size: 0; }
.price-card.pick:not(:has(> input:checked)) .pick-mark::before { font-size: 13.5px; }

.paywall-head { display: grid; gap: 8px; justify-items: start; margin-bottom: 18px; }
.paywall-head h2 { font-size: 24px; letter-spacing: -.02em; }
.paywall-head p { margin: 0; color: var(--ink-2); max-width: 64ch; }

.usage { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 22px; }
.usage > div { background: var(--bg); padding: 12px 16px; display: grid; gap: 1px; }
.usage strong { font-size: 20px; font-weight: 680; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.usage span { font-size: 12.5px; color: var(--ink-3); }
.usage.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 14px 0; }

.checkout { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.checkout .lbl { margin-bottom: 8px; }
.method {
  display: inline-flex; gap: 8px; align-items: center; border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 9px 14px; font-size: 14px; font-weight: 560; cursor: pointer;
}
.method:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

.sub-active { max-width: 620px; display: grid; gap: 4px; }
.upsell {
  margin-top: 14px; display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  background: var(--ok-soft); border-radius: var(--radius); padding: 12px 14px;
}
.upsell span { display: block; font-size: 13px; }

.sub-banner {
  display: flex; gap: 12px; align-items: center; padding: 10px 28px; font-size: 14px; border-bottom: 1px solid;
}
.sub-banner.warn { background: var(--warn-soft); color: var(--warn); border-color: #f1dcb0; }
.sub-banner.bad { background: var(--bad-soft); color: var(--bad); border-color: #f3c9c9; }
.sub-banner strong { font-weight: 640; }

/* Tableau comparatif des formules */
.cmp-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--bg); }
.cmp { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14px; }
.cmp th, .cmp td { padding: 11px 16px; border-top: 1px solid var(--line); text-align: center; }
.cmp thead th { border-top: 0; font-size: 15px; font-weight: 660; vertical-align: bottom; }
.cmp thead th small { display: block; font-size: 12px; font-weight: 520; color: var(--ink-3); margin-top: 2px; }
.cmp th[scope=row] { text-align: left; font-weight: 520; color: var(--ink-2); }
.cmp .cmp-group th { text-align: left; background: var(--bg-sunk); font-size: 12px; font-weight: 660; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); }
.cmp .hl { background: var(--accent-soft); }
.cmp thead .hl { color: var(--accent-dark); }
.cmp-yes { color: var(--ok); display: inline-grid; place-items: center; }
.cmp-no { color: var(--ink-4); }
.cmp-text { font-weight: 600; }
.cmp-soon { font-size: 11.5px; font-weight: 640; color: var(--ink-3); background: var(--bg-sunk); padding: 2px 8px; border-radius: 999px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cmp-details > summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 6px 0; }
.cmp-details[open] > summary { margin-bottom: 12px; }

/* Fonction non incluse dans la formule */
.locked { max-width: 560px; margin: 24px auto; text-align: center; display: grid; gap: 14px; justify-items: center; }
.locked-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-dark); }
.locked h2 { font-size: 22px; letter-spacing: -.02em; }
.locked p { margin: 0; color: var(--ink-2); }
.locked ul { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 7px; text-align: left; }
.locked li { display: flex; gap: 8px; align-items: center; font-size: 14.5px; }
.locked li svg { color: var(--ok); flex: none; }
.upgrade { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.upgrade form { margin: 0; }
.flash.warn { background: var(--warn-soft); border-color: #f1dcb0; color: var(--warn); }
.nav a.locked { color: var(--ink-3); }
.nav-lock { color: var(--ink-4); display: inline-grid; }

/* Calculateur de rentabilité */
.roi { border: 1.5px solid var(--accent); border-radius: var(--radius-lg); padding: 24px; display: grid; gap: 18px; }
.roi-head h2 { font-size: 24px; letter-spacing: -.02em; margin-bottom: 6px; }
.roi-head p { margin: 0; color: var(--ink-2); }
.roi-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.roi-inputs label { display: grid; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.roi-out { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.roi-out > div { background: var(--bg-sunk); padding: 14px 16px; display: grid; gap: 2px; }
.roi-out small { font-size: 12.5px; color: var(--ink-3); font-weight: 560; }
.roi-out strong { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.roi-out .hl strong { color: var(--ok); }
.roi-note { margin: 0; font-size: 13px; color: var(--ink-4); }

@media (max-width: 860px) {
  .usage { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .roi-inputs, .roi-out { grid-template-columns: minmax(0, 1fr); }
  .sub-banner { padding: 10px 16px; flex-wrap: wrap; }
  .checkout .btn { width: 100%; justify-content: center; }
}

.faq-item { border-bottom: 1px solid var(--line); padding: 18px 0; }
.faq-item h3 { font-size: 15.5px; margin-bottom: 6px; }
.faq-item p { color: var(--ink-3); font-size: 14.5px; margin: 0; }

/* ---------------------------------------------------------------- */
/* Tableau de bord orienté action                                    */
/* ---------------------------------------------------------------- */

.dash-briefing { font-size: 19px; line-height: 1.45; letter-spacing: -.012em; color: var(--ink-2); margin: 0 0 16px; }
.dash-briefing strong { color: var(--ink); }

.dash-quick {
  border: 1.5px solid var(--accent); border-radius: var(--radius-lg);
  background: var(--accent-soft); padding: 14px 16px; margin-bottom: 26px;
}
.dash-quick label {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 8px;
  font-size: 12.5px; font-weight: 660; color: var(--accent-dark);
  text-transform: uppercase; letter-spacing: .04em;
}
.dash-quick-row { display: flex; gap: 10px; align-items: stretch; }
.dash-quick textarea {
  flex: 1; min-width: 0; resize: vertical; min-height: 44px;
  font: inherit; font-size: 15px; padding: 10px 12px;
  border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--bg);
}
.dash-quick textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.dash-quick .btn { white-space: nowrap; }

/* Liste de démarrage : disparaît quand les 5 étapes sont faites. */
.start-list { margin-bottom: 22px; padding: 16px 18px; }
.start-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.start-head h2 { font-size: 15.5px; }
.start-count { font-weight: 760; color: var(--accent-dark); }
.start-bar { height: 6px; border-radius: 99px; background: var(--bg-sunk); overflow: hidden; margin-bottom: 10px; }
.start-bar span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.start-list ol { list-style: none; margin: 0; padding: 0; }
.start-list li a {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px; min-height: 48px;
  border-radius: var(--radius); color: var(--ink-2); text-decoration: none;
}
.start-list li a:hover { background: var(--bg-soft); }
.start-tick {
  flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--line-strong); color: #fff;
}
.start-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.start-text strong { font-weight: 640; font-size: 14.5px; }
.start-text small { color: var(--ink-3); font-size: 12.5px; }
.start-list li.done .start-tick { background: var(--ok); border-color: var(--ok); }
.start-list li.done strong { color: var(--ink-4); text-decoration: line-through; font-weight: 520; }
.start-list li.next a { background: var(--accent-soft); color: var(--ink); }
.start-list li a.start-alt { background: none; display: inline-flex; gap: 4px; min-height: 0; padding: 4px 10px 8px 44px; font-size: 13px; color: var(--accent-dark); text-decoration: underline; text-underline-offset: 2px; }
.start-list li.next .start-tick { border-color: var(--accent); }
.start-list li.next svg { color: var(--accent); }

.dash-section-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.dash-section-title h2 { font-size: 15.5px; }

/* Où dort ton argent : 4 étapes, de la signature à l'encaissement. */
.dash-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 22px; }
.flow-step {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px;
  color: inherit; background: var(--bg); transition: border-color .12s;
}
.flow-step:hover { text-decoration: none; border-color: var(--line-strong); }
.flow-label { font-size: 12.5px; font-weight: 600; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.flow-count {
  font-size: 11.5px; font-weight: 640; background: var(--bg-sunk); color: var(--ink-2);
  border-radius: 999px; padding: 0 7px; line-height: 18px;
}
.flow-amount { font-size: 26px; font-weight: 680; letter-spacing: -.028em; font-variant-numeric: tabular-nums; }
.flow-bar { height: 6px; border-radius: 999px; background: var(--bg-sunk); overflow: hidden; }
.flow-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--ink-4); }
.flow-hint { font-size: 12.5px; color: var(--ink-4); }
.flow-sign .flow-bar > span { background: #a695f5; }
.flow-invoice .flow-bar > span { background: var(--accent); }
.flow-cash .flow-bar > span { background: #d79a1e; }
.flow-done .flow-bar > span { background: var(--ok); }
.flow-invoice .flow-amount { color: var(--accent-dark); }
.flow-done .flow-amount { color: var(--ok); }
.flow-step.alert { border-color: #f3c9c9; }
.flow-step.alert .flow-hint { color: var(--bad); font-weight: 560; }
.flow-arrow {
  position: absolute; right: -13px; top: 50%; transform: translateY(-50%); z-index: 1;
  width: 14px; display: grid; place-items: center; color: var(--ink-4);
}

.dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }

/* À faire aujourd'hui */
.actions { list-style: none; margin: 0; padding: 0; }
.action {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  padding: 12px 18px; border-top: 1px solid var(--line);
}
.action:first-child { border-top: 0; }
.action form { margin: 0; }
.action-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; }
.tone-bad .action-ico  { background: var(--bad-soft);  color: var(--bad); }
.tone-warn .action-ico { background: var(--warn-soft); color: var(--warn); }
.tone-ok .action-ico   { background: var(--ok-soft);   color: var(--ok); }
.action-text { min-width: 0; }
.action-text strong { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-text span { display: block; font-size: 12.5px; color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.action-amount { font-weight: 640; font-size: 14px; white-space: nowrap; }

.dash-zero { display: flex; gap: 14px; align-items: flex-start; font-size: 14px; }
.dash-zero > svg { color: var(--ok); flex: none; margin-top: 2px; }

/* Santé des chantiers */
.site-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-card {
  display: flex; flex-direction: column; gap: 9px; padding: 16px 18px; color: inherit;
  border-top: 1px solid var(--line); min-width: 0;
}
.site-card:nth-child(odd) { border-right: 1px solid var(--line); }
.site-card:nth-child(-n+2) { border-top: 0; }
.site-card:hover { text-decoration: none; background: var(--bg-soft); }
.site-top { display: flex; gap: 10px; align-items: flex-start; }
.site-top strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-top .dim { display: block; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health { font-size: 11.5px; font-weight: 640; border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.health.ok   { background: var(--ok-soft);   color: var(--ok); }
.health.warn { background: var(--warn-soft); color: var(--warn); }
.health.bad  { background: var(--bad-soft);  color: var(--bad); }
.site-bar { position: relative; height: 8px; border-radius: 999px; background: var(--bg-sunk); }
.site-bar .fill { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.site-bar .fill.ok { background: var(--ok); }
.site-bar .fill.warn { background: #d79a1e; }
.site-bar .fill.bad { background: var(--bad); }
.site-bar .marker {
  position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px;
  background: var(--ink); border-radius: 1px;
}
.site-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--ink-3); }
.site-signal { font-size: 12.5px; color: var(--warn); display: flex; gap: 6px; align-items: flex-start; }
.site-signal svg { flex: none; margin-top: 2px; }

@media (max-width: 1080px) {
  .dash-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .dash-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-arrow { display: none; }
  .flow-amount { font-size: 22px; }
  .site-grid { grid-template-columns: minmax(0, 1fr); }
  .site-card:nth-child(odd) { border-right: 0; }
  .site-card:nth-child(2) { border-top: 1px solid var(--line); }
  .dash-briefing { font-size: 17px; }
}
@media (max-width: 560px) {
  .dash-quick-row { flex-direction: column; }
  .action { grid-template-columns: auto minmax(0, 1fr); padding: 12px 16px; }
  .action-amount { grid-column: 2; }
  .action > form, .action > a.btn { grid-column: 1 / -1; }
  .action > form .btn, .action > a.btn { width: 100%; justify-content: center; }
}

.footer { border-top: 1px solid var(--line); padding: 34px 0; color: var(--ink-4); font-size: 13.5px; }
.footer .cols { display: flex; gap: 48px; flex-wrap: wrap; justify-content: space-between; }

.auth-wrap { max-width: 400px; margin: 0 auto; padding: 60px 24px 80px; }
.auth-wrap h1 { font-size: 24px; margin-bottom: 6px; }
.auth-wrap .sub { color: var(--ink-3); margin-bottom: 26px; font-size: 14.5px; }
.oauth { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.oauth .btn { gap: 10px; justify-content: center; }
.oauth-google { background: #fff; color: #1f1f1f; border: 1px solid #dadce0; }
.oauth-google:hover { background: #f8f9fa; }
.oauth-apple { background: #000; color: #fff; border: 1px solid #000; }
.oauth-apple:hover { background: #1c1c1c; color: #fff; }
.oauth-or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin-top: 6px; }
.oauth-or::before, .oauth-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---------------------------------------------------------------- */
/* Impression (devis / factures)                                     */
/* ---------------------------------------------------------------- */

.paper {
  max-width: 820px; margin: 24px auto; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 44px;
}
.paper .doc-head { display: flex; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.paper .doc-title { font-size: 25px; font-weight: 680; letter-spacing: -.02em; }
.paper .party { font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.paper .party b { color: var(--ink); }
.paper table { margin: 22px 0; }
.paper th { background: var(--bg-sunk); }
.paper .legal { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; margin-top: 30px; border-top: 1px solid var(--line); padding-top: 16px; }

@media print {
  .no-print, .sidebar, .topbar, .pub-nav { display: none !important; }
  body { font-size: 12px; }
  .paper { border: 0; margin: 0; padding: 0; max-width: none; }
  .content { padding: 0; }
  a { color: inherit; text-decoration: none; }
}

/* ---------------------------------------------------------------- */
/* Robustesse de mise en page                                        */
/* ---------------------------------------------------------------- */

/* Rien ne doit déborder du cadre, quelle que soit la largeur. */
.main, .content, .card, .grid { min-width: 0; max-width: 100%; }
.row, .row.wrap { min-width: 0; }
.btn { max-width: 100%; }
.badge { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
.ai-out, .note, .disclaimer { overflow-wrap: anywhere; }
.card-head { flex-wrap: wrap; }
.card-head h2 { min-width: 0; }

/* La barre de titre passe à la ligne plutôt que de pousser la page. */
.topbar { flex-wrap: wrap; row-gap: 8px; }
.topbar > .grow { min-width: 0; }
.topbar .row.wrap { margin-left: auto; }

/* Colonnes secondaires : on les retire quand la place manque, plutôt que
   d'imposer un défilement horizontal dans chaque tableau. */
@media (max-width: 1040px) { .opt2 { display: none; } }
@media (max-width: 760px)  { .opt  { display: none; } }

/* L'éditeur de lignes reste lisible : il défile dans son propre cadre. */
table.lines { min-width: 1040px; }
table.lines th:nth-child(2), table.lines td:nth-child(2) { min-width: 320px; }
td.num, th.num, .kpi .value { white-space: nowrap; }

@media (max-width: 620px) {
  .topbar .row.wrap { margin-left: 0; width: 100%; }
  .topbar .row.wrap > .btn,
  .topbar .row.wrap > form,
  .topbar .row.wrap > select { flex: 1 1 auto; }
  .content > .row.wrap > form.row { width: 100%; max-width: none; }
}
@media (max-width: 520px) {
  .btn { white-space: normal; text-align: center; }
  .content .row.wrap { row-gap: 6px; }
}

/* ---------------------------------------------------------------- */
/* Adaptatif                                                         */
/* ---------------------------------------------------------------- */

@media (max-width: 1080px) {
  .grid.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.side { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 60;
    transform: translateX(-100%); transition: transform .18s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after {
    content: ''; position: fixed; inset: 0; background: rgba(15,17,21,.32); z-index: 50;
  }
  .burger { display: inline-flex; }
  .topbar { padding: 12px 16px; }
  .content { padding: 18px 16px 72px; }
  .grid.k3, .grid.k2 { grid-template-columns: minmax(0, 1fr); }
  .hero { padding: 52px 0 40px; }
  .hero h1 { font-size: 34px; }
  .hero p.lede { font-size: 16.5px; }
  .section { padding: 44px 0; }
  .section-head h2 { font-size: 25px; }
  .pub-nav { padding: 12px 16px; }
  .pub-nav .links { display: none; }
  .paper { padding: 22px; margin: 12px; }
  .totals { width: 100%; }
}

@media (max-width: 560px) {
  .grid.k4 { grid-template-columns: minmax(0, 1fr); }
  h1 { font-size: 22px; }
}

/* Cartes de prix : fonctions incluses (coche verte) et non incluses (croix rouge, barré) */
.price-card ul.feat li.no { color: var(--ink-4); }
.price-card ul.feat li.no svg { color: var(--bad); }
.price-card ul.feat li.no span:last-child { text-decoration: line-through; text-decoration-color: rgba(192, 38, 38, .55); }

/* Pages légales */
.legal h2 { font-size: 19px; margin: 30px 0 10px; }
.legal p, .legal li { color: var(--ink-2); line-height: 1.65; }
.legal ul { padding-left: 20px; }
mark.todo { background: var(--bad-soft); color: var(--bad); padding: 1px 6px; border-radius: 4px; font-weight: 600; }

/* Signature du devis en ligne */
.sign-top { max-width: 820px; margin: 16px auto 0; padding: 0 16px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: 14.5px; }
.sign-box { margin-top: 34px; border: 1.5px solid var(--accent); border-radius: 12px; padding: 18px; display: grid; gap: 10px; background: var(--accent-soft); }
.sign-box b { font-size: 15px; }
.sign-box p { margin: 0; font-size: 14px; }
.sign-box label[for] { font-size: 13px; font-weight: 600; }
.sign-box.closed { border-color: var(--line-strong); background: var(--bg-sunk); color: var(--ink-2); font-size: 14px; }
.signed-box { margin-top: 34px; border: 1.5px solid var(--ok); border-radius: 10px; padding: 14px; font-size: 13px; background: var(--ok-soft); color: #10592c; display: grid; gap: 4px; }
.share-card { margin-bottom: 16px; border-color: var(--accent); }
.share-link { font-size: 13px; padding: 10px 12px; background: var(--bg-sunk); border-radius: 8px; overflow-wrap: anywhere; }

/* Typographie de marque : Unbounded pour les chiffres clés et les grands titres, avec retenue. */
.flow-amount, .price-card .amount, .kpi .value, .usage strong, .roi-out strong { font-family: var(--display); font-weight: 700; letter-spacing: -.045em; }
.section-head h2, .auth-wrap h1, .locked h2, .paywall-head h2, .dash-section-title h2, .roi-head h2, .legal h1 {
  font-family: var(--display); font-weight: 700; letter-spacing: -.04em;
}
.section-head h2 { font-size: 30px; }
.paywall-head h2 { font-size: 22px; }
.topbar h1 { font-weight: 800; letter-spacing: -.025em; }

/* Application installable */
.install-btn { margin-bottom: 8px; border-color: var(--accent-line); color: var(--accent-dark); background: var(--accent-soft); }
.install-ios { font-size: 12px; color: var(--ink-3); margin: 0 0 8px; padding: 8px 10px; border-radius: 8px; background: var(--bg-sunk); }

/* L'attribut hidden gagne toujours, même sur .btn (display: inline-flex). */
[hidden] { display: none !important; }

/* Barre d'onglets du bas (téléphone) : zones tactiles de 44 px minimum, bouton devis au centre. */
.tabbar { display: none; }
@media (max-width: 860px) {
  .tabbar {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, .96); backdrop-filter: saturate(180%) blur(10px);
    border-top: 1px solid var(--line);
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 48px; border: 0; background: none; font: inherit; cursor: pointer;
    color: var(--ink-3); font-size: 11px; font-weight: 600; text-decoration: none; border-radius: 12px;
  }
  .tab:hover { text-decoration: none; }
  .tab.active { color: var(--accent-dark); }
  .tab-main {
    width: 56px; height: 56px; margin: -22px auto 0; border-radius: 18px; color: #fff;
    background: var(--brand-gradient); box-shadow: 0 8px 22px rgba(194, 65, 12, .4);
  }
  .content { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
  .burger { display: none; }
}

/* Dictée vocale */
.btn.dictate { gap: 6px; }
.btn.dictate.listening { background: var(--bad-soft); border-color: #f3c9c9; color: var(--bad); animation: dictate-pulse 1.2s ease-in-out infinite; }
@keyframes dictate-pulse { 50% { box-shadow: 0 0 0 6px rgba(192, 38, 38, .12); } }
@media (prefers-reduced-motion: reduce) { .btn.dictate.listening { animation: none; } }
.ai-head.spread { margin-bottom: 8px; }

/* ---------------------------------------------------------------- */
/* Page terrain « Ma journée » et photos du journal de chantier      */
/* ---------------------------------------------------------------- */

.day-form { display: grid; gap: 14px; margin-bottom: 16px; }
.day-form h2 { font-size: 17px; }
.day-form textarea, .day-form input, .day-form select { font-size: 16px; padding: 12px; }
/* Gros bouton appareil photo : le geste principal, utilisable avec un gant. */
.camera {
  display: grid; justify-items: center; gap: 4px; padding: 22px 16px; min-height: 120px; text-align: center; cursor: pointer;
  border: 2px dashed var(--accent-line); border-radius: var(--radius-lg); background: var(--accent-soft); color: var(--accent-dark);
}
.camera b { font-size: 17px; }
.camera span { font-size: 13px; color: var(--ink-3); }
.camera:hover { border-color: var(--accent); }
#photo:focus-visible + .camera { outline: 3px solid var(--accent); outline-offset: 2px; }
.day-more summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 6px 0; }
.day-more[open] summary { margin-bottom: 10px; }

.photo-strip { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; }
.photo-strip a { flex: none; }
.photo-strip img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; display: block; border: 1px solid var(--line); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.photo-grid a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--ink-3); font-size: 12px; }
.photo-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }

.role-pick { border: 0; padding: 0; margin: 2px 0; display: grid; gap: 6px; }
.role-pick legend { font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.role-pick .check { font-size: 13px; }

/* Page terrain : fiche du chantier, travaux à faire, livraisons (compagnon et chef d'équipe). */
.crew-sheet, .crew-todo, .crew-deliveries { display: grid; gap: 10px; margin-bottom: 16px; }
.crew-sheet h2, .crew-todo h2, .crew-deliveries h2 { font-size: 16px; }
.crew-row {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; font-size: 15px;
}
.crew-row svg { flex: none; color: var(--accent); }
.crew-row small { display: block; color: var(--ink-3); font-size: 13px; }
.crew-row b { color: var(--accent-dark); font-size: 14px; white-space: nowrap; }
a.crew-row:hover { background: var(--accent-soft); text-decoration: none; }
.crew-todo h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); margin: 6px 0 0; }
.crew-todo ul, .crew-deliveries ul { list-style: none; margin: 0; padding: 0; }
.crew-todo li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.crew-todo li small { display: block; color: var(--ink-3); font-size: 12.5px; }
.crew-todo li b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.crew-deliveries li { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.crew-deliveries li:last-child, .crew-todo li:last-child { border-bottom: 0; }
.crew-note { font-size: 13.5px; color: var(--bad); }
.crew-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; align-items: flex-start; }
.crew-actions .btn { min-height: 44px; }
.crew-actions details { flex: 1 1 200px; }
.crew-actions summary { list-style: none; }
.crew-actions summary::-webkit-details-marker { display: none; }
.role-change select { font-size: 12.5px; padding: 4px 6px; }

/* Page terrain : mes heures (pointées sur le chantier, visibles du bureau). */
.hours-input { font-size: 22px !important; font-weight: 700; max-width: 120px; text-align: center; }
.crew-hours { display: grid; gap: 10px; margin-bottom: 16px; }
.crew-hours h2 { font-size: 16px; }
.hours-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hours-totals div { background: var(--accent-soft); border-radius: var(--radius); padding: 10px 12px; }
.hours-totals small { display: block; font-size: 12.5px; color: var(--ink-3); }
.hours-totals b { font-size: 24px; color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.crew-hours ul { list-style: none; margin: 0; padding: 0; }
.crew-hours li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.crew-hours li:last-child { border-bottom: 0; }
.crew-hours li small { display: block; color: var(--ink-3); font-size: 12.5px; }
.crew-hours li b { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Horaires du compagnon : début, fin, pause sur une ligne, lisibles au pouce. */
.shift { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px; margin: 0; display: grid; gap: 6px; }
.shift legend { font-size: 14px; font-weight: 700; padding: 0 4px; }
.shift-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.shift-row .field { margin: 0; }
.shift-row input, .shift-row select { font-size: 17px !important; font-weight: 700; padding: 10px 6px !important; width: 100%; }
.shift-row input[type="time"]::-webkit-calendar-picker-indicator { margin: 0; padding: 0; width: 16px; }
@media (max-width: 440px) {
  .shift-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shift-row .field:last-child { grid-column: 1 / -1; }
}
.shift [data-shift-total] { font-weight: 700; color: var(--accent-dark); }
.shift:disabled { opacity: .7; }

/* Page terrain : ma semaine (du lundi au vendredi), aujourd'hui en avant. */
.crew-week { display: grid; gap: 8px; margin-bottom: 16px; }
.crew-week h2 { font-size: 16px; }
.crew-week ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.crew-week li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius); font-size: 14.5px; }
.crew-week li.today { background: var(--accent-soft); }
.crew-week .wd { flex: none; width: 44px; font-weight: 700; text-transform: capitalize; }
.crew-week .wd small, .crew-week a small { display: block; font-weight: 500; color: var(--ink-3); font-size: 12px; }
.crew-week a { display: block; color: var(--ink); font-weight: 600; text-decoration: none; }
.crew-week em { color: var(--ink-4); font-style: normal; }

/* Page terrain : demandes de matériel. */
.crew-material { display: grid; gap: 10px; margin-bottom: 16px; }
.crew-material h2 { font-size: 16px; }
.crew-material textarea { font-size: 16px; padding: 12px; }
.crew-material ul { list-style: none; margin: 0; padding: 0; }
.crew-material li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.crew-material li small { display: block; color: var(--ink-3); font-size: 12.5px; }

/* /admin : vérification de la mise en ligne. */
.setup-check ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.setup-check li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.setup-check li b { flex: none; width: 20px; text-align: center; }
.setup-check li.ok b { color: var(--ok); }
.setup-check li.ko b { color: var(--bad); }
.setup-check small { display: block; color: var(--ink-3); font-size: 12.5px; }

/* Offre d'engagement de 3 mois (page d'abonnement). */
.quarter-offer { max-width: 560px; display: grid; gap: 10px; }
.quarter-offer h2 { font-size: 20px; }

/* Devis et factures sur téléphone (page de signature du client) : chaque ligne devient un bloc
   « désignation » puis « quantité, unité × prix, TVA … total », pour ne jamais dépasser de l'écran. */
@media screen and (max-width: 600px) {
  .paper table thead { display: none; }
  .paper table tr {
    display: grid; grid-template-columns: auto auto auto auto 1fr; align-items: baseline;
    column-gap: 6px; padding: 9px 0; border-bottom: 1px solid var(--line);
  }
  .paper table td { border: 0; padding: 0; text-align: left; }
  .paper table td:first-child { grid-column: 1 / -1; padding-bottom: 3px; }
  .paper table td[colspan] { padding: 7px 10px; border-radius: 6px; }
  .paper table td:not(:first-child) { font-size: 12.5px; color: var(--ink-3); }
  .paper table td:nth-child(4)::before { content: '× '; }
  .paper table td:last-child:not(:first-child) { font-size: 14px; font-weight: 600; color: var(--ink); text-align: right; }
}

/* Visite guidée du premier lancement (public/app-tour.js). */
.app-tour-shade { position: fixed; inset: 0; background: rgba(20, 18, 16, .45); z-index: 80; }
.app-tour-focus { position: relative; z-index: 81; box-shadow: 0 0 0 4px var(--accent), 0 0 0 9999px rgba(0, 0, 0, 0); border-radius: 12px; background: var(--bg); }
.app-tour-tip { position: fixed; z-index: 82; background: #fff; color: var(--ink); border-radius: 14px; padding: 14px 16px; box-shadow: 0 18px 40px rgba(0, 0, 0, .3); display: grid; gap: 8px; font-size: 14.5px; }
.app-tour-tip small { color: var(--ink-3); font-weight: 700; }
.app-tour-tip p { margin: 0; font-weight: 600; }
.app-tour-row { display: flex; justify-content: space-between; gap: 8px; }
