:root {
  --ink: #1f2a2e; --ink2: #5b6770; --line: #dfe3e6; --bg: #f6f7f8; --card: #fff;
  --accent: #c8642b; --accent-soft: #fbeee6; --warn: #b4232a; --warn-soft: #fdecec;
  --r: 12px; --safe-b: env(safe-area-inset-bottom, 0px);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.page { background: var(--bg); }
button, input { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.btn, button[type=submit], .pill {
  display: inline-flex; align-items: center; gap: .4em; border: 0; border-radius: 999px;
  padding: .55em 1.1em; background: var(--ink); color: #fff; text-decoration: none; cursor: pointer; font-weight: 600;
}
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.pill { background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); padding: .45em 1em; }
.pill[aria-pressed=true] { background: var(--ink); color: #fff; box-shadow: none; }

/* ---------- connexion */
.login { max-width: 340px; margin: 12vh auto 0; padding: 0 20px; text-align: center; }
.login h1 { font-size: 1.25rem; margin: .6em 0 1.4em; }
.login h1:has(+ .slogan) { margin-bottom: .2em; }
.login .slogan { color: var(--ink2); font-style: italic; margin: 0 0 1.6em; }
.login form { display: grid; gap: .6em; text-align: left; }
.login input { padding: .8em 1em; border: 1px solid var(--line); border-radius: var(--r); background: #fff; font-size: 1.05rem; }
.login button { justify-content: center; padding: .85em; margin-top: .4em; }
.err { color: var(--warn); margin: 0; }

/* ---------- liste des chantiers */
.top { display: flex; align-items: center; justify-content: space-between; gap: 1em; padding: 14px 18px;
  background: var(--ink); color: #fff; position: sticky; top: 0; z-index: 2; flex-wrap: wrap; }
.top h1 { font-size: 1.05rem; margin: 0; }
.top nav { display: flex; gap: .5em; }
.top .btn { background: #fff; color: var(--ink); }
.top .btn.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px #ffffff55; }
.list { max-width: 820px; margin: 0 auto; padding: 16px; }
.list input[type=search] { width: 100%; padding: .8em 1em; border: 1px solid var(--line); border-radius: var(--r); background: #fff; margin-bottom: 12px; }
.projects { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.projects li { display: flex; align-items: stretch; background: var(--card); border-radius: var(--r); box-shadow: 0 0 0 1px var(--line); }
.projects a { flex: 1; display: grid; grid-template-columns: 3.4em 1fr auto; gap: .8em; align-items: center; padding: 12px 14px; text-decoration: none; min-width: 0; }
.projects .num { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.projects .who { min-width: 0; }
.projects .who strong { display: block; }
.projects small { display: block; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.projects .when { color: var(--ink2); font-size: .85em; }
.projects .del { border: 0; background: none; color: var(--ink2); padding: 0 14px; cursor: pointer; }
.empty, .role { color: var(--ink2); }
.role { font-size: .85em; margin-top: 2em; text-align: center; }

/* ---------- visionneuse */
body.viewer { display: grid; grid-template-rows: auto 1fr auto; height: 100dvh; overflow: hidden; background: #eef0f1; }
.vbar { position: relative; z-index: 6; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--ink); color: #fff; z-index: 3;
  padding-top: max(8px, env(safe-area-inset-top)); }
.vbar .icon { font-size: 1.8rem; line-height: 1; text-decoration: none; padding: 0 8px; }
.vtitle { flex: 1; min-width: 0; line-height: 1.2; }
.vtitle strong, .vtitle small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vtitle small { opacity: .75; }
.vbar .pill { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px #ffffff66; }
.vbar .pill[aria-pressed=true] { background: #fff; color: var(--ink); }

#stage { position: relative; min-height: 0; }
#c { display: block; width: 100%; height: 100%; touch-action: none; }
#loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink2); background: #eef0f1; }
.spin { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: sp 0.9s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
#hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); background: #1f2a2ecc; color: #fff; padding: 6px 14px;
  border-radius: 999px; font-size: .85rem; pointer-events: none; transition: opacity .8s; white-space: nowrap; }
#hint.fade { opacity: 0; }
/* témoin de calcul : premier passage en Rendu, en élévation… (préparation des programmes graphiques) */
#temoin { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 6; pointer-events: none;
  display: grid; justify-items: center; gap: 10px; min-width: 220px; padding: 18px 22px 16px; border-radius: 14px;
  background: #fffffff2; color: var(--ink); box-shadow: 0 6px 24px #0003; text-align: center;
  animation: temoinIn .2s ease-out .12s both; }
#temoin[hidden] { display: none; }
#temoin p { margin: 0; font-size: .95rem; }
#temoin .barre { width: 100%; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
#temoin .barre i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .15s linear; }
#temoin .barre.indet i { background: repeating-linear-gradient(-45deg, var(--accent) 0 8px, #e08a57 8px 16px);
  background-size: 23px 100%; animation: temoinDefile .6s linear infinite; transition: none; }
@keyframes temoinDefile { to { background-position: 23px 0; } }
@keyframes temoinIn { from { opacity: 0; transform: translate(-50%, -46%); } to { opacity: 1; transform: translate(-50%, -50%); } }
/* mesure : résumé en haut de l'écran (la barre des points de vue occupe le bas) */
#measureInfo { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); background: #fff; padding: 4px 6px 4px 16px;
  border-radius: 999px; box-shadow: 0 2px 10px #0002; white-space: nowrap; z-index: 3; display: flex; align-items: center; gap: 4px;
  max-width: calc(100% - 16px); min-height: 38px; box-sizing: border-box; }
#measureInfo[hidden] { display: none; }
#measureInfo > :first-child { overflow: hidden; text-overflow: ellipsis; padding-right: 6px; }
#measureInfo small { color: var(--ink2); margin-left: .5em; }
#measureInfo button { border: 0; background: var(--bg); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-size: .95rem; flex: none; color: var(--ink); }
body[data-vue=plan] #measureInfo, body[data-vue=elev] #measureInfo { top: 56px; }
#hint { z-index: 2; }
#cotes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
#cotes .cote3d { position: absolute; left: 0; top: 0; background: #d9480f; color: #fff; font-weight: 700; font-size: .8rem; padding: 2px 7px;
  border-radius: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 1px 4px #0003; }
#cotes .poignee { position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid #d9480f; box-sizing: border-box; }
#cotes .viseur { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; box-sizing: border-box; }
#cotes .viseur.sommet { background: #1a9f5c; border: 2px solid #fff; border-radius: 3px; box-shadow: 0 0 0 1px #1a9f5c; }
#cotes .viseur.milieu { background: #2f7fd8; border: 2px solid #fff; transform-origin: center; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
#cotes .viseur.arete { border: 3px solid #2f7fd8; border-radius: 50%; }
#cotes .viseur.face, #cotes .viseur.libre { width: 22px; height: 22px; left: -11px; top: -11px;
  background: linear-gradient(#d9480f, #d9480f) center / 2px 100% no-repeat, linear-gradient(#d9480f, #d9480f) center / 100% 2px no-repeat; }

.tools { display: flex; justify-content: space-around; background: #fff; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); z-index: 3; }
.tools button { flex: 1; border: 0; background: none; padding: 8px 2px 6px; display: grid; justify-items: center; gap: 2px; font-size: 1.15rem; cursor: pointer; color: var(--ink); }
.tools button span { font-size: .68rem; color: var(--ink2); }
.tools button[aria-pressed=true] { color: var(--accent); }
.tools button[aria-pressed=true] span { color: var(--accent); font-weight: 600; }

/* panneau : feuille en bas sur téléphone, colonne à droite sur grand écran */
#panel { position: fixed; left: 0; right: 0; bottom: calc(52px + var(--safe-b)); max-height: 50dvh; background: var(--card); border-radius: 16px 16px 0 0;
  box-shadow: 0 -6px 24px #0002; z-index: 5; display: flex; flex-direction: column; }
#panel .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 8px auto 0; flex: none; }
#panel .close { position: absolute; right: 8px; top: 6px; z-index: 3; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #fffffff0; box-shadow: 0 1px 4px #0002; font-size: 1rem; cursor: pointer; color: var(--ink2); }
#panelBody { overflow-y: auto; padding: 4px 18px 18px; -webkit-overflow-scrolling: touch; }
@media (min-width: 900px) {
  body.viewer { grid-template-columns: 1fr; }
  #panel { left: auto; top: var(--hb, 52px); bottom: 0; width: 400px; max-height: none; border-radius: 0; box-shadow: -6px 0 24px #0002; padding-top: 8px; }
  #panel .grab { display: none; }
  body.viewer:has(#panel:not([hidden])) #stage, body.viewer:has(#panel:not([hidden])) .tools { margin-right: 400px; }
}

#panelBody h2 { font-size: 1.12rem; margin: .2em 2em .3em 0; line-height: 1.3; }
#panelBody h2 small { font-weight: 400; color: var(--ink2); }
#panelBody h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink2); margin: 1.3em 0 .5em; }
.kicker { margin: .6em 0 0; font-size: .82rem; color: var(--ink2); }
.ref { font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--ink); }
.sub { margin: 0 0 .4em; color: var(--ink2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: .6em 0; }
.chip { padding: .3em .7em; border-radius: 8px; background: var(--bg); font-size: .88rem; }
.chip.strong { background: var(--accent-soft); color: #8a3c12; font-weight: 700; font-variant-numeric: tabular-nums; }
.note { background: var(--bg); padding: .6em .8em; border-radius: 8px; font-size: .9rem; }
.note.warn, li.warn { background: var(--warn-soft); color: var(--warn); }
li.warn { padding: .5em .7em; border-radius: 8px; margin-bottom: 6px; font-size: .9rem; }
.kv { display: grid; grid-template-columns: minmax(8em, 42%) 1fr; gap: .35em 1em; margin: 0; font-size: .92rem; }
.kv dt { color: var(--ink2); }
.kv dd { margin: 0; }
.plain { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.plain li { padding: .25em 0; }
.prices { display: flex; flex-wrap: wrap; gap: .4em 1.2em; align-items: baseline; margin: 1.2em 0 0; padding: .8em 1em; background: var(--ink); color: #fff; border-radius: 10px; font-weight: 600; }
.prices small { opacity: .7; font-weight: 400; }
.price { color: var(--ink2); white-space: nowrap; }
.muted { color: var(--ink2); font-size: .88rem; }
#fq { width: 100%; padding: .6em .9em; border: 1px solid var(--line); border-radius: 10px; margin: .4em 0 .6em; }
.arts { list-style: none; padding: 0; margin: 0; }
.arts button { width: 100%; display: grid; grid-template-columns: 2.6em 1fr 1.4em; gap: .6em; align-items: center; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); background: none; padding: .65em 0; cursor: pointer; }
.arts .pos { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.arts .what { min-width: 0; }
.arts small { display: block; color: var(--ink2); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arts .go { color: var(--accent); }
.arts .no3d .pos { color: var(--ink2); }

/* ---------- dépôt */
.depot { max-width: 760px; margin: 0 auto; padding: 18px; }
.drop { border: 2px dashed #b9c1c6; border-radius: 16px; padding: 40px 20px; text-align: center; background: #fff; cursor: pointer; transition: .15s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { display: block; font-size: 1.1rem; margin-bottom: .3em; }
.drop p { margin: .3em 0; color: var(--ink2); }
.summary { margin-top: 16px; background: #fff; border-radius: 16px; padding: 16px; box-shadow: 0 0 0 1px var(--line); }
.summary input[type=text] { width: 100%; padding: .6em .8em; border: 1px solid var(--line); border-radius: 10px; }
.files { list-style: none; padding: 0; margin: .8em 0; max-height: 220px; overflow: auto; font-size: .88rem; }
.files li { display: flex; justify-content: space-between; gap: 1em; padding: .25em 0; border-bottom: 1px solid var(--bg); }
.files li.ok::after { content: '✓'; color: #2b8a3e; }
.files li.err { color: var(--warn); }
.bar { height: 6px; background: var(--bg); border-radius: 6px; overflow: hidden; margin: .8em 0; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.done { background: #ebfbee; color: #2b8a3e; padding: .8em 1em; border-radius: 10px; }

/* ---------- plan 2D */
#planLabels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.plabel { position: absolute; left: 0; top: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plabel.rep { pointer-events: auto; cursor: pointer; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; box-shadow: 0 1px 3px #0004; }
.plabel.cote { font-size: 11px; font-weight: 700; color: var(--ink); background: #ffffffd9; padding: 1px 5px; border-radius: 4px; }
#planBar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; gap: 2px; background: #fff; padding: 3px;
  border-radius: 999px; box-shadow: 0 2px 10px #0002; z-index: 2; }
#planBar button { white-space: nowrap; border: 0; background: none; padding: 6px 12px; border-radius: 999px; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--ink2); }
#planBar button[aria-pressed=true] { background: var(--ink); color: #fff; }

/* ---------- AR fournisseur & documents */
.carton { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2em .7em; margin: .5em 0; padding: .55em .8em; border-radius: 10px;
  background: #fff4e0; border: 2px solid #f0a020; }
.carton span { font-size: .8rem; color: #8a5a00; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.carton strong { font-size: 1.5rem; color: #5c3b00; font-variant-numeric: tabular-nums; }
.carton small { flex-basis: 100%; color: #8a5a00; }
.carton em { font-style: normal; opacity: .8; }
.docbtns { margin: .6em 0; }
.docbtns .pill { text-decoration: none; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: .4em 0 .8em; }
.thumbs a, .thumbs button { width: 100%; padding: 0; cursor: pointer; display: block; position: relative; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.thumbs img { display: block; width: 100%; aspect-ratio: 1.41; object-fit: contain; }
.thumbs span { position: absolute; right: 4px; bottom: 4px; font-size: .7rem; background: #1f2a2ecc; color: #fff; padding: 1px 6px; border-radius: 6px; }
.docs li { padding: .35em 0; border-bottom: 1px solid var(--bg); }
.docs a { text-decoration: none; font-weight: 600; }
.docs small { color: var(--ink2); }
.seg { display: inline-flex; background: var(--bg); padding: 3px; border-radius: 999px; gap: 2px; margin: .2em 0 .4em; }
.seg button { border: 0; background: none; padding: .35em .9em; border-radius: 999px; cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--ink2); }
.seg button[aria-pressed=true] { background: var(--ink); color: #fff; }
.plabel.rep.carton { background: #f0a020; color: #3d2600; }

/* ---------- documents */
.tools button { position: relative; }
.tools .badge { position: absolute; top: 3px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: .65rem; font-weight: 700; line-height: 16px; }
.doclist { list-style: none; margin: .4em 0 0; padding: 0; }
.doclist button { width: 100%; display: grid; grid-template-columns: 2.2em 1fr auto; gap: 10px; align-items: center; text-align: left;
  border: 0; border-bottom: 1px solid var(--line); background: none; padding: .7em 0; cursor: pointer; color: var(--ink); font: inherit; }
.doclist .ico { font-size: 1.4rem; text-align: center; }
.doclist small { display: block; color: var(--ink2); font-size: .8rem; }
.doclist .go { color: var(--accent); font-size: 1.2rem; }
.docbtns { display: flex; flex-wrap: wrap; gap: 8px; }
button.pill { font: inherit; font-weight: 600; }

/* ---------- liseuse */
html.reading, html.reading body { overflow: hidden; }
#reader { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: #3a4246; }
#reader[hidden] { display: none; }
.rbar { display: flex; align-items: center; gap: 10px; padding: 8px 10px; padding-top: max(8px, env(safe-area-inset-top)); background: var(--ink); color: #fff; }
.rclose { display: flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; background: #fff; color: var(--ink);
  padding: .5em 1em; font: inherit; font-weight: 700; cursor: pointer; flex: none; }
.rclose span { font-size: .9rem; }
.rtitle { min-width: 0; display: grid; }
.rtitle strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .95rem; }
.rtitle small { color: #ffffffb0; font-size: .78rem; font-variant-numeric: tabular-nums; }
.rscroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; position: relative; }
.rpages { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 8px; width: max-content; min-width: 100%; box-sizing: border-box; }
.rpage { background: #fff; box-shadow: 0 2px 8px #0005; flex: none; }
.rpage canvas { display: block; width: 100%; height: 100%; }
.rimg { display: block; max-width: none; background: #fff; }
.rmsg { position: absolute; left: 50%; top: 40%; transform: translateX(-50%); color: #fff; text-align: center; max-width: 80%; pointer-events: none; }
.rmsg:empty { display: none; }
.rtools { display: flex; justify-content: center; gap: 6px; padding: 6px 8px calc(6px + var(--safe-b)); background: #fff; border-top: 1px solid var(--line); }
.rtools button, .rtools a { border: 0; background: none; padding: 6px 12px; display: grid; justify-items: center; gap: 1px; font-size: 1.25rem;
  cursor: pointer; color: var(--ink); text-decoration: none; min-width: 48px; font-family: inherit; }
.rtools [hidden] { display: none; }
.rtools span { font-size: .68rem; color: var(--ink2); }
.rtools button:disabled { opacity: .35; }

/* ---------- liens de partage */
.projects .share { position: relative; border: 0; background: none; padding: 0 10px; cursor: pointer; font-size: 1.05rem; }
.projects .share .badge, .vbar .badge { position: absolute; top: 6px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: .65rem; line-height: 16px; text-align: center; }
.vlogo { flex: none; margin: 0 4px; border-radius: 6px; background: #fff; padding: 2px; }
.muted { color: var(--ink2); }
#share { width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 16px; padding: 16px 18px 18px;
  box-shadow: 0 10px 40px #0004; color: var(--ink); }
#share::backdrop { background: #1f2a2e88; }
#share .sh-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; }
#share h2 { font-size: 1.1rem; margin: 0; }
#share h2 span { color: var(--accent); }
#share .close { border: 0; background: none; font-size: 1.1rem; cursor: pointer; color: var(--ink2); padding: 6px; }
#share > p { margin: .4em 0 1em; font-size: .9rem; }
.sh-new { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; background: var(--bg); border-radius: var(--r); }
.sh-new label { display: grid; gap: 4px; font-size: .8rem; color: var(--ink2); }
.sh-new label:first-child { grid-column: 1 / -1; }
.sh-new select, .sh-new input { padding: .55em .7em; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: inherit; font-size: .95rem; }
.sh-new button { grid-column: 1 / -1; justify-content: center; }
.sh-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.sh-list li { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: grid; gap: 8px; }
.sh-list li.off { opacity: .55; }
.sh-list small { display: block; color: var(--ink2); margin-top: 2px; }
.sh-list input { width: 100%; padding: .45em .6em; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); font-size: .8rem; color: var(--ink2); }
.sh-list p { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.sh-list .pill { font-size: .85rem; padding: .35em .8em; text-decoration: none; }
.sh-list .pill.danger { color: var(--warn); }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 2px 7px; border-radius: 6px; }
.tag.poseur { background: #e6eef1; color: var(--ink); }
.tag.client { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 480px) { .sh-new { grid-template-columns: 1fr; } }

/* rendu soigné : barre des points de vue */
#vuesBar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px;
  background: #1f2a2ee6; border-radius: 22px; padding: 3px; z-index: 2; box-shadow: 0 2px 10px #0003; }
#vuesBar[hidden] { display: none; }
#vuesBar button { border: 0; background: none; color: #fff; font: inherit; font-size: .9rem; cursor: pointer; padding: 8px 12px; border-radius: 18px; white-space: nowrap; }
#vuesBar { max-width: calc(100% - 16px); }
#vuesBar #vuePrev, #vuesBar #vueNext { font-size: 1.3rem; line-height: 1; padding: 6px 14px; }
#vuesBar button:active { background: #ffffff22; }

/* ---------- élévations */
#elevBar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; background: #fff; padding: 3px;
  border-radius: 999px; box-shadow: 0 2px 10px #0002; z-index: 2; max-width: calc(100% - 12px); }
#elevBar[hidden], #coupeBar[hidden] { display: none; }
#elevBar button { white-space: nowrap; border: 0; background: none; padding: 6px 10px; border-radius: 999px; cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--ink2); flex: none; }
#elevBar #elevNom { color: var(--ink); min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
#elevBar #elevPrev, #elevBar #elevNext { font-size: 1.2rem; line-height: 1; padding: 4px 10px; }
#elevBar button[aria-pressed=true] { background: var(--ink); color: #fff; }
#coupeBar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: #fff;
  padding: 6px 14px; border-radius: 999px; box-shadow: 0 2px 10px #0002; z-index: 2; font-size: .85rem; font-weight: 600; color: var(--ink2);
  width: min(420px, calc(100% - 24px)); box-sizing: border-box; }
#coupeBar input { flex: 1; min-width: 0; accent-color: var(--accent); }
#coupeBar b { min-width: 4.2em; text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
#elevLabels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#elevLabels .plabel { position: absolute; left: 0; top: 0; }
#elevLabels .rep { pointer-events: auto; cursor: pointer; }
#elevLabels .ecote { background: #ffffffe6; color: #1f2a2e; font-size: .72rem; font-weight: 600; padding: 0 4px; border-radius: 4px; font-variant-numeric: tabular-nums; }
#elevLabels .ecote.total { font-weight: 800; }
#stage.tourne #c { cursor: ew-resize; }
@media (max-width: 420px) {
  .tools button span { font-size: .62rem; }
  #elevBar button { padding: 6px 7px; }
}

/* ---------- numéro de version */
.version { color: var(--ink2); opacity: .7; font-size: .72rem; text-align: center; margin: 18px 0 8px; font-variant-numeric: tabular-nums; }
