/* mathurin-nous : habillage selon la charte Mathurin.
   Papier chaud, encre, un seul bleu pour ce qui compte, Onest pour lire, DM Mono pour les petits repères.
   Aucun arrondi, aucune ombre. La trame n'apparaît qu'en bandeau, jamais sous du texte. */

@font-face { font-family: Onest; src: url(/fonts/Onest-Variable.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url(/fonts/DMMono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DM Mono"; src: url(/fonts/DMMono-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --papier: #f6f2ea; --papier-clair: #fbf8f2; --filet: #d9d2c4;
  --encre: #22211f; --encre-douce: #5f5b54;
  --bleu: #2a3bff; --ciel: #8eb4e8; --rose: #ee7f8f; --abricot: #f5a65b;
  --texte: Onest, "Helvetica Neue", Arial, sans-serif;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--papier); color: var(--encre); font-family: var(--texte); font-size: 17px; line-height: 1.55; }
h1, h2, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
a { color: inherit; text-underline-offset: 4px; }
a:hover { color: var(--bleu); }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 3px; }

.haut, main { max-width: 920px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.haut { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 18px; }
main { padding-block: 32px 96px; display: flex; flex-direction: column; gap: 20px; }

/* logo : le M dans le carré */
.logo { display: inline-flex; align-items: center; gap: .36em; font-size: 24px; line-height: 1; font-weight: 500; letter-spacing: -.04em; text-decoration: none; }
.logo:hover { color: inherit; }
.mk { display: inline-grid; grid-template-columns: repeat(7, 1fr); width: 1.08em; height: 1.08em; flex: none; }
.mk i { display: block; }
.mk .a { background: var(--abricot); } .mk .r { background: var(--rose); } .mk .c { background: var(--ciel); } .mk .b { background: var(--encre); }

/* la trame, en bandeau */
.trame { height: 72px; background: var(--papier) url(/trame.png) right center / auto 100% no-repeat; image-rendering: pixelated; border-bottom: 1px solid var(--filet); }

/* textes */
.lib { font-family: var(--mono); font-size: 12.5px; line-height: 1.4; letter-spacing: .07em; text-transform: uppercase; color: var(--encre-douce); }
.lib a { text-decoration: none; }
.lib a:hover { text-decoration: underline; }
h1 { font-size: clamp(32px, 5.4vw, 52px); line-height: 1.04; font-weight: 500; letter-spacing: -.04em; text-wrap: balance; }
h2 { font-size: 26px; line-height: 1.15; font-weight: 500; letter-spacing: -.035em; }
.chapo { font-size: 20px; line-height: 1.5; color: var(--encre-douce); max-width: 46ch; }
.doux { color: var(--encre-douce); font-size: 15px; }
label .doux { font-size: 13px; }
.note { white-space: pre-wrap; max-width: 65ch; }
.vide { padding: 32px 0; color: var(--encre-douce); max-width: 50ch; }
.pied { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--filet); }
.alerte { border-left: 3px solid var(--encre); padding: 8px 14px; background: var(--papier-clair); max-width: 60ch; }

.tete { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; }
.bloc { display: flex; flex-direction: column; gap: 16px; padding-top: 28px; margin-top: 20px; border-top: 1px solid var(--encre); }
.etroit { max-width: 460px; display: flex; flex-direction: column; gap: 16px; }

/* états : un carré qui se remplit, et toujours un mot. Classes c-vide, c-damier, c-plein, c-barre. */
.etat { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.etat i, .barre i { display: block; width: 14px; height: 14px; border: 1.5px solid var(--bleu); flex: none; }
.etat.c-damier i, .barre i.c-damier { background: repeating-conic-gradient(var(--bleu) 0 25%, transparent 0 50%) 0 0 / 7px 7px; }
.etat.c-plein i, .barre i.c-plein { background: var(--bleu); }
.etat.c-barre { color: var(--encre-douce); }
.etat.c-barre i, .barre i.c-barre { border-color: var(--encre-douce); background: linear-gradient(to top right, transparent calc(50% - 1px), var(--encre-douce) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)); }

/* avancement : une case par étape */
.avance { display: flex; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.chiffre { font-size: 72px; line-height: .86; font-weight: 500; letter-spacing: -.06em; color: var(--bleu); }
.chiffre small { font-size: .36em; letter-spacing: -.02em; color: var(--encre-douce); }
.avance > div { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.barre { display: flex; flex-wrap: wrap; gap: 4px; }
.barre i { width: 22px; height: 22px; }
.barre i.c-damier { background-size: 11px 11px; }

/* listes */
.cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 0; border-top: 1px solid var(--encre); border-left: 1px solid var(--filet); }
.cartes li { border-right: 1px solid var(--filet); border-bottom: 1px solid var(--filet); }
.carte { display: flex; flex-direction: column; gap: 10px; padding: 20px; height: 100%; text-decoration: none; }
.carte:hover { background: var(--papier-clair); color: inherit; }
.carte-tete { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.carte-nom { font-size: 24px; line-height: 1.12; font-weight: 500; letter-spacing: -.035em; }

.lignes > li { padding: 12px 0; border-bottom: 1px solid var(--filet); display: flex; flex-direction: column; gap: 6px; }
.etapes li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; padding: 12px 0; border-bottom: 1px solid var(--filet); }
.etapes .etat { min-width: 108px; }
.etape-titre { flex: 1; min-width: 200px; font-weight: 500; }
.journal { display: flex; flex-direction: column; }
.journal li { padding: 16px 0; border-bottom: 1px solid var(--filet); display: flex; flex-direction: column; gap: 6px; }
.devis { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; }
.devis-titre { font-weight: 500; }
.adresse { font-family: var(--mono); font-size: 14px; word-break: break-all; background: var(--papier-clair); border: 1px solid var(--filet); padding: 10px 12px; }

/* formulaires */
label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; color: var(--encre); background: var(--papier-clair); border: 1px solid #8a8377; border-radius: 0; padding: 9px 11px; min-width: 0; }
input[type="file"] { padding: 8px; font-size: 14px; }
textarea { resize: vertical; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--bleu); outline-offset: 1px; border-color: var(--bleu); }
.pile { display: flex; flex-direction: column; gap: 6px; align-items: stretch; max-width: 620px; }
.pile > label { margin-top: 10px; }
.pile > .btn { align-self: flex-start; margin-top: 14px; }
.deux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; margin-top: 10px; }
.ligne { display: grid; grid-template-columns: minmax(0, 1fr) 160px 130px auto; gap: 8px; align-items: center; }
.ligne.court { grid-template-columns: 130px auto; }
.ligne.ajout { padding-top: 4px; }

.btn { display: inline-block; font-family: var(--mono); font-size: 13px; line-height: 1.3; letter-spacing: .04em; text-transform: uppercase; text-decoration: none; background: var(--encre); color: var(--papier); border: 1px solid var(--encre); border-radius: 0; padding: 11px 16px; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--bleu); border-color: var(--bleu); color: var(--papier); }
.btn.clair { background: transparent; color: var(--encre); padding: 9px 12px; }
.btn.clair:hover { background: var(--encre); border-color: var(--encre); color: var(--papier); }
.btn.danger { background: transparent; color: var(--encre); }
.btn.danger:hover { background: var(--encre); border-color: var(--encre); color: var(--papier); }
.lien { font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; background: none; border: 0; padding: 0; color: var(--encre); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

.suppr { font-size: 14px; }
.suppr summary { cursor: pointer; color: var(--encre-douce); width: max-content; }
.suppr summary:hover { color: var(--encre); }
.suppr form { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 10px 0 4px; }

@media (max-width: 700px) {
  .ligne { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ligne input[name="titre"] { grid-column: 1 / -1; }
  .ligne.court { grid-template-columns: minmax(0, 1fr) auto; }
  .deux { grid-template-columns: minmax(0, 1fr); }
  .chiffre { font-size: 56px; }
}

/* ---- espace équipe : menu, tableaux, planning ---- */
h3 { font-size: 18px; line-height: 1.2; font-weight: 500; letter-spacing: -.02em; margin: 14px 0 0; }
.menu { display: flex; gap: 4px 20px; flex-wrap: wrap; font-family: var(--mono); font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; }
.menu a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.menu a[aria-current="page"] { border-bottom-color: var(--bleu); }
.ligne.trois { grid-template-columns: minmax(0, 1fr) 170px auto; }
.ligne.quatre { grid-template-columns: 160px minmax(0, 1fr) 150px auto; }
.ligne .large { grid-column: 1 / -1; }
label input, label select { margin-top: 4px; font-weight: 400; }
.coche { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-weight: 400; }
.coche input { width: auto; margin: 0; }
.defile { overflow-x: auto; }
.chiffres { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 15px; }
.chiffres th, .chiffres td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--filet); white-space: nowrap; }
.chiffres th:first-child { text-align: left; }
.chiffres thead th { font-family: var(--mono); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--encre-douce); font-weight: 400; border-bottom-color: var(--encre); }
.chiffres tbody th { font-weight: 500; }
.chiffres .courante { background: var(--papier-clair); font-weight: 500; }
.chiffres .etat { justify-content: flex-end; }
.semaine { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-left: 1px solid var(--filet); }
.semaine li { border-right: 1px solid var(--filet); border-bottom: 1px solid var(--filet); padding: 10px 12px 14px; min-height: 96px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.semaine li.auj { background: var(--papier-clair); box-shadow: inset 0 3px 0 var(--bleu); }
.pose { display: flex; flex-direction: column; line-height: 1.25; }
.pose a { font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.pose a:hover { text-decoration: underline; }
.pose .doux { font-size: 13px; }
.cadre { margin: 0; display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 10px 24px; max-width: 760px; }
.cadre dt { font-family: var(--mono); font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--encre-douce); padding-top: 3px; }
.cadre dd { margin: 0; white-space: pre-wrap; }
.etapes .etape-titre .doux { font-weight: 400; }

@media (max-width: 700px) {
  .haut { flex-wrap: wrap; }
  .menu { order: 3; width: 100%; }
  .semaine { grid-template-columns: minmax(0, 1fr); }
  .semaine li { min-height: 0; }
  .cadre { grid-template-columns: minmax(0, 1fr); gap: 2px 0; }
  .cadre dd { margin-bottom: 10px; }
}

/* ---- la marque ---- */
.visuel { display: block; width: 100%; height: auto; border: 1px solid var(--filet); margin-top: 6px; }
.visuel.petit { width: 140px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cadre-signature { background: #fff; border: 1px solid var(--filet); padding: 22px; overflow-x: auto; }
pre.adresse { white-space: pre-wrap; margin: 0; font-size: 13.5px; line-height: 1.5; }
pre.adresse.code { font-size: 12px; max-height: 240px; overflow: auto; }
code { font-family: var(--mono); font-size: .92em; }
