docs(docs): proposal board for detail views drawn on the drawing

Board v1-2-6-u2-detail-views (D1-D21, open questions Q1-Q4) for the owner's graphic validation; no product code.
This commit is contained in:
bchanot committed 2026-11-22 01:56:49 +01:00
1 parent 80991badce
commit 62f3983c80
19 files changed
+918

No files matched your search

+5
View File
@@ -251,3 +251,8 @@ second press disarms); Enter or Space still places at the centre; while a tool i
same row places at the centre (screen-reader path, 2026-11-21); the buttons are 44 px high below 1 280 px. Criterion 32
(view chips on several rows): one horizontally scrolling chip row validated 2026-11-21, board `v1-2-6-u2-chips/`
(implemented 2026-11-21).
2026-11-22: owner request « vues de détail tracées sur le dessin » (create a detail view by drawing its frame on the
parent drawing, open it from its access, go back to the parent, recrop it graphically). Proposal board
`v1-2-6-u2-detail-views/` (arbitrations D1 to D21, open questions Q1 to Q4), NOT validated: until the owner's decision,
board 08 of `v1-2-6/` stays the reference for detail-view creation.
Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 156 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

@@ -0,0 +1,130 @@
# U2, vues de détail tracées sur le dessin (proposition du 2026-11-22, à valider)
Demande du propriétaire du 2026-11-22 : créer une vue de détail en traçant son cadre sur le dessin, la retrouver et
l'ouvrir depuis son accès sur la vue parente, revenir à la parente, recadrer une vue existante, sans jamais saisir de
coordonnées. Le propriétaire a délégué les choix d'expérience et de technique ; ils sont proposés ci-dessous (D1 à
D21) et dessinés dans `maquettes.html`. Rien n'est implémenté ; aucun choix ne vaut autorisation de code avant
l'accord du propriétaire sur cette planche.
| Fichier | Contenu |
|---|---|
| `maquettes.html` | Planche autonome : styles et dessin repris de `../v1-2-6-u2/maquettes.html`, données du brouillon équin (`../v1-2-6-u2/data.js`, générées depuis `document.json`), dessin `horse.svg` du brouillon |
| `planche.png` | Rendu pleine page par le Chromium épinglé de `apps/app` (`../v1-2-6/render.cjs`) |
| `NN-*.png` | Un fichier par panneau, même rendu |
| `capture-aujourdhui.png` | L'existant, capturé le 2026-11-21 dans la sandbox : « Gérer les vues », quatre champs de recadrage et l'aperçu en pointillés |
## Questions au propriétaire
Quatre arbitrages changent une décision déjà prise ou laissent un vrai choix ouvert :
- Q1, catégorie de l'accès (D11). Toutes les catégories du cheval sont anatomiques (Articulations, Os, Charnières
vertébrales, Segments vertébraux, Os du crâne), et T10 interdit de ranger un accès dans Os, Articulations ou
Vertèbres. Avant U6, chaque nouvel accès devra donc soit recevoir une de ces catégories, choisie par l'éditeur,
soit attendre (« Plus tard », la vue restant une erreur bloquante de « Vérification »). Options : (a) choix
explicite par l'éditeur jusqu'à U6, comme BDR-101 le prévoit (recommandé : rien d'autre ne bouge, la tête est
déjà dans Articulations) ; (b) avancer la seule partie « catégorie interne » de U6 (`cat-access`, rôle
`navigation`) : nouvelle clé facultative du schéma, ses preuves de compatibilité et les contrôles SQL, un lot à part
entière ; (c) une catégorie ordinaire « Accès aux vues » créée par l'éditeur : simple, mais visible comme une
catégorie anatomique et à convertir à U6.
- Q2, accès qui recouvre des annotations (D10) : rouvre le choix 6 validé.
- Q3, annotations de la parente dans la nouvelle vue (D20) : contredit la légende de la planche 08.
- Q4, l'outil « Accès » remplacé par « Vue de détail » (D3) : change le choix « les trois boutons » de BDR-124.
## Analyse de l'existant
Modèle (cœur Rust, `crates/core/src/domain/sheet/schema.rs`, BDR-031) :
- Une vue de détail porte un nom FR/EN, une vue parente (`parent_view_id`) et soit sa propre illustration, soit un
cadre (`view_box` : x, y, largeur, hauteur) dans le dessin de sa parente. L'arbre des vues peut avoir plusieurs
niveaux.
- L'accès est une donnée distincte : une annotation de type accès (`detail_trigger`) posée sur la vue parente, qui
nomme la vue qu'elle ouvre, avec une catégorie et une latéralité obligatoires et une forme (cercle, polygone).
Sans nom propre, elle prend le nom de la vue ouverte (BDR-054).
- Le cadre et l'accès sont donc déjà indépendants. La règle d'intégrité « Aucun accès d'une annotation n'ouvre cette
vue détaillée » est une erreur tant qu'aucun accès n'existe : elle bloque la soumission, pas l'enregistrement.
La tête du cheval (brouillon équin) :
- Vue « Tête (vue latérale gauche) », parente « Vue latérale gauche », sans illustration propre, cadre 60, 100, 500 ×
380 (rapport 1,32, presque 4:3).
- Son accès est un polygone de 15 sommets tracé à la main autour de la tête, sur la vue principale, catégorie
Articulations, dessiné en pointillés avec un remplissage à 6 %. Les 9 points de la tête vivent dans la vue « Tête » ;
une vue ne montre que ses propres annotations.
Les surfaces aujourd'hui :
- Éditeur de fiche : « Gérer les vues » crée une vue de détail par quatre champs numériques, avec un aperçu du
dessin parent et un rectangle en pointillés non manipulable. L'accès se trace à part, clic par clic, avec l'outil
« Accès » ou « Ajouter un accès ». Sur le dessin, un accès se comporte comme une annotation : le premier clic le
sélectionne, le second ouvre ses propriétés. On change de vue par la rangée de vues (critère 32).
- Catalogue : un clic sur l'accès affiche la vue.
- Bilan : un clic sur l'accès ouvre la vue dans une fenêtre ; une vue imbriquée remplace la précédente, sans retour.
Ce que l'éditeur sait déjà faire et que la proposition réutilise : le décideur d'appui (clic, glissé, toucher, deux
doigts), les poignées à taille constante (22 px de prise au doigt), la loupe, le zoom et le défilement du dessin, les
flèches clavier sur un sommet (Maj × 10), « Placer au centre », le mode « Déplacer » sans glisser (A11), le dialogue
de création sur la colonne de droite, l'historique par instantanés du document et l'enregistrement explicite.
Place dans le plan V1-2.6 : cette demande correspond à l'étape U4 « vue de détail par rectangle », placée par le
propriétaire dans U2. L'accès automatique dans une catégorie interne reste à U6 (T10 option B, BDR-101). La planche 08
(validée le 2026-11-05) était la référence ; elle précède la disposition de U2 et cette planche la remplace pour ce
parcours, en gardant ses principes : quatre poignées d'angle, un dialogue de nommage, « Ajuster le cadre ».
## Parcours proposés
Créer : choisir la vue parente dans la rangée de vues → « Vue de détail » (outil ou bouton sous le dessin) → glisser
sur le dessin pour tracer le cadre (ou un clic, un toucher, Entrée : cadre par défaut) → ajuster les coins ou
déplacer le cadre → « Valider le cadre » → dialogue « Nouvelle vue de détail » : noms, accès → « Créer la vue ».
Ouvrir et revenir : sélectionner l'accès sur la parente → « Ouvrir la vue » (ou second clic) → sur la vue de détail,
« Vue parente » dans le bandeau, ou la puce de la parente dans la rangée, ramène à la parente.
Recadrer : sélectionner l'accès sur la parente → « Recadrer la vue » (ou « Recadrer sur le dessin » dans « Gérer les
vues ») → ajuster le cadre → « Appliquer ».
## Arbitrages proposés
| # | Choix | Proposition | Raison |
|---|---|---|---|
| D1 | Où tracer | Sur le dessin de l'onglet Annotations, pas dans l'aperçu de « Gérer les vues » | Même zoom, mêmes poignées, même place que les annotations ; l'aperçu est petit et ne se manipule pas |
| D2 | Vue parente | La vue affichée au moment de tracer ; on la choisit dans la rangée de vues, ou par « Créer une vue de détail » sur sa ligne dans « Gérer les vues ». Une vue de détail peut avoir ses propres vues de détail | Pas de liste à choisir en plus ; on voit la parente avant de tracer |
| D3 | Entrée | L'outil « Accès » de la colonne d'outils devient « Vue de détail », et « Ajouter un accès » devient « Ajouter une vue de détail ». La carte « Vues » gagne « Nouvelle vue de détail » | Aucune ligne ni bouton en plus autour du dessin : le budget de la colonne épinglée ne bouge pas. U4 retirait déjà l'outil « Accès » du parcours normal ; un accès se crée désormais avec sa vue (D9). Change BDR-124 (« les trois boutons », essayés le 2026-11-21). Ce qui se perd : tracer un accès de forme libre à partir de rien, et l'accès en cercle ; il reste le rectangle du cadre, remodelable par ses sommets. À vérifier au plan : « Redessiner » un accès emprunte aujourd'hui l'outil « Accès » et doit continuer sans son bouton. Variante : garder « Accès » et ajouter « Vue de détail », au prix d'un bouton de plus dans la colonne et d'un cinquième bouton sous le dessin, qui ne tient pas sur une ligne à 1 024 px |
| D4 | Geste | Souris et doigt : appuyer, glisser, relâcher trace le cadre. Un simple clic ou toucher pose un cadre par défaut centré sur ce point (un tiers de la largeur visible). Clavier et lecteur d'écran : Entrée sur « Ajouter une vue de détail » ou « Placer au centre ». Deux doigts zooment et font défiler, et annulent un tracé commencé | Naturel à la souris, direct au doigt, jamais de glisser obligatoire. Le glissé d'un doigt pour tracer est un geste nouveau, réservé à cet outil armé ; ailleurs, un doigt hors d'une poignée ne déplace toujours rien (A13) |
| D5 | Format du cadre | Fixe en 4:3 | L'éditeur, la fenêtre du bilan, l'aperçu et l'image du PDF (qui suit le format du cadre) montrent alors exactement ce que l'on encadre ; le catalogue sur ordinateur, en 3:2, ajoute un peu de dessin sur les côtés. Un cadre existant d'un autre format reste tel quel jusqu'au premier ajustement, qui le met en 4:3 en gardant sa largeur et son centre (tête : 500 × 380 devient 500 × 375, et ses 9 annotations repassent « à confirmer » à « Appliquer », D16) |
| D6 | Ajuster | Quatre poignées d'angle (planche 08) ; saisir l'intérieur déplace le cadre entier. Clavier : Tab atteint le cadre puis chaque coin, flèches (Maj × 10). Pointeur sans glisser : « Déplacer » et ses quatre flèches dans le bandeau, sur le cadre ou le coin choisi (A11). Au doigt, la loupe montre le coin. Le cadre reste dans le dessin parent et ne descend pas sous 5 % de sa largeur | Réemploi des poignées, de la loupe et du mode « Déplacer » existants ; ces bornes sont de simple présentation, le cœur juge le cadre à la validation |
| D7 | Pendant le tracé | Les autres annotations sont estompées et ne se sélectionnent pas (A12) ; les accès existants restent visibles en pointillés | On voit ce que l'on encadre sans rien déplacer par erreur |
| D8 | Valider | « Valider le cadre », puis le dialogue « Nouvelle vue de détail » sur la colonne de droite (A2) : rappel de la vue parente, noms FR et EN, accès. Boutons « Créer la vue », « Ajuster le cadre », « Abandonner » (T15) | Le dessin reste visible pendant le nommage ; « Ajuster le cadre » revient au cadre sans rien perdre |
| D9 | Cadre et accès | Deux données distinctes, comme aujourd'hui. Le cadre est ce que montre la vue ; on ne le voit sur la parente que pendant un tracé ou un recadrage. L'accès est la zone cliquable sur la parente : par défaut, le cadre tracé (un rectangle de quatre sommets), remodelable ensuite comme une zone (sommets, « + », « − ») pour suivre une forme comme celle de la tête | Un accès sans tracé en plus ; le recadrage et la forme de l'accès restent libres l'un de l'autre |
| D10 | Accès qui recouvre des annotations | L'accès est proposé même si le cadre couvre des annotations, et il ne prend jamais un clic ni un toucher à une annotation : là où une annotation est sous le pointeur, c'est elle qui est choisie ; l'accès réagit partout ailleurs dans sa zone (éditeur, catalogue, bilan) | Ce choix rouvre le choix 6 validé (« l'accès ne recouvre jamais une annotation »). Sur un dessin annoté, presque tout cadre couvre une annotation (épaule, boulet, colonne) : le choix 6 strict laisserait la plupart des vues sans accès et obligerait à en tracer un à la main. La priorité se règle dans la page, qui lit déjà les éléments sous le pointeur ; ni le calque du cœur ni les PDF ne changent. Variante gardant le choix 6 : le cœur calcule la liste des annotations couvertes (nouvelle opération Rust, sur une marge wasm de 4 669 octets) et l'accès n'est pas proposé dès qu'elle n'est pas vide |
| D11 | Catégorie de l'accès | Choisie dans le dialogue, sans valeur préremplie ; latéralité obligatoire, sans valeur par défaut (A4). Option « Plus tard » : la vue est créée sans accès, « Vérification » la signale et « Ajouter l'accès » sur sa ligne pose le rectangle du cadre. Question ouverte : Q1 | T10 option B (BDR-101) : jamais de catégorie automatique, la catégorie interne « Accès aux vues détaillées » n'arrive qu'à U6. Aujourd'hui « Ajouter un accès » préremplit la première catégorie du document (Articulations sur le cheval) : la proposition retire ce préremplissage pour un accès |
| D12 | Après « Créer la vue » | Une seule entrée d'historique pour la vue et son accès (LRN-142). On reste sur la vue parente, le nouvel accès sélectionné (comme A7), sa puce ajoutée à la rangée, le message « Vue « … » créée » sous le dessin | Défaire retire la vue et son accès ensemble ; on voit tout de suite où est l'accès |
| D13 | Ouvrir depuis le dessin | Dans l'éditeur : le premier clic sélectionne l'accès (A1) et le bandeau propose « Ouvrir la vue » en premier ; un second clic ou un double clic sur l'accès sélectionné ouvre la vue, et ses propriétés restent dans le bandeau (« Propriétés »). Même règle en lecture seule. Catalogue et bilan : un clic ouvre, comme aujourd'hui | Ouvrir est ce que l'on attend d'un accès ; la sélection reste nécessaire pour le modifier |
| D14 | Revenir à la parente | Sur une vue de détail, quand rien n'est sélectionné ni armé, le bandeau propose « Vue parente » (nom complet de la parente dans son nom accessible et son info-bulle) et « Recadrer la vue ». La puce de la parente, dans la rangée, ramène aussi ; c'est le chemin en lecture seule et sur téléphone. Le retour du navigateur ne change pas de vue (une vue n'est pas une étape de l'historique du navigateur, comme pour la rangée). Dans la fenêtre de détail du bilan, un bouton de retour quand la vue ouverte est elle-même la vue de détail d'une vue de détail | Le bandeau a une hauteur fixe (A6) : rien ne bouge. Un bouton au début de la rangée décalerait toutes les puces à chaque changement de vue, ce que le critère 32 exclut (aucun clic perdu parce que la rangée bouge) |
| D15 | Plusieurs vues sur une vue | Chaque accès est dessiné en pointillés, comme celui de la tête ; son nom s'affiche au survol et à la sélection. Les cadres peuvent se chevaucher | Le dessin reste lisible ; le nom n'encombre pas le dessin |
| D16 | Recadrer une vue existante | « Recadrer la vue » dans le bandeau quand son accès est sélectionné sur la parente ou quand la vue elle-même est affichée (D14), et « Recadrer sur le dessin » sur sa ligne dans « Gérer les vues ». Le dessin montre la parente entière, le cadre et ses poignées, et les annotations de la vue en fantôme dans le cadre. Le bandeau prévient « Les N annotations de cette vue repasseront « à confirmer » » (règle existante du cœur) et propose « Déplacer l'accès avec le cadre » (cochée si l'accès a encore la forme de l'ancien cadre). « Appliquer » ou « Abandonner ». Le cœur juge à « Appliquer » : si une annotation de la vue sortirait du cadre ou deviendrait trop petite, le refus s'écrit sous le dessin et le cadre reste en place pour être corrigé | Les fantômes montrent ce que l'on risque de couper ; la page ne recopie pas la règle du cadre (BDR-091, BDR-092), le cœur reste seul juge. On sait ce que le recadrage change avant de l'appliquer |
| D17 | Valeurs numériques | Gardées dans « Gérer les vues », repliées sous « Valeurs précises », pour une valeur exacte. Une vue qui a sa propre illustration se recadre seulement par ces valeurs (son cadre est dans son propre dessin) | Plus nécessaires au parcours normal ; un chemin qui fonctionne n'est pas retiré |
| D18 | Historique et enregistrement | Le cadre en cours n'entre pas dans l'historique : « Défaire » est indisponible pendant le tracé, avec sa bulle de raison, comme pour un point ou une zone. Quitter la vue, l'onglet ou la page, ou Échap, demande « Abandonner la création ? » ou « Abandonner le recadrage ? » (R-12, BDR-113). Créer fait une entrée, recadrer une entrée (cadre et accès si coché). Rien ne s'enregistre seul : « Enregistrer » ne change pas | Les règles de U2 s'appliquent telles quelles |
| D19 | Accessibilité | Chemin clavier complet (D4, D6) ; boutons nommés « Cadre » et « Coin haut gauche »… ; annonce polie de l'outil armé et du cadre posé ; « Ouvrir la vue », « Recadrer la vue » et « Vue parente » sont des boutons ; aucun geste n'est obligatoire (WCAG 2.5.7) | Le dessin ignore un clic de technologie d'assistance (LRN-147) : chaque action a son bouton |
| D20 | Annotations de la parente dans la nouvelle vue | Elles restent sur la parente ; la nouvelle vue commence vide et reçoit ses propres annotations | Règle actuelle du cœur (une vue ne montre que les siennes). La légende de la planche 08 disait le contraire ; la recopie relève de U5 |
| D21 | Technique | Aucune opération Rust nouvelle, aucune version de schéma, aucun changement de lecteur, de PDF ni d'empreinte : la page propose les nombres (cadre 4:3, bornes de présentation, accès déplacé) et le cœur les juge avec ses opérations existantes (insertion et mise à jour de vue, insertion d'annotation). La page ne recopie aucune règle du cœur. Seule l'option Q1 (b) ou la variante de D10 demanderaient du Rust | Règle « Rust calcule, TypeScript lit » respectée sans toucher à la marge wasm |
## Hors périmètre
- La catégorie interne des accès et l'accès automatique (U6).
- La recopie des annotations de la parente dans une nouvelle vue et les noms proposés (U5).
- Les vues qui ont leur propre illustration : leur parcours ne change pas, hormis « Vue parente » et l'ouverture
depuis l'accès. Leur cadre est dans leur propre dessin, donc « Ajouter l'accès » pose pour elles un rectangle par
défaut au centre de la parente, à déplacer et remodeler.
- L'édition sous 1 024 px de large : l'éditeur y reste en lecture seule ; le retour à la parente s'y fait par sa puce dans la rangée.
## Ce que toucherait l'implémentation (sans code ici)
- Éditeur : la colonne d'outils et la rangée d'ajout (D3), le décideur d'appui (tracé du cadre au glissé, priorité
des annotations sur les accès, D4 et D10), des poignées de cadre bâties sur celles des sommets (D6), l'état de
travail (création d'une vue, recadrage), le dialogue « Nouvelle vue de détail » bâti sur le dialogue de création,
le bandeau (« Ouvrir la vue », « Recadrer la vue », « Vue parente »), « Gérer les vues »
(« Recadrer sur le dessin », « Valeurs précises », « Ajouter l'accès »).
- Catalogue et bilan : la priorité des annotations sur les accès, le retour dans la fenêtre de détail.
- `docs/ANNOTATION-RENDERING.md` mis à jour d'abord (cadre, fantômes, priorité d'appui), libellés FR et EN, tests
unitaires et navigateur.
- Le budget de la colonne épinglée ne change pas : aucune ligne n'est ajoutée autour du dessin.
## Panneaux de la planche
Voir `maquettes.html` : chaque panneau porte son numéro, les arbitrages qu'il montre et sa légende.
Binary file not shown.

After

Width:  |  Height:  |  Size: 157 KiB

@@ -0,0 +1,783 @@
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Faunosteo V1-2.6 U2 vues de détail tracées sur le dessin (proposition)</title>
<!--
V1-2.6 U2 detail views board (owner request 2026-11-22, README.md of this folder, arbitrations D1 to D21): static
functional mockups, never shipped, NOT validated. Styles, icons, shell and drawing helpers are copied from
docs/design/v1-2-6-u2/maquettes.html (the U2 board); the chip band is the one built for criterion 32
(docs/design/v1-2-6-u2-chips/board.html); labels come from apps/app/src/i18n/fr.ts when the README gives none.
Annotations, categories and coordinates come from ../v1-2-6-u2/data.js (equine draft document.json, loaded by relative
path, not copied). The drawing is the draft horse.svg. Panel 13 shows a hypothetical nested view (« Incisives »),
invented for that panel only. Rendered to one PNG per panel by ../v1-2-6/render.cjs.
-->
<style>
:root {
--color-bg: #fbf9f5; --color-surface: #ffffff; --color-surface-strong: #f4efe6;
--color-ink: #1f1b16; --color-ink-muted: #6b6359; --color-border: #e7e0d2;
--color-accent: #b85a3f; --color-accent-strong: #9c4831;
--color-danger: #c0392b; --color-danger-strong: #962c21;
--severity-mild: #6b8e6b; --severity-moderate: #b88a3f; --severity-severe: #c0392b;
--font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
--font-serif: 'Fraunces', 'Iowan Old Style', Georgia, serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: #ece6da; font-family: var(--font-sans); color: var(--color-ink); -webkit-font-smoothing: antialiased; }
.sheet-title { font: 600 15px var(--font-sans); margin: 0 0 10px; }
.row { display: flex; gap: 28px; align-items: flex-start; padding: 24px 28px; flex-wrap: wrap; }
[data-board] { background: #ece6da; padding: 16px; }
.frame { background: var(--color-bg); border: 1px solid var(--color-border); border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(31,27,22,.06); position: relative; }
.desk { width: 1280px; height: 800px; display: flex; }
.tab-frame { width: 1180px; height: 820px; display: flex; flex-direction: column; border-radius: 22px; border: 10px solid #2a2520; }
.phone { width: 375px; height: 780px; display: flex; flex-direction: column; border-radius: 28px; border: 8px solid #2a2520; position: relative; }
.side { width: 216px; flex: none; background: var(--color-surface); border-right: 1px solid var(--color-border); display: flex; flex-direction: column; }
.side .logo { padding: 20px; } .side .logo img { height: 32px; }
.nav { padding: 0 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 9px 12px; border-radius: 8px; font-size: 14px; color: var(--color-ink-muted); }
.nav a.on { background: var(--color-surface-strong); color: var(--color-ink); font-weight: 500; }
.nav a.on::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--color-accent); }
.nav hr { border: 0; border-top: 1px solid var(--color-border); margin: 8px 4px; width: 100%; }
.side .foot { border-top: 1px solid var(--color-border); padding: 16px; font-size: 14px; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.top { height: 52px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--color-border); background: rgba(255,255,255,.95); }
.top .crumb { font-size: 13px; color: var(--color-ink-muted); white-space: nowrap; overflow: hidden; }
.top .crumb b { color: var(--color-ink); font-weight: 500; }
.top .me { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--color-accent); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.ehead { padding: 12px 24px 0; display: flex; align-items: center; gap: 10px; }
h1.page { font: 400 22px/1.2 var(--font-serif); margin: 0; white-space: nowrap; }
h2.sec { font: 400 18px/1.3 var(--font-serif); margin: 0 0 10px; }
.card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; box-shadow: 0 1px 2px rgba(31,27,22,.05); }
.muted { color: var(--color-ink-muted); }
.small { font-size: 12px; } .s13 { font-size: 13px; } .s14 { font-size: 14px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--color-surface-strong); white-space: nowrap; }
.badge.warn { background: #fffbeb; color: #b45309; }
.badge.danger { background: #fef2f2; color: #b91c1c; }
.badge.ok { background: color-mix(in srgb, var(--severity-mild) 14%, white); color: #3f5e3f; }
.badge.accent { background: rgba(184,90,63,.1); color: var(--color-accent-strong); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 8px; font-size: 14px; font-weight: 500; border: 1px solid transparent; white-space: nowrap; }
.btn.sm { height: 34px; padding: 0 11px; border-radius: 6px; font-size: 13px; }
.btn.lg { height: 46px; padding: 0 16px; font-size: 15px; }
.btn.primary { background: var(--color-accent); color: #fff; }
.btn.secondary { background: var(--color-surface); border-color: var(--color-border); }
.btn.ghost { background: transparent; }
.btn.dangertxt { background: transparent; color: var(--color-danger-strong); }
.btn.on { background: var(--color-ink); color: var(--color-bg); border-color: var(--color-ink); }
.btn[disabled] { opacity: .45; }
.notice { display: flex; gap: 8px; align-items: flex-start; border: 1px solid; border-radius: 8px; padding: 9px 12px; font-size: 13px; line-height: 1.4; }
.notice.info { border-color: var(--color-border); background: var(--color-surface-strong); }
.notice.error { border-color: rgba(192,57,43,.4); background: color-mix(in srgb, var(--color-danger) 8%, white); color: var(--color-danger-strong); }
.notice.success { border-color: rgba(107,142,107,.4); background: color-mix(in srgb, var(--severity-mild) 10%, white); }
.notice.warn { border-color: rgba(184,138,63,.45); background: color-mix(in srgb, var(--severity-moderate) 10%, white); }
.notice svg { flex: none; margin-top: 1px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; min-width: 0; }
.field label { font-weight: 500; }
.inp { height: 36px; border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-surface); padding: 0 10px; display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; overflow: hidden; }
.inp.area { height: auto; min-height: 72px; align-items: flex-start; padding: 8px 10px; white-space: normal; line-height: 1.45; font-size: 13px; }
.inp.focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(184,90,63,.18); }
.inp .caret { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip { height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-surface); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.chip.on { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-bg); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--color-border); padding: 0 16px; margin-top: 8px; }
.tabs a { padding: 10px 14px; font-size: 14px; color: var(--color-ink-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs a.on { color: var(--color-accent-strong); border-color: var(--color-accent); font-weight: 500; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.sm { width: 15px; height: 15px; } .icon.lg { width: 22px; height: 22px; }
.mono { font-family: ui-monospace, 'DejaVu Sans Mono', monospace; font-size: 12px; }
.annot { background: #fff8e6; border: 1px dashed #c9a35a; color: #6b5323; border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.45; }
.annot b { color: #4a3916; }
.annot.inline { padding: 4px 9px; font-size: 12px; align-self: flex-start; }
/* editor */
.work { flex: 1; display: flex; gap: 12px; padding: 10px 16px 12px; min-height: 0; }
.stage { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.toolbar { display: flex; align-items: center; gap: 6px; }
.toolbar .sep { width: 1px; height: 24px; background: var(--color-border); margin: 0 4px; }
.tbtn { height: 36px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--color-border); background: var(--color-surface); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; white-space: nowrap; }
.tbtn.on { background: var(--color-ink); color: var(--color-bg); border-color: var(--color-ink); }
.tbtn.ico { width: 36px; padding: 0; justify-content: center; }
.tbtn[disabled] { opacity: .4; }
.canvas { position: relative; flex: 1; min-height: 0; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.canvas svg.drawing { display: block; }
.hint { position: absolute; left: 12px; top: 12px; background: rgba(31,27,22,.88); color: #fbf9f5; border-radius: 8px; padding: 7px 11px; font-size: 13px; line-height: 1.35; max-width: 70%; }
.hint kbd, .kbd { font: 500 11px var(--font-sans); border: 1px solid rgba(255,255,255,.35); border-radius: 4px; padding: 0 4px; }
.zoombox { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 4px; align-items: center; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 8px; padding: 3px; font-size: 12px; }
.zoombox span.z { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; }
.toast { position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; background: var(--color-ink); color: var(--color-bg); border-radius: 10px; padding: 9px 12px; font-size: 13px; display: flex; gap: 12px; align-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.18); white-space: nowrap; }
.toast a { color: #f2c1ae; font-weight: 600; }
.toast.err { background: #7a2318; }
.panel { width: 320px; flex: none; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.pcard { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; }
.phead { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.phead .r { margin-left: auto; font-weight: 400; }
.lrow { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 30px; }
.lrow .r { margin-left: auto; }
.sw { width: 18px; height: 18px; border-radius: 5px; flex: none; border: 1px solid rgba(0,0,0,.12); background-image: linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%),linear-gradient(45deg,#ddd 25%,transparent 25%,transparent 75%,#ddd 75%); background-size: 8px 8px; background-position: 0 0,4px 4px; position: relative; overflow: hidden; }
.sw i { position: absolute; inset: 0; }
.sw.lg { width: 26px; height: 26px; border-radius: 7px; }
.slider { position: relative; height: 22px; display: flex; align-items: center; }
.slider .track { height: 6px; border-radius: 3px; background: var(--color-surface-strong); border: 1px solid var(--color-border); width: 100%; position: relative; }
.slider .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--color-accent); }
.slider .knob { position: absolute; top: 50%; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--color-accent); transform: translate(-50%,-50%); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.slider .mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--color-danger); }
.seg { display: flex; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; font-size: 12px; }
.seg span { flex: 1; text-align: center; padding: 7px 4px; border-left: 1px solid var(--color-border); white-space: nowrap; }
.seg span:first-child { border-left: 0; }
.seg span.on { background: var(--color-ink); color: var(--color-bg); }
.thumb { width: 54px; height: 40px; border-radius: 6px; border: 1px solid var(--color-border); overflow: hidden; flex: none; background: #fff; }
.menu { position: absolute; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; box-shadow: 0 10px 28px rgba(31,27,22,.16); padding: 6px; font-size: 13px; z-index: 5; }
.menu div { padding: 8px 10px; border-radius: 6px; display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.menu div.on { background: var(--color-surface-strong); }
.menu hr { border: 0; border-top: 1px solid var(--color-border); margin: 4px 0; }
.pop { position: absolute; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; box-shadow: 0 14px 34px rgba(31,27,22,.2); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; z-index: 6; }
.dialog-wrap { position: absolute; inset: 0; background: rgba(31,27,22,.42); display: grid; place-items: center; z-index: 8; }
.dialog { background: var(--color-surface); border-radius: 16px; padding: 20px 22px; box-shadow: 0 10px 30px rgba(0,0,0,.2); display: flex; flex-direction: column; gap: 12px; }
table.t { border-collapse: collapse; width: 100%; font-size: 13px; }
table.t th, table.t td { border-bottom: 1px solid var(--color-border); padding: 6px 6px; text-align: left; vertical-align: middle; }
table.t th { font-size: 12px; font-weight: 600; color: var(--color-ink-muted); }
table.t .inp { height: 32px; font-size: 13px; }
.palette { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.palette span { height: 26px; border-radius: 6px; border: 1px solid rgba(0,0,0,.12); }
.palette span.on { outline: 2px solid var(--color-ink); outline-offset: 2px; }
.ph-top { height: 52px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--color-border); background: var(--color-surface); flex: none; font-size: 14px; }
.ph-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: var(--color-surface); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 24px rgba(31,27,22,.14); padding: 8px 14px 14px; display: flex; flex-direction: column; gap: 10px; z-index: 4; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--color-border); align-self: center; }
.ptools { display: flex; justify-content: space-around; border-top: 1px solid var(--color-border); background: var(--color-surface); padding: 6px 4px 10px; flex: none; }
.ptools span { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; min-width: 80px; padding: 0 6px; white-space: nowrap; min-height: 48px; justify-content: center; border-radius: 10px; color: var(--color-ink-muted); }
.ptools span.on { background: var(--color-ink); color: var(--color-bg); }
.callout { position: absolute; z-index: 7; }
.lead { position: absolute; border-top: 1.5px dashed #c9a35a; transform-origin: 0 0; z-index: 7; }
.vign { display: flex; flex-direction: column; gap: 8px; }
.vign > .lbl { font-size: 13px; font-weight: 600; }
/* complement */
mark { background: #fde7c7; color: inherit; border-radius: 3px; padding: 0 1px; }
.cb { width: 16px; height: 16px; border: 1.5px solid var(--color-ink-muted); border-radius: 4px; display: inline-grid; place-items: center; flex: none; background: #fff; }
.cb.on { background: var(--color-accent); border-color: var(--color-accent); }
.cb.on::after { content: ''; width: 8px; height: 4px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.ring { outline: 2px solid var(--color-accent); outline-offset: 2px; border-radius: 6px; }
.tree .lrow { min-height: 26px; }
.count { font-size: 13px; color: var(--color-ink-muted); white-space: nowrap; }
.sbar { display: flex; align-items: center; gap: 8px; }
.fpanel { position: absolute; right: 0; top: 0; bottom: 0; background: var(--color-surface); border-left: 1px solid var(--color-border); box-shadow: -10px 0 30px rgba(31,27,22,.12); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
a.lnk { color: var(--color-accent-strong); text-decoration: underline; }
.tree .lrow { padding: 2px 0; }
/* ---------- R0 additions (same tokens, no new colour family) ---------- */
.hbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 9px; border-radius: 6px; font-size: 14px; color: var(--color-ink); white-space: nowrap; }
.hbtn[disabled] { opacity: .4; }
.focus { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.tip { position: absolute; z-index: 9; background: var(--color-ink); color: var(--color-bg); font-size: 12px; line-height: 1.35; padding: 6px 9px; border-radius: 6px; white-space: nowrap; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.clr { width: 28px; height: 28px; margin-left: auto; margin-right: -4px; display: grid; place-items: center; border-radius: 6px; color: var(--color-ink-muted); flex: none; }
.clr.big { width: 44px; height: 44px; margin-right: -10px; }
.sortsel { display: flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }
.sortsel .inp { min-width: 210px; }
.rlist { display: flex; flex-direction: column; gap: 8px; }
.rtile { border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-surface); }
.rtile.open { border-color: var(--color-border); box-shadow: 0 2px 8px rgba(31,27,22,.06); }
.rhead { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; min-height: 44px; }
.rhead .chev { width: 24px; height: 24px; display: grid; place-items: center; flex: none; color: var(--color-ink-muted); margin-top: -1px; }
.rcit { flex: 1; min-width: 0; font-size: 14px; line-height: 1.45; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rmeta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; width: 168px; }
.rmeta .cnt { font-size: 12px; color: var(--color-ink-muted); white-space: nowrap; }
.rbody { border-top: 1px solid var(--color-border); padding: 12px 16px 14px 48px; display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.rdl { display: grid; grid-template-columns: 76px 1fr; gap: 6px 10px; margin: 0; }
.rdl dt { color: var(--color-ink-muted); }
.rdl dd { margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rcited .lrow { min-height: 32px; border-top: 1px solid var(--color-surface-strong); }
.rcited .path { color: var(--color-ink-muted); }
.ractions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ractions .sep { width: 1px; height: 22px; background: var(--color-border); margin: 0 2px; }
.rtile.ph .rhead { flex-wrap: wrap; padding: 10px 12px; }
.rtile.ph .rmeta { width: auto; flex-direction: row; align-items: center; gap: 8px; padding-left: 34px; flex-basis: 100%; }
.rtile.ph .rbody { padding: 12px 12px 14px 12px; }
.rtile.ph .rdl { grid-template-columns: 52px 1fr; }
.ph-body > * { flex-shrink: 0; }
.scrollbar { position: absolute; right: 2px; width: 5px; border-radius: 3px; background: rgba(31,27,22,.25); }
.pbody { flex: 1; min-height: 0; padding: 26px 32px; display: flex; flex-direction: column; gap: 16px; overflow: hidden; }
h1.big { font: 400 30px/1.2 var(--font-serif); margin: 0; }
.srow { display: flex; flex-direction: column; gap: 3px; padding: 11px 16px; border-top: 1px solid var(--color-border); }
.srow:first-child { border-top: 0; }
.srow .l1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.srow .l1 b { font-weight: 500; }
.srow .l2 { font-size: 13px; color: var(--color-ink-muted); }
.srow .date { margin-left: auto; font-size: 13px; color: var(--color-ink-muted); white-space: nowrap; }
.mini { position: relative; width: 250px; height: 170px; border: 1px solid var(--color-border); border-radius: 10px; background: var(--color-bg); overflow: hidden; }
.mini .blk { position: absolute; background: var(--color-surface-strong); border-radius: 4px; }
.mini .scr { position: absolute; left: 0; right: 0; bottom: 0; top: 46px; background: rgba(31,27,22,.25); }
.mini .pan { position: absolute; top: 46px; bottom: 0; right: 0; width: 140px; background: var(--color-surface); border-left: 1px solid var(--color-border); box-shadow: -8px 0 18px rgba(31,27,22,.12); }
.mini .pan i { display: block; height: 8px; margin: 10px 12px 0; border-radius: 3px; background: var(--color-surface-strong); }
.ccard { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 16px; box-shadow: 0 1px 2px rgba(31,27,22,.05); padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.ccard h2 { font: 400 20px/1.25 var(--font-serif); margin: 0; }
table.esc { border-collapse: collapse; width: 100%; font-size: 13px; }
table.esc th, table.esc td { border-bottom: 1px solid var(--color-border); padding: 7px 8px; text-align: left; vertical-align: top; }
table.esc th { font-size: 12px; color: var(--color-ink-muted); font-weight: 600; }
table.esc td.n { font-weight: 700; color: var(--color-accent-strong); width: 22px; }
/* ---------- U2 additions (same tokens, no new colour family) ---------- */
.side { width: 256px; }
.work.u2 { flex-direction: column; gap: 0; padding: 10px 32px 12px; }
.work.u2.tab { padding: 10px 22px 12px; }
.btn.danger { background: var(--color-danger); color: #fff; }
.strip { height: 52px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 12px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 10px; min-width: 0; }
.strip.act { background: var(--color-surface-strong); }
.strip.alert { border-color: rgba(192,57,43,.45); background: color-mix(in srgb, var(--color-danger) 6%, white); }
.strip.big { height: 62px; }
.strip .slead { display: inline-flex; flex: 0 1 auto; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; min-width: 0; max-width: 420px; overflow: hidden; }
.strip .slead2 { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; flex: 0 1 auto; max-width: 400px; }
.strip .slead2 .l1 { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; white-space: nowrap; min-width: 0; }
.strip .slead2 .l1 .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.strip .slead2 .l1 .badge { flex: none; font-weight: 500; }
.strip .slead2 .l2 { font-size: 12px; color: var(--color-ink-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-left: 23px; }
.strip.alert .slead2 .l2 { color: var(--color-danger-strong); font-weight: 600; }
.strip .stxt { font-size: 13px; line-height: 1.3; color: var(--color-ink-muted); overflow: hidden; min-width: 0; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.strip.alert .stxt { color: var(--color-danger-strong); }
.strip .sact { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.sz { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; margin-right: 8px; }
.sz .slider { height: 28px; }
.sz.big .slider { height: 44px; }
.sz.big .knob { width: 28px; height: 28px; }
.snap { position: absolute; top: 13px; width: 2px; height: 7px; background: var(--color-ink-muted); transform: translateX(-1px); border-radius: 1px; }
.dback { position: absolute; inset: 0; background: rgba(31,27,22,.22); z-index: 8; }
.dlgu { position: absolute; top: 0; right: 0; z-index: 9; background: var(--color-surface); border-radius: 16px; box-shadow: 0 18px 40px rgba(31,27,22,.28); display: flex; flex-direction: column; overflow: hidden; }
.dlgu.static { position: relative; }
.dlgu .dh { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--color-border); padding: 6px 6px 6px 24px; }
.dlgu .dh h2 { font-size: 18px; font-weight: 600; margin: 0; line-height: 1.3; flex: 1; min-width: 0; }
.dlgu .dx { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; flex: none; }
.dlgu .db { padding: 14px 24px 14px; display: flex; flex-direction: column; gap: 11px; }
.dlgu .df { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 0 24px 16px; }
.rd { display: grid; grid-template-columns: 112px 1fr; gap: 7px 10px; margin: 0; font-size: 14px; }
.rd dt { color: var(--color-ink-muted); font-size: 13px; padding-top: 1px; }
.rd dd { margin: 0; min-width: 0; display: flex; align-items: flex-start; gap: 6px; line-height: 1.35; }
.inp.bad { border-color: rgba(192,57,43,.6); box-shadow: 0 0 0 3px rgba(192,57,43,.12); }
.toastu { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: var(--color-ink); color: var(--color-bg); border-radius: 10px; padding: 6px 6px 6px 14px; font-size: 13px; display: flex; gap: 10px; align-items: center; white-space: nowrap; box-shadow: 0 8px 20px rgba(31,27,22,.25); z-index: 3; }
.toastu .ua { color: #f2c1ae; font-weight: 600; padding: 5px 9px; border-radius: 6px; }
.toastu.err { background: #7a2318; padding-right: 14px; }
.ocard { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.ocard .ot { display: flex; align-items: center; font-size: 14px; font-weight: 600; }
.ocard .ot .r { margin-left: auto; font-weight: 400; font-size: 13px; color: var(--color-ink-muted); }
.arow { display: flex; align-items: center; gap: 8px; font-size: 13px; min-height: 30px; padding: 0 6px; border-radius: 6px; }
.arow.cur { background: var(--color-surface-strong); }
.arow.on { background: var(--color-surface-strong); box-shadow: inset 2px 0 0 var(--color-accent); }
.arow .k { width: 38px; color: var(--color-ink-muted); font-size: 12px; flex: none; }
.arow .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps { display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.steps .st { display: grid; grid-template-columns: 26px 1fr; gap: 8px; align-items: start; }
.steps .st .no { width: 24px; height: 24px; border-radius: 50%; background: var(--color-surface-strong); display: grid; place-items: center; font-weight: 600; font-size: 12px; }
.steps .st.bad .no { background: color-mix(in srgb, var(--color-danger) 14%, white); color: var(--color-danger-strong); }
.steps .st.good .no { background: color-mix(in srgb, var(--severity-mild) 18%, white); color: #3f5e3f; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border: 1px solid var(--color-border); border-radius: 6px; font-size: 12px; background: var(--color-surface); white-space: nowrap; }
.ocard > .inp { flex: none; }
.arow { min-height: 36px; }
.entry { height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--color-border); display: inline-flex; align-items: center; font-size: 13px; background: var(--color-surface); white-space: nowrap; }
.msg { margin-left: auto; height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 12px; border-radius: 8px; background: var(--color-ink); color: var(--color-bg); font-size: 13px; white-space: nowrap; max-width: 330px; }
.msg.big { height: 44px; }
.msg .t { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.msg .ua { color: #f2c1ae; font-weight: 600; padding: 4px 8px; border-radius: 6px; flex: none; }
.msg.err { background: #7a2318; padding-right: 12px; max-width: 560px; }
.arrowpad { display: inline-flex; gap: 4px; margin-right: 6px; }
.arrowpad .btn { width: 34px; padding: 0; font-size: 16px; }
.arrowpad.big .btn { width: 44px; height: 44px; }
.geo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--color-surface-strong); }
.geo a { color: var(--color-accent-strong); text-decoration: underline; font-weight: 500; }
.ferr { font-size: 12px; color: var(--color-danger-strong); }
.racts { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--color-border); padding-top: 12px; }
.racts .r1, .racts .r2 { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.racts .r2 { justify-content: space-between; }
.inp .v { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.inp .v .sw { display: inline-block; vertical-align: -4px; margin-right: 8px; }
.tab-frame .hbtn { height: 44px; }
.tab-frame .tabs a { min-height: 44px; }
.inp .caret { flex: none; }
/* ---------- detail-views additions (same tokens, no new colour family) ---------- */
.win11 { width: 1180px; display: flex; flex-direction: column; }
.tab-frame.auto { height: auto; }
.strip .sact { position: relative; }
.rad { width: 16px; height: 16px; border: 1.5px solid var(--color-ink-muted); border-radius: 50%; flex: none; background: #fff; margin-top: 1px; display: inline-grid; place-items: center; }
.rad.on { border-color: var(--color-accent); }
.rad.on::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); }
.req { color: var(--color-danger-strong); margin-left: 2px; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 24px; padding: 0 6px; border-radius: 5px; border: 1px solid #cfc6b6; border-bottom-width: 2px; background: #fff; font: 600 12px var(--font-sans); color: var(--color-ink); }
.krow { display: flex; align-items: center; gap: 6px; font-size: 13px; min-height: 34px; border-top: 1px solid var(--color-surface-strong); }
.krow:first-of-type { border-top: 0; }
/* chip band of criterion 32: a 44 px band, 30 px pills, active chip dark with a check mark, fade and chevron */
.vband { position: relative; height: 44px; flex: none; }
.vrow { display: flex; align-items: center; height: 44px; padding: 0 4px; overflow: hidden; }
.vchip { height: 44px; flex: none; padding: 0 4px; color: var(--color-ink); font: 14px var(--font-sans); display: inline-flex; align-items: center; }
.cpill { height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--color-border); background: var(--color-surface); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.vchip.on .cpill { background: var(--color-ink); border-color: var(--color-ink); color: #fff; font-weight: 500; }
.vhint { position: absolute; top: 0; bottom: 0; right: 0; width: 72px; display: none; align-items: center; justify-content: flex-end; pointer-events: none; background: linear-gradient(to right, rgba(251,249,245,0), var(--color-bg) 58%); }
.vhint.show { display: flex; }
.chev { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-ink-muted); display: grid; place-items: center; box-shadow: 0 1px 3px rgba(31,27,22,.10); }
/* phone */
.ph-top .ro { margin-left: auto; font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--color-surface-strong); color: var(--color-ink-muted); white-space: nowrap; }
.ph-tabs { display: flex; justify-content: space-around; border-bottom: 1px solid var(--color-border); background: var(--color-surface); flex: none; }
.ph-tabs a { padding: 12px 6px; font-size: 13px; color: var(--color-ink-muted); border-bottom: 2px solid transparent; }
.ph-tabs a.on { color: var(--color-ink); font-weight: 600; border-bottom-color: var(--color-accent); }
/* Gérer les vues */
.vm-sec { font: 600 15px var(--font-sans); margin: 0 0 8px; }
.vm-card { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 12px; padding: 12px 14px; display: flex; gap: 14px; align-items: flex-start; }
.vm-thumb { width: 96px; height: 72px; border: 1px solid var(--color-border); border-radius: 8px; overflow: hidden; flex: none; background: #fff; }
.vm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.vm-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.vm-acts { display: flex; gap: 6px; align-items: center; flex: none; }
.disc { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--color-ink-muted); height: 34px; padding: 0 6px; white-space: nowrap; }
</style>
</head>
<body>
<svg width="0" height="0" style="position:absolute">
<symbol id="i-dashboard" viewBox="0 0 24 24"><path d="M4 4h7v7H4zM13 4h7v4h-7zM13 11h7v9h-7zM4 14h7v6H4z"/></symbol>
<symbol id="i-users" viewBox="0 0 24 24"><path d="M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM2 21a7 7 0 0 1 14 0M16 3.5a4 4 0 0 1 0 7M22 21a7 7 0 0 0-4.5-6.5"/></symbol>
<symbol id="i-paw" viewBox="0 0 24 24"><path d="M5.5 12a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6zM9 8.4a1.9 1.9 0 1 0 0-3.8 1.9 1.9 0 0 0 0 3.8zM15 8.4a1.9 1.9 0 1 0 0-3.8 1.9 1.9 0 0 0 0 3.8zM18.5 12a1.8 1.8 0 1 0 0-3.6 1.8 1.8 0 0 0 0 3.6zM12 11c-3 0-5.5 4.5-5.5 6.5 0 2 2 2.5 3 2.2 1-.3 1.6-.7 2.5-.7s1.5.4 2.5.7c1 .3 3-.2 3-2.2 0-2-2.5-6.5-5.5-6.5z"/></symbol>
<symbol id="i-user" viewBox="0 0 24 24"><path d="M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM4 21a8 8 0 0 1 16 0"/></symbol>
<symbol id="i-tool" viewBox="0 0 24 24"><path d="M14 3l7 7-4 4-7-7zM10 10l-6 6 4 4 6-6M3 21l3-3"/></symbol>
<symbol id="i-check" viewBox="0 0 24 24"><path d="M5 12l5 5L20 7"/></symbol>
<symbol id="i-alert" viewBox="0 0 24 24"><path d="M12 9v4M12 17h.01M10.3 3.9L2.8 17a2 2 0 0 0 1.7 3h15a2 2 0 0 0 1.7-3L13.7 3.9a2 2 0 0 0-3.4 0z"/></symbol>
<symbol id="i-info" viewBox="0 0 24 24"><path d="M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 11v5M12 8h.01"/></symbol>
<symbol id="i-menu" viewBox="0 0 24 24"><path d="M4 7h16M4 12h16M4 17h16"/></symbol>
<symbol id="i-close" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6L6 18"/></symbol>
<symbol id="i-book" viewBox="0 0 24 24"><path d="M4 5a2 2 0 0 1 2-2h13v16H6a2 2 0 0 0-2 2zM4 21V5M8 7h7M8 11h5"/></symbol>
<symbol id="i-shield" viewBox="0 0 24 24"><path d="M12 3l8 3v6c0 4.5-3.4 8-8 9-4.6-1-8-4.5-8-9V6zM9 12l2 2 4-4"/></symbol>
<symbol id="i-search" viewBox="0 0 24 24"><path d="M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM20 20l-4-4"/></symbol>
<symbol id="i-cursor" viewBox="0 0 24 24"><path d="M5 3l14 7-6 2-2 6z"/></symbol>
<symbol id="i-point" viewBox="0 0 24 24"><path d="M12 16a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 2v3M12 19v3M2 12h3M19 12h3"/></symbol>
<symbol id="i-zone" viewBox="0 0 24 24"><path d="M5 7l7-4 7 5-2 10-9 2-3-6z"/></symbol>
<symbol id="i-crop" viewBox="0 0 24 24"><path d="M6 2v14a2 2 0 0 0 2 2h14M2 6h14a2 2 0 0 1 2 2v14"/></symbol>
<symbol id="i-hand" viewBox="0 0 24 24"><path d="M8 13V5.5a1.5 1.5 0 0 1 3 0V12M11 11V4a1.5 1.5 0 0 1 3 0v7M14 11V5.5a1.5 1.5 0 0 1 3 0V13M17 9.5a1.5 1.5 0 0 1 3 0V15a7 7 0 0 1-7 7h-1a7 7 0 0 1-5.5-2.7L3.6 15.5a1.6 1.6 0 0 1 2.5-2L8 15.5"/></symbol>
<symbol id="i-undo" viewBox="0 0 24 24"><path d="M9 14L4 9l5-5M4 9h10a6 6 0 0 1 0 12h-3"/></symbol>
<symbol id="i-redo" viewBox="0 0 24 24"><path d="M15 14l5-5-5-5M20 9H10a6 6 0 0 0 0 12h3"/></symbol>
<symbol id="i-plus" viewBox="0 0 24 24"><path d="M12 5v14M5 12h14"/></symbol>
<symbol id="i-minus" viewBox="0 0 24 24"><path d="M5 12h14"/></symbol>
<symbol id="i-trash" viewBox="0 0 24 24"><path d="M4 7h16M10 11v6M14 11v6M5 7l1 13h12l1-13M9 7V4h6v3"/></symbol>
<symbol id="i-lock" viewBox="0 0 24 24"><path d="M6 11h12v10H6zM8 11V7a4 4 0 0 1 8 0v4"/></symbol>
<symbol id="i-eye" viewBox="0 0 24 24"><path d="M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/></symbol>
<symbol id="i-chevron" viewBox="0 0 24 24"><path d="M9 6l6 6-6 6"/></symbol>
<symbol id="i-down" viewBox="0 0 24 24"><path d="M6 9l6 6 6-6"/></symbol>
<symbol id="i-up" viewBox="0 0 24 24"><path d="M6 15l6-6 6 6"/></symbol>
<symbol id="i-move" viewBox="0 0 24 24"><path d="M12 2v20M2 12h20M12 2l-3 3M12 2l3 3M12 22l-3-3M12 22l3-3M2 12l3-3M2 12l3 3M22 12l-3-3M22 12l-3 3"/></symbol>
<symbol id="i-pen" viewBox="0 0 24 24"><path d="M4 20l4-1 11-11-3-3L5 16zM14 6l3 3"/></symbol>
<symbol id="i-image" viewBox="0 0 24 24"><path d="M4 4h16v16H4zM4 16l5-5 4 4 3-3 4 4M15 9h.01"/></symbol>
<symbol id="i-gear" viewBox="0 0 24 24"><path d="M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-2.9 1.2V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-2.9-1.2l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1A1.7 1.7 0 0 0 3 15H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.2-2.9l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1A1.7 1.7 0 0 0 9 4.6V4a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 2.9 1.2l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1A1.7 1.7 0 0 0 20.9 11H21a2 2 0 1 1 0 4z"/></symbol>
<symbol id="i-dots" viewBox="0 0 24 24"><path d="M12 6h.01M12 12h.01M12 18h.01"/></symbol>
<symbol id="i-grip" viewBox="0 0 24 24"><path d="M9 6h.01M15 6h.01M9 12h.01M15 12h.01M9 18h.01M15 18h.01"/></symbol>
<symbol id="i-clock" viewBox="0 0 24 24"><path d="M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 7v5l3 2"/></symbol>
<symbol id="i-spin" viewBox="0 0 24 24"><path d="M12 3a9 9 0 1 0 9 9"/></symbol>
<symbol id="i-cloud-off" viewBox="0 0 24 24"><path d="M3 3l18 18M8 8a5 5 0 0 0-3 9h11M18 17a4 4 0 0 0-1.5-7.7A6 6 0 0 0 10.6 5"/></symbol>
<symbol id="i-layers" viewBox="0 0 24 24"><path d="M12 3l9 5-9 5-9-5zM3 13l9 5 9-5"/></symbol>
<symbol id="i-fit" viewBox="0 0 24 24"><path d="M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5"/></symbol>
<symbol id="i-spine" viewBox="0 0 24 24"><path d="M6 5h12M7 9h10M6 13h12M7 17h10M12 3v18"/></symbol>
<symbol id="i-file" viewBox="0 0 24 24"><path d="M6 3h8l4 4v14H6zM14 3v4h4"/></symbol>
<symbol id="i-copy" viewBox="0 0 24 24"><path d="M9 9h11v11H9zM5 15H4V4h11v1"/></symbol>
<symbol id="i-external" viewBox="0 0 24 24"><path d="M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"/></symbol>
<symbol id="i-sort" viewBox="0 0 24 24"><path d="M7 4v16M7 20l-3-3M7 20l3-3M17 20V4M17 4l-3 3M17 4l3 3"/></symbol>
<symbol id="i-deselect" viewBox="0 0 24 24"><path d="M4 8V5a1 1 0 0 1 1-1h3M16 4h3a1 1 0 0 1 1 1v3M20 16v3a1 1 0 0 1-1 1h-3M8 20H5a1 1 0 0 1-1-1v-3M9 9l6 6M15 9l-6 6"/></symbol>
<symbol id="i-view" viewBox="0 0 24 24"><path d="M3 8V5a2 2 0 0 1 2-2h3M16 3h3a2 2 0 0 1 2 2v3M21 16v3a2 2 0 0 1-2 2h-3M8 21H5a2 2 0 0 1-2-2v-3M9 9h6v6H9z"/></symbol>
<symbol id="i-arrow-up" viewBox="0 0 24 24"><path d="M12 19V5M5 12l7-7 7 7"/></symbol>
<symbol id="i-arrow-left" viewBox="0 0 24 24"><path d="M19 12H5M12 5l-7 7 7 7"/></symbol>
</svg>
<script src="../v1-2-6-u2/data.js"></script>
<script>
/* ---------- data: window.DOC (../v1-2-6-u2/data.js, generated from the equine draft document.json) ---------- */
const HORSE = '../../../supabase/seed/anatomical-sheets/equine/draft/assets/horse.svg'
const LOGO = '../../../apps/app/public/logo-horizontal.svg'
const W = 2073.4, H = 1629.4
const DOC = window.DOC
const KEY = { articulations: 'art', os: 'os', 'charnieres-vertebrales': 'charn', 'zone-colonne': 'vert', 'cadrans-du-crane': 'crane' }
const OPA = { art: .35, os: .35, charn: .35, vert: .30, crane: .35 }
const CATS = Object.fromEntries(DOC.categories.map((c) => [KEY[c.id], { id: c.id, fr: c.fr, en: c.en, c: c.color, o: OPA[KEY[c.id]] }]))
const ANN = DOC.annotations
const V_MAIN = 'Vue latérale gauche', V_HEAD = 'Tête (vue latérale gauche)', V_FET = 'Boulet antérieur', V_SHO = 'Épaule'
const nameOf = (a) => a.fr || V_HEAD
const A = ANN.map((a) => [a.view, a.kind === 'detail_trigger' ? 'link' : KEY[a.cat], nameOf(a), a.g, a.id, KEY[a.cat]])
const pts = (p) => p.map((q) => q.join(',')).join(' ')
const annById = Object.fromEntries(ANN.map((a) => [a.id, a]))
const LAT = { unpaired: 'Non latéralisée', bilateral: 'Bilatérale', left: 'Gauche', right: 'Droite' }
const ST = { to_confirm: ['warn', 'À confirmer'], reviewed: ['accent', 'Relu'], inherited: ['', 'Hérité, non relu'] }
const status = (s) => `<span class="badge ${ST[s][0]}">${ST[s][1]}</span>`
const KIND = { point: 'Point', zone: 'Zone', detail_trigger: 'Accès' }
const pl = (n, one, many) => `${n.toLocaleString('fr-FR')} ${n <= 1 ? one : many}`
const N_MAIN = ANN.filter((a) => a.view === 'main').length
const N_HEAD = ANN.filter((a) => a.view === 'head').length
// Frames in drawing units of the main view: [x, y, width, height].
const FET = [600, 1255, 320, 240], SHO = [584, 757, 400, 300], HEADBOX = [60, 100, 500, 380], INCI = [120, 360, 160, 120]
const rect = (f) => [[f[0], f[1]], [f[0] + f[2], f[1]], [f[0] + f[2], f[1] + f[3]], [f[0], f[1] + f[3]]]
const corners = rect
const ART = CATS.art
const VB = [480, 1030, 720, 540] // the zoomed place used for the fore fetlock (4:3)
const CW = 696, CH = 522 // the drawing at 1 180 px: 4:3, 44 px tool column + 8 px = 748 px column
</script>
<script>
/* ---------- drawing (copied from the U2 board, adapted: accesses in category colour, new accesses) ---------- */
// An access: category colour stroke, 6 % fill, dasharray 8 4 (the built look of the head access).
const accessPoly = (p, k, u) => `<polygon points="${pts(p)}" fill="${k.c}" fill-opacity=".06" stroke="${k.c}" stroke-width="${2 * u}" stroke-dasharray="${8 * u} ${4 * u}"/>`
// opts: vb [x,y,w,h], w, h px, faint (annotations dimmed, A12), noAnn, acc (extra accesses as polygons), extra(u) markup
function drawing(o) {
const vb = o.vb || [0, 0, W, H], w = o.w, h = o.h
const u = Math.max(vb[2] / w, vb[3] / h)
let s = `<svg class="drawing" width="${w}" height="${h}" viewBox="${vb.join(' ')}" preserveAspectRatio="xMidYMid meet"><image href="${HORSE}" x="0" y="0" width="${W}" height="${H}"/>`
if (!o.noAnn) for (const [view, cat, , g, , ck] of A) {
if (view !== 'main') continue
if (cat === 'link') { s += accessPoly(g[1], CATS[ck], u); continue }
const k = CATS[cat], fo = o.faint ? k.o * .45 : k.o, so = o.faint ? .5 : 1
const st = `fill="${k.c}" fill-opacity="${fo}" stroke="${k.c}" stroke-opacity="${so}" stroke-width="${2 * u}"`
s += g[0] === 'c' ? `<circle cx="${g[1]}" cy="${g[2]}" r="${g[3]}" ${st}/>` : `<polygon points="${pts(g[1])}" ${st}/>`
}
for (const p of o.acc || []) s += accessPoly(p, ART, u)
if (o.extra) s += o.extra(u)
return s + '</svg>'
}
// vertex handle (fine = 6 px, coarse = 9 px), midpoint plus, selection outline; u = user units per screen px
const V = (x, y, u, on, big) => on
? `<circle cx="${x}" cy="${y}" r="${(big ? 15 : 11) * u}" fill="none" stroke="#b85a3f" stroke-width="${2 * u}"/><circle cx="${x}" cy="${y}" r="${(big ? 10 : 7.5) * u}" fill="#b85a3f" stroke="#fff" stroke-width="${2.5 * u}"/>`
: `<circle cx="${x}" cy="${y}" r="${(big ? 9 : 6) * u}" fill="#fff" stroke="#1f1b16" stroke-width="${2 * u}"/>`
const HIT = (x, y, u) => `<circle cx="${x}" cy="${y}" r="${22 * u}" fill="rgba(184,90,63,.14)" stroke="#b85a3f" stroke-width="${1.8 * u}" stroke-dasharray="${4 * u} ${3 * u}"/>`
const PLUS = (x, y, u, big) => { const r = (big ? 12 : 8) * u, l = r * .55; return `<g><circle cx="${x}" cy="${y}" r="${r}" fill="#fff" stroke="#b85a3f" stroke-width="${1.6 * u}"/><path d="M${x - l} ${y}h${2 * l}M${x} ${y - l}v${2 * l}" stroke="#b85a3f" stroke-width="${2 * u}" stroke-linecap="round"/></g>` }
const SEL = (p, u) => `<polygon points="${pts(p)}" fill="none" stroke="#1f1b16" stroke-width="${2 * u}"/>`
const mids = (p) => p.map((q, i) => { const n = p[(i + 1) % p.length]; return [(q[0] + n[0]) / 2, (q[1] + n[1]) / 2] })
function polyEdit(p, u, o = {}) {
return SEL(p, u) + mids(p).map((m) => PLUS(m[0], m[1], u, o.big)).join('') + p.map((q) => V(q[0], q[1], u, false, o.big)).join('')
}
const ARROW = (x, y, u) => `<path d="M${x} ${y}l0 ${18 * u}l${5 * u} ${-5 * u}l${4 * u} ${8 * u}l${3 * u} ${-1.5 * u}l${-4 * u} ${-8 * u}l${7 * u} 0z" fill="#1f1b16" stroke="#fff" stroke-width="${1.2 * u}"/>`
const FINGER = (x, y, u) => `<circle cx="${x}" cy="${y}" r="${20 * u}" fill="rgba(31,27,22,.16)" stroke="rgba(31,27,22,.45)" stroke-width="${1.2 * u}"/>`
function LOUPE(x, y, u, inner, id, off) {
const cx = x, cy = y - (off || 70 * u), r = 38 * u
return `<defs><clipPath id="${id}"><circle cx="${cx}" cy="${cy}" r="${r}"/></clipPath></defs><circle cx="${cx}" cy="${cy}" r="${r + 3 * u}" fill="#fff" stroke="#1f1b16" stroke-width="${2 * u}"/><g clip-path="url(#${id})"><g transform="translate(${cx} ${cy}) scale(2) translate(${-x} ${-y})"><image href="${HORSE}" x="0" y="0" width="${W}" height="${H}"/>${inner}</g></g>`
}
// The detail view frame: veil outside (inside stays clear), white halo under a dashed accent outline, corner handles.
const VEIL = (f) => `<path d="M-6000 -6000H9000V9000H-6000Z M${f[0]} ${f[1]}h${f[2]}v${f[3]}h${-f[2]}Z" fill="rgba(31,27,22,.2)" fill-rule="evenodd"/>`
const OUTLINE = (f, u) => `<rect x="${f[0]}" y="${f[1]}" width="${f[2]}" height="${f[3]}" fill="none" stroke="#fff" stroke-width="${5 * u}"/><rect x="${f[0]}" y="${f[1]}" width="${f[2]}" height="${f[3]}" fill="none" stroke="#b85a3f" stroke-width="${2 * u}" stroke-dasharray="${6 * u} ${4 * u}"/>`
const HANDLES = (f, u, big) => corners(f).map((c) => V(c[0], c[1], u, false, big)).join('')
// px position in a canvas of w x h showing viewBox vb (meet)
const mapOf = (vb, w, h) => { const s = Math.min(w / vb[2], h / vb[3]), ox = (w - vb[2] * s) / 2, oy = (h - vb[3] * s) / 2; return (x, y) => [ox + (x - vb[0]) * s, oy + (y - vb[1]) * s] }
const callout = (x, y, w, html) => `<div class="annot" style="position:absolute;left:${x}px;top:${y}px;width:${w}px;z-index:7">${html}</div>`
const leaders = (w, h, segs) => `<svg width="${w}" height="${h}" style="position:absolute;left:0;top:0;z-index:6;pointer-events:none">${segs.map(([x1, y1, x2, y2]) => `<line x1="${x1}" y1="${y1}" x2="${x2}" y2="${y2}" stroke="#fff" stroke-width="5"/><line x1="${x1}" y1="${y1}" x2="${x2}" y2="${y2}" stroke="#8a6d2f" stroke-width="1.8" stroke-dasharray="5 3"/><circle cx="${x2}" cy="${y2}" r="3.5" fill="#8a6d2f"/>`).join('')}</svg>`
const CURSOR = (x, y) => `<svg width="20" height="24" viewBox="0 0 20 24" style="position:absolute;left:${x}px;top:${y}px;z-index:10"><path d="M1 1v18l5-5 4 8 3-1.5-4-8h7z" fill="#1f1b16" stroke="#fff" stroke-width="1.2"/></svg>`
</script>
<script>
/* ---------- shell and strip helpers (copied from the U2 board, adapted) ---------- */
const ico = (n, c = '') => `<svg class="icon ${c}" aria-hidden="true"><use href="#i-${n}"/></svg>`
const svgI = (d, s = 16, w = 1.8) => `<svg viewBox="0 0 24 24" width="${s}" height="${s}" fill="none" stroke="currentColor" stroke-width="${w}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d}"/></svg>`
const CHK = svgI('M5 12.5l4.2 4.2L19 7', 14, 2.4)
const ME = `<span class="me"><span class="avatar">BC</span>Bastien Chanot</span>`
const TABS = ['Général', 'Annotations', 'Constats', 'Références', 'Vérification']
const HIST = { undo: ['undo', 'Défaire', 'Défaire la dernière modification', 'Ctrl+Z ou ⌘Z'], redo: ['redo', 'Refaire', 'Refaire la dernière modification défaite', 'Ctrl+Maj+Z ou ⇧⌘Z'] }
const hbtn = (k, o = {}) => { const [i, l, n, s] = HIST[k]; return `<span class="hbtn" title="${n} (${s})"${o.off ? ' disabled' : ''}>${ico(i, 'sm')}${l}</span>` }
const hist = (o = {}) => `<span style="margin-left:auto;align-self:center;display:flex;gap:4px;padding-bottom:3px">${hbtn('undo', { off: o.undoOff })}${hbtn('redo', { off: true })}</span>`
const tabs = (on, o = {}) => '<div class="tabs">' + TABS.map((t) => `<a class="${t === on ? 'on' : ''}">${t}${t === 'Vérification' ? ` <span class="badge danger">${o.errs || '2 erreurs'}</span>` : ''}</a>`).join('') + hist(o) + '</div>'
const header = (o = {}) => `<div class="ehead"><h1 class="page">Brouillon, version 4</h1><span class="badge">Brouillon</span><span class="badge">Copie de travail</span>
<span style="margin-left:auto;display:flex;gap:8px;align-items:center"><span class="s13 muted" style="white-space:nowrap">${o.unsaved || '3 modifications non enregistrées'}</span><span class="btn secondary sm">Abandonner les modifications</span><span class="btn primary sm">Enregistrer</span></span></div>`
const CRUMB = 'Fiches officielles › Cheval, squelette et rachis › <b>Brouillon, version 4</b>'
// 1 180 px window as built: no sidebar (menu button), drawing 4:3, right column 352 px. Height follows the content.
function page(o) {
const cls = o.bezel ? 'frame tab-frame auto' : 'frame win11'
return `<div class="${cls}"><div class="main"><div class="top" style="padding:0 16px">${ico('menu')}<span class="crumb">${CRUMB}</span>${ME}</div>
${header(o)}${tabs('Annotations', o)}<div class="work u2 tab" style="${o.bezel ? '' : 'padding:10px 31px 12px'}">${o.body}</div></div>${o.dim ? '<div class="dback"></div>' : ''}</div>`
}
const B = (label, cls = 'secondary', o = {}) => `<span class="btn ${cls} ${o.big ? '' : 'sm'}" style="${o.big ? 'height:44px;' : ''}${o.style || ''}"${o.off ? ' disabled' : ''}${o.title ? ` title="${o.title}"` : ''}>${o.icon ? ico(o.icon, 'sm') : ''}${label}</span>`
const slead = (icon, text) => `<span class="slead">${ico(icon, 'sm')}${text}</span>`
const lead2 = (icon, name, badge, sub) => `<span class="slead2"><span class="l1">${ico(icon, 'sm')}<span class="nm">${name}</span>${badge || ''}</span>${sub ? `<span class="l2">${sub}</span>` : ''}</span>`
const strip = (o) => `<div class="strip ${o.act ? 'act' : ''} ${o.alert ? 'alert' : ''} ${o.big ? 'big' : ''}">${o.lead || ''}${o.text ? `<span class="stxt">${o.text}</span>` : '<span style="flex:1"></span>'}<span class="sact">${o.actions || ''}</span></div>`
const msg = (text, o = {}) => `<span class="msg ${o.err ? 'err' : ''} ${o.big ? 'big' : ''}" style="${o.left ? 'margin-left:0' : ''}" role="${o.err ? 'alert' : 'status'}"><span class="t">${text}</span>${o.err || o.plain ? '' : '<span class="ua">Défaire</span>'}</span>`
// Tool column: the fourth tool is « Vue de détail » (crop corners), which replaces « Accès » (D3).
const GL = { select: 'M5 3l12 7-5 1-3 5z', point: 'M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8zM12 3v3M12 18v3M3 12h3M18 12h3', zone: 'M12 3l8 6-3 10H7L4 9z', view: 'M3 8V5a2 2 0 0 1 2-2h3M16 3h3a2 2 0 0 1 2 2v3M21 16v3a2 2 0 0 1-2 2h-3M8 21H5a2 2 0 0 1-2-2v-3M9 9h6v6H9z', out: 'M5 11h12M20 20l-4-4', in: 'M11 5v12M5 11h12M20 20l-4-4', fit: 'M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5' }
const glyph = (k) => `<svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${GL[k]}"/></svg>`
const tbtn44 = (k, label, on) => `<span title="${label}" style="width:44px;height:44px;display:grid;place-items:center;border-radius:8px;border:1px solid var(--color-border);${on ? 'background:var(--color-ink);color:#fff' : 'background:var(--color-surface);color:var(--color-ink)'}">${glyph(k)}</span>`
const toolCol = (on = 'select') => `<div role="toolbar" style="display:flex;flex-direction:column;gap:8px;flex:none">${tbtn44('select', 'Sélectionner et déplacer', on === 'select')}${tbtn44('point', 'Point', on === 'point')}${tbtn44('zone', 'Zone', on === 'zone')}${tbtn44('view', 'Vue de détail', on === 'view')}<hr style="border:0;border-top:1px solid var(--color-border);margin:0;width:44px">${tbtn44('out', 'Zoom arrière')}${tbtn44('in', 'Zoom avant')}${tbtn44('fit', 'Ajuster')}</div>`
// Chip band of criterion 32 (one row, 44 px band, 30 px pills); the right fade and chevron show when chips are cut.
const band = (names, active, w) => `<div class="vband" style="width:${w}px"><div class="vrow" role="toolbar" aria-label="Vues">${names.map((n) => `<span class="vchip ${n === active ? 'on' : ''}"><span class="cpill">${n === active ? CHK : ''}${n}</span></span>`).join('')}</div><span class="vhint"><span class="chev">${svgI('M9 6l6 6-6 6', 16, 2)}</span></span></div>`
function addRow(o = {}) {
const b = (l, on) => `<span class="btn ${on ? 'on' : 'secondary'} ${o.big ? '' : 'sm'}" style="${o.big ? 'height:44px' : ''}"${on ? ' aria-pressed="true"' : ''}>${l}</span>`
const first = `${b('Ajouter un point')}${b('Ajouter une zone')}${b('Ajouter une vue de détail', o.pressed)}${o.centre ? b('Placer au centre') : ''}`
if (!o.below) return `<div style="display:flex;gap:8px;align-items:center;flex:none">${first}${o.msg || ''}</div>`
return `<div style="display:flex;flex-direction:column;gap:8px;flex:none"><div style="display:flex;gap:8px;align-items:center">${first}</div><div style="display:flex">${o.below}</div></div>`
}
const sw = (c, o) => `<span class="sw"><i style="background:${c};opacity:${o}"></i></span>`
// Right column as built (Vues, Catégories, Annotations de la vue); « Nouvelle vue de détail » is new (D3).
function overview(o) {
const vrows = o.vl.map(([name, n, det]) => `<div class="arow ${name === o.cur ? 'cur' : ''}" style="min-height:${o.big ? 48 : 42}px"><span style="flex:1;min-width:0"><span style="font-weight:500;display:block">${name}</span><span class="small muted">${det ? 'Vue de détail' : 'Vue principale'}</span></span><span class="small muted">${pl(n, 'annotation', 'annotations')}</span></div>`).join('')
const views = `<div class="ocard"><div class="ot">Vues</div>${vrows}<div style="display:flex;gap:8px;flex-wrap:wrap"><span class="entry">Gérer les vues</span><span class="entry">Nouvelle vue de détail</span></div></div>`
const chips = DOC.categories.map((c) => `<span class="chip" style="height:26px;font-size:12px;padding:0 9px">${sw(c.color, OPA[KEY[c.id]])}${c.fr}</span>`).join('')
const cats = `<div class="ocard"><div class="ot">Catégories<span class="r">${DOC.categories.length}</span></div><div style="display:flex;flex-wrap:wrap;gap:6px">${chips}</div><div style="display:flex;gap:6px;flex-wrap:wrap"><span class="entry">Modifier les catégories</span><span class="entry">Régions vertébrales (${pl(DOC.regions.length, 'région', 'régions')})</span></div></div>`
return `<div style="position:absolute;inset:0;display:flex;flex-direction:column;gap:8px">${views}${cats}${listCard(o)}</div>`
}
function listCard(o) {
const empty = o.noList
const extra = o.extraRows || []
const rows = []
if (!empty) for (const c of DOC.categories) {
const list = [...ANN.filter((a) => a.view === 'main' && a.cat === c.id), ...extra.filter((a) => a.cat === c.id)]
if (!list.length) continue
const head = `<div class="arow" style="min-height:28px;font-weight:600;font-size:12px">${sw(c.color, OPA[KEY[c.id]])}${c.fr}<span class="muted" style="margin-left:auto;font-weight:400">${list.length}</span></div>`
for (const a of list) rows.push({ id: a.id, head, html: `<div class="arow ${a.id === o.sel ? 'on' : ''}" style="${o.big ? 'min-height:44px' : ''}"><span class="k">${KIND[a.kind]}</span><span class="n">${nameOf(a)}</span>${status(a.status)}</div>` })
}
const at = o.sel ? Math.max(0, rows.findIndex((r) => r.id === o.sel) - 1) : 0
const body = empty ? '<div class="s13 muted" style="padding:4px 6px">Aucune annotation dans cette vue.</div>' : rows[at].head + rows.slice(at, at + (o.rows || 4)).map((r) => r.html).join('')
const count = empty ? 0 : rows.length
return `<div class="ocard" style="flex:1;min-height:0"><div class="ot">Annotations de la vue<span class="r">${count}</span></div><span class="inp" style="height:${o.big ? 44 : 36}px;flex:none"><span class="muted s13">Filtrer par nom</span></span><div style="position:relative;display:flex;flex-direction:column;gap:1px">${body}${empty ? '' : `<span class="scrollbar" style="top:${o.sel ? 40 : 0}px;height:60px"></span>`}</div></div>`
}
// The workspace: strip across both columns, then (chip band, tool column + drawing, add row) | right column.
function ws(o) {
const canvas = `<div class="canvas" style="flex:none;width:${CW}px;height:${CH}px;background:#fff;position:relative">${drawing({ w: CW, h: CH, vb: o.vb, faint: o.faint, noAnn: o.noAnn, acc: o.acc, extra: o.extra })}${o.over || ''}</div>`
const left = `<div style="display:flex;flex-direction:column;gap:8px;flex:none;width:${CW + 52}px">${band(o.names, o.active, CW + 52)}<div style="display:flex;gap:8px">${toolCol(o.tool || 'select')}${canvas}</div>${addRow(o)}</div>`
return `${o.strip}<div style="display:flex;gap:16px;margin-top:10px;min-height:${o.rowH || 0}px;flex:1"><div style="display:flex;flex-direction:column;flex:none">${left}</div><div style="width:352px;flex:none;position:relative">${overview(o)}${o.dialog || ''}</div></div>`
}
// Dialogs (as built: header with the h2 and a 44 px close button, body, footer actions), over the right column (A2).
const dlgBox = (o) => `<div class="dlgu ${o.static ? 'static' : ''}" role="dialog" aria-modal="true" style="width:${o.w || 352}px;${o.style || ''}"><div class="dh"><h2>${o.title}</h2><span class="dx" title="Fermer">${ico('close')}</span></div><div class="db">${o.body}</div>${o.foot ? `<div class="df">${o.foot}</div>` : ''}</div>`
const fld = (label, val, o = {}) => `<div class="field"${o.attr ? ` ${o.attr}` : ''}><label>${label}${o.req ? '<span class="req" aria-hidden="true">*</span>' : ''}</label><span class="inp ${o.focus ? 'focus' : ''}" style="${o.big ? 'height:44px;' : ''}"><span class="v">${val}</span>${o.sel ? `<span class="caret">${ico('down', 'sm')}</span>` : ''}</span></div>`
const CHOOSE = '<span class="muted">Choisir…</span>'
const note = (html, style = '') => `<div class="annot" style="${style}">${html}</div>`
const vig = (label, inner, w) => `<div class="vign" style="${w ? `width:${w}px` : ''}"><div class="lbl">${label}</div>${inner}</div>`
function crop(o) {
const w = o.w, h = Math.round(w * o.vb[3] / o.vb[2])
return `<div class="frame" style="width:${w + 28}px;padding:14px;display:flex;flex-direction:column;gap:10px">${o.strip || ''}<div class="canvas" style="flex:none;width:${w}px;height:${h}px;background:#fff;position:relative">${drawing({ w, h, vb: o.vb, faint: o.faint, extra: o.extra })}</div>${o.msg ? `<div style="display:flex">${o.msg}</div>` : ''}</div>`
}
function addBoard(slug, title, inner) {
const row = document.createElement('div')
row.className = 'row'
row.innerHTML = `<div data-board="${slug}"><p class="sheet-title">${title}</p>${inner}</div>`
document.body.appendChild(row)
return row
}
</script>
<script>
/* ================================================================== 00 today */
addBoard('00-aujourdhui', `00 · Aujourd'hui`, `<div class="frame" style="width:760px;padding:0;border-radius:12px"><img src="capture-aujourdhui.png" alt="Gérer les vues aujourd'hui : quatre champs de recadrage et un aperçu en pointillés" width="758" style="display:block;border-radius:12px"></div>
${note(`Aujourd'hui, « Gérer les vues » crée une vue de détail avec quatre champs numériques. L'aperçu du dessin parent montre un rectangle en pointillés que l'on ne peut ni tracer ni déplacer. L'accès se trace à part, clic par clic, avec l'outil « Accès ». La proposition remplace ces quatre champs par un tracé sur le dessin (D1, D9, D17).`, 'width:760px;margin-top:12px')}`)
</script>
<script>
/* ================================================================== 01 arm the tool */
{
const names = [V_MAIN, V_HEAD]
const vl = [[V_MAIN, N_MAIN, false], [V_HEAD, N_HEAD, true]]
const body = ws({ names, active: V_MAIN, vl, cur: V_MAIN, tool: 'view', faint: true, pressed: true, centre: true, rowH: 660,
strip: strip({ act: true, lead: slead('view', 'Vue de détail'), text: 'Tracez le cadre sur « Vue latérale gauche » : glissez sur le dessin, ou cliquez pour un cadre par défaut.' }) })
addBoard('01-armer-outil', `01 · Armer l'outil`, page({ body }) + note(`L'outil « Vue de détail » prend la place de « Accès » dans la colonne d'outils, et « Ajouter une vue de détail » celle de « Ajouter un accès » : aucune ligne de plus autour du dessin (D3, question Q4). La vue parente est celle de la rangée de vues, ici « Vue latérale gauche » (D2). Les annotations sont estompées, l'accès existant de la tête reste visible en pointillés (D7). Une fois l'outil armé, la souris ou un doigt glisse sur le dessin pour tracer le cadre : c'est un geste propre à cet outil, partout ailleurs un doigt posé hors d'une poignée ne déplace rien (A13, D4).`, 'width:1180px;margin-top:12px'))
}
</script>
<script>
/* ================================================================== 02 draw with the mouse */
{
const f = [600, 1255, 224, 168] // 70 % of 320 x 240, anchored at the first corner
const extra = (u) => `<rect x="${f[0]}" y="${f[1]}" width="${f[2]}" height="${f[3]}" fill="rgba(184,90,63,.08)"/>${OUTLINE(f, u)}<circle cx="${f[0]}" cy="${f[1]}" r="${4.5 * u}" fill="#b85a3f" stroke="#fff" stroke-width="${2 * u}"/>${ARROW(f[0] + f[2] + 2 * u, f[1] + f[3] + 2 * u, u)}`
const names = [V_MAIN, V_HEAD]
const vl = [[V_MAIN, N_MAIN, false], [V_HEAD, N_HEAD, true]]
const body = ws({ names, active: V_MAIN, vl, cur: V_MAIN, tool: 'view', faint: true, pressed: true, centre: true, vb: VB, extra, rowH: 660,
strip: strip({ act: true, lead: slead('view', 'Vue de détail'), text: 'Tracez le cadre sur « Vue latérale gauche » : glissez sur le dessin, ou cliquez pour un cadre par défaut.' }) })
addBoard('02-tracer-souris', '02 · Tracer à la souris', page({ body, undoOff: true }) + note(`Appuyer, glisser, relâcher trace le cadre, à la souris comme au doigt. Ce glisser n'existe que pour l'outil « Vue de détail » armé : hors de lui, un doigt qui ne tient pas une poignée ne déplace rien (A13). Le cadre grandit depuis son premier coin en gardant le rapport 4:3, ici à 70 % de sa taille finale (D4, D5). « Défaire » est grisé pendant le tracé (D18).`, 'width:1180px;margin-top:12px'))
}
</script>
<script>
/* ================================================================== 03 frame placed */
{
const extra = (u) => `${VEIL(FET)}${OUTLINE(FET, u)}${HANDLES(FET, u)}`
const names = [V_MAIN, V_HEAD]
const vl = [[V_MAIN, N_MAIN, false], [V_HEAD, N_HEAD, true]]
const body = ws({ names, active: V_MAIN, vl, cur: V_MAIN, tool: 'view', faint: true, pressed: true, centre: true, vb: VB, extra, rowH: 660,
strip: strip({ act: true, lead: slead('view', 'Nouvelle vue de détail'), text: 'Glissez un coin pour ajuster, faites glisser le cadre pour le déplacer.',
actions: `${B('Déplacer', 'secondary', { icon: 'move' })}${B('Retracer', 'secondary', { icon: 'pen' })}${B('Abandonner', 'ghost')}${B('Valider le cadre', 'primary', { icon: 'check' })}` }) })
addBoard('03-cadre-pose', '03 · Cadre posé', page({ body, undoOff: true }) + note(`Le cadre posé se règle par ses quatre coins, ou se déplace en le saisissant par l'intérieur (D6). Le voile hors du cadre montre ce que la vue contiendra, l'intérieur reste clair, et les autres annotations restent estompées (D5, D7). Comme au tracé, c'est l'outil « Vue de détail » armé qui fait du glisser un geste de création : ailleurs, un doigt hors d'une poignée ne déplace rien (A13). « Valider le cadre » ouvre le dialogue de nommage (D8).`, 'width:1180px;margin-top:12px'))
}
</script>
<script>
/* ================================================================== 04 name and create */
{
const extra = (u) => `${VEIL(FET)}${OUTLINE(FET, u)}`
const radio = (label, on) => `<label style="display:flex;gap:8px;align-items:flex-start;font-size:13px;line-height:1.35;padding:3px 0"><span class="rad ${on ? 'on' : ''}"></span><span>${label}</span></label>`
const body04 = [
`<div class="geo">${ico('layers', 'sm')}<span>Vue parente : ${V_MAIN}</span></div>`,
fld('Nom (FR)', V_FET, { focus: true }),
fld('Nom (EN)', 'Fore fetlock'),
`<div class="field" role="radiogroup"><label>Accès sur « ${V_MAIN} »</label>${radio('Le cadre tracé (modifiable ensuite)', true)}${radio('Plus tard (la vue sera signalée dans « Vérification »)', false)}</div>`,
fld(`Catégorie de l'accès`, CHOOSE, { sel: true, req: true, attr: 'data-q1' }),
fld('Latéralité', CHOOSE, { sel: true, req: true }),
`<div class="notice info">${ico('info', 'sm')}<span>Les annotations sous l'accès restent sélectionnables : l'accès ne leur prend jamais le clic.</span></div>`,
].join('')
const foot = `${B('Abandonner', 'ghost')}${B('Ajuster le cadre', 'secondary')}${B('Créer la vue', 'primary')}`
const dialog = dlgBox({ title: 'Nouvelle vue de détail', body: body04, foot })
+ `<div class="annot" id="q1" style="position:absolute;right:372px;top:0;width:250px;z-index:10">Question Q1 : quelle catégorie pour un accès ? (voir README)</div>`
const names = [V_MAIN, V_HEAD]
const vl = [[V_MAIN, N_MAIN, false], [V_HEAD, N_HEAD, true]]
const bodyHtml = ws({ names, active: V_MAIN, vl, cur: V_MAIN, tool: 'view', faint: true, pressed: true, centre: true, vb: VB, extra, rowH: 730, dialog,
strip: strip({ act: true, lead: slead('view', 'Nouvelle vue de détail'), text: 'Cadre validé, en attente de ses propriétés.' }) })
const row = addBoard('04-nommer-creer', '04 · Nommer et créer', page({ body: bodyHtml, undoOff: true, dim: true }) + note(`Le dialogue « Nouvelle vue de détail » s'ouvre sur la colonne de droite, et le dessin garde le cadre sous le voile (D8). L'accès est par défaut le cadre tracé, remodelable ensuite ; « Plus tard » crée la vue sans accès et « Vérification » la signale (D9, D11). La catégorie de l'accès n'est pas préremplie et la latéralité n'a pas de valeur par défaut (D11). Les annotations sous l'accès restent sélectionnables : il ne leur prend jamais le clic (D10, question Q2).`, 'width:1180px;margin-top:12px'))
// The question callout sits level with the category field.
const q1 = row.querySelector('#q1'), fieldEl = row.querySelector('[data-q1]'), wrap = q1.parentElement
const inp = fieldEl.querySelector('.inp').getBoundingClientRect(), lineY = inp.top + inp.height / 2 - wrap.getBoundingClientRect().top
q1.style.top = (lineY - q1.offsetHeight / 2) + 'px'
wrap.insertAdjacentHTML('beforeend', `<div style="position:absolute;right:352px;top:${lineY}px;width:20px;border-top:1.5px dashed #c9a35a;z-index:10"></div>`)
}
</script>
<script>
/* ================================================================== 05 after creation */
{
const extra = (u) => `<polygon points="${pts(rect(FET))}" fill="${ART.c}" fill-opacity=".06"/>${polyEdit(rect(FET), u)}`
const names = [V_MAIN, V_HEAD, V_FET]
const vl = [[V_MAIN, N_MAIN + 1, false], [V_HEAD, N_HEAD, true], [V_FET, 0, true]]
const newAcc = { id: 'new-acc', kind: 'detail_trigger', cat: 'articulations', fr: V_FET, status: 'to_confirm' }
const body = ws({ names, active: V_MAIN, vl, cur: V_MAIN, vb: VB, extra, sel: 'new-acc', extraRows: [newAcc], rows: 2, rowH: 720,
msg: msg('Vue « Boulet antérieur » créée.'),
strip: strip({ lead: lead2('zone', `Accès « ${V_FET} »`, '', 'Accès · 4 sommets'),
actions: `${B('Ouvrir la vue', 'primary', { icon: 'layers' })}${B('Recadrer la vue', 'secondary', { icon: 'view' })}${B('Propriétés', 'secondary', { icon: 'file' })}${B('Supprimer', 'dangertxt', { icon: 'trash' })}` }) })
addBoard('05-apres-creation', '05 · Après la création', page({ body, unsaved: '4 modifications non enregistrées' }) + note(`Après « Créer la vue », on reste sur la parente : le nouvel accès est sélectionné, avec ses quatre sommets et un « + » au milieu de chaque côté, et sa puce rejoint la rangée (D12). Une seule entrée d'historique couvre la vue et son accès, donc un seul « Défaire » retire les deux (D12). La catégorie montrée, Articulations comme celle de l'accès de la tête, a été choisie par l'éditeur dans le dialogue, en attendant la réponse à la question Q1. « Ouvrir la vue » est le premier bouton du bandeau (D13).`, 'width:1180px;margin-top:12px'))
}
</script>
<script>
/* ================================================================== 06 several views on one view */
{
const m = mapOf([0, 0, W, H], CW, CH)
const pS = m(784, 907), pF = m(870, 1440)
const extra = (u) => `<circle cx="784" cy="907" r="${34 + 7 * u}" fill="none" stroke="#b85a3f" stroke-width="${2.5 * u}"/>${ARROW(784 + 2 * u, 907 + 2 * u, u)}${ARROW(870 + 2 * u, 1440 + 2 * u, u)}`
const over = leaders(CW, CH, [[196, 246, pS[0] + 6, pS[1]]])
+ callout(14, 214, 182, `Le point reste celui que l'on clique`)
+ `<div class="tip" style="left:${pF[0] + 22}px;top:${pF[1] + 6}px">${V_FET}</div>`
const names = [V_MAIN, V_HEAD, V_FET, V_SHO]
const vl = [[V_MAIN, N_MAIN + 2, false], [V_HEAD, N_HEAD, true], [V_FET, 0, true], [V_SHO, 0, true]]
const accRows = [V_FET, V_SHO].map((n) => ({ id: 'acc-' + n, kind: 'detail_trigger', cat: 'articulations', fr: n, status: 'to_confirm' }))
const body = ws({ names, active: V_MAIN, vl, cur: V_MAIN, acc: [rect(SHO), rect(FET)], extra, over, extraRows: accRows, rowH: 760,
strip: strip({ lead: slead('cursor', 'Sélectionner et déplacer'), text: 'Cliquez sur une annotation pour la sélectionner' }) })
addBoard('06-plusieurs-vues', '06 · Plusieurs vues sur une vue', page({ body }) + note(`Chaque accès est dessiné en pointillés, comme celui de la tête, et son nom s'affiche au survol et à la sélection ; les cadres peuvent se chevaucher (D15). Sur le point de l'épaule, couvert par l'accès « Épaule », le clic va au point : un accès ne prend jamais le clic ni le toucher d'une annotation (D10, question Q2). Sur un endroit vide de l'accès « Boulet antérieur », le pointeur le désigne et l'info-bulle donne son nom (D15). Les deux positions du pointeur sont montrées ensemble.`, 'width:1180px;margin-top:12px'))
}
</script>
<script>
/* ================================================================== 07 view opened, way back */
{
const names = [V_MAIN, V_HEAD, V_FET, V_SHO]
const vl = [[V_MAIN, N_MAIN + 2, false], [V_HEAD, N_HEAD, true], [V_FET, 0, true], [V_SHO, 0, true]]
const parentBtn = `<span style="position:relative;display:inline-flex">${B('Vue parente', 'secondary', { icon: 'arrow-up', title: V_MAIN })}${CURSOR(30, 22)}<span class="tip" style="top:42px;left:46px">${V_MAIN}</span></span>`
const over = callout(CW - 316, 18, 300, `La vue commence vide : les points de la parente restent sur la parente.`)
const body = ws({ names, active: V_FET, vl, cur: V_FET, vb: FET, noAnn: true, noList: true, over, rowH: 760,
strip: strip({ lead: slead('cursor', 'Sélectionner et déplacer'), text: 'Cliquez sur une annotation pour la sélectionner',
actions: `${parentBtn}${B('Recadrer la vue', 'secondary', { icon: 'view' })}` }) })
addBoard('07-vue-ouverte-retour', '07 · Vue ouverte, retour', page({ body }) + note(`Sur une vue de détail, la bande des vues reste la rangée du critère 32 : aucun bouton de plus, rien ne bouge. Au repos, le bandeau propose à droite « Vue parente » (l'info-bulle donne le nom de la parente) et « Recadrer la vue », et garde à gauche l'outil de sélection et son indication (D14, D16). On revient à la parente par ce bouton ou par sa puce dans la rangée. La vue commence vide : elle ne montre que ses propres annotations, les points de la parente restent sur la parente (D20, question Q3).`, 'width:1180px;margin-top:12px'))
}
</script>
<script>
/* ================================================================== 08 reframe a view */
{
const f = [60, 100, 422, 316.5] // the frame dragged by its bottom-right corner (4:3): the c0-c1 ghost (482, 332) is half outside
const ghosts = (u) => ANN.filter((a) => a.view === 'head').map((a) => `<circle cx="${a.g[1]}" cy="${a.g[2]}" r="${a.g[3]}" fill="#8c867e" fill-opacity=".32" stroke="#6b6359" stroke-width="${1.5 * u}" stroke-dasharray="${4 * u} ${3 * u}"/>`).join('')
const extra = (u) => `${ghosts(u)}${VEIL(f)}${OUTLINE(f, u)}${HANDLES(f, u)}${ARROW(f[0] + f[2] + 3 * u, f[1] + f[3] + 3 * u, u)}`
const names = [V_MAIN, V_HEAD]
const vl = [[V_MAIN, N_MAIN, false], [V_HEAD, N_HEAD, true]]
const check = `<span style="display:inline-flex;align-items:center;gap:6px;font-size:13px;white-space:nowrap;margin-right:4px"><span class="cb"></span>Déplacer l'accès avec le cadre</span>`
const below = `${msg('Non appliqué : une annotation de la vue sortirait du cadre.', { err: true, left: true })}`
const noteLine = `<div class="small muted" style="margin-top:8px;max-width:748px;line-height:1.4">Premier ajustement : 500 × 380 devient 500 × 375 (4:3) ; à « Appliquer », les 9 annotations repassent « à confirmer ».</div>`
const body = ws({ names, active: V_MAIN, vl, cur: V_MAIN, faint: true, extra, below, rowH: 660,
strip: strip({ lead: slead('view', 'Recadrer « Tête (vue latérale gauche) »'), text: 'Les 9 annotations de cette vue repasseront « à confirmer ».',
actions: `${check}${B('Abandonner', 'ghost')}${B('Appliquer', 'primary')}` }) })
const zoomExtra = (u) => `${ghosts(u)}${VEIL(f)}${OUTLINE(f, u)}${HANDLES(f, u)}${ARROW(f[0] + f[2] + 3 * u, f[1] + f[3] + 3 * u, u)}`
const zoom = vig('Même moment, agrandi sur la tête : les fantômes gris sont les 9 annotations de la vue', crop({ w: 700, vb: [20, 60, 560, 420], faint: true, extra: zoomExtra }), 728)
addBoard('08-recadrer-vue', '08 · Recadrer une vue', page({ body: body + noteLine, undoOff: true }) + `<div style="display:flex;gap:20px;margin-top:16px;align-items:flex-start;width:1180px">${zoom}${note(`Le dessin montre la parente entière, le cadre de « Tête » avec ses quatre coins, le voile hors du cadre et, en fantômes gris, les 9 annotations de la vue (D16). Le cadre a été glissé jusqu'à couper l'annotation « c0-c1 » en deux : le cœur juge à « Appliquer », refuse, et le refus s'écrit sous le dessin pendant que le cadre reste en place (D16). « Déplacer l'accès avec le cadre » est décochée, car l'accès de la tête est un polygone tracé à la main. Le premier ajustement d'un cadre qui n'est pas en 4:3 le met en 4:3 en gardant sa largeur et son centre (D5).`, 'width:432px')}</div>`)
}
</script>
<script>
/* ================================================================== 09 tablet */
{
const cs = corners(FET), tl = cs[0]
const extra = (u) => {
const inner = `${VEIL(FET)}<rect x="${FET[0]}" y="${FET[1]}" width="${FET[2]}" height="${FET[3]}" fill="none" stroke="#b85a3f" stroke-width="${u}" stroke-dasharray="${3 * u} ${2 * u}"/>${V(tl[0], tl[1], u / 2, false, true)}`
return `${VEIL(FET)}${OUTLINE(FET, u)}${cs.map((c) => HIT(c[0], c[1], u)).join('')}${HANDLES(FET, u, true)}${FINGER(tl[0], tl[1], u)}${LOUPE(tl[0], tl[1], u, inner, 'l09')}`
}
const names = [V_MAIN, V_HEAD]
const vl = [[V_MAIN, N_MAIN, false], [V_HEAD, N_HEAD, true]]
const body = ws({ names, active: V_MAIN, vl, cur: V_MAIN, tool: 'view', faint: true, pressed: true, big: true, vb: VB, extra, rowH: 0,
below: msg('Deux doigts pour déplacer ou zoomer le dessin.', { plain: true, big: true, left: true }),
strip: strip({ big: true, act: true, lead: slead('view', 'Nouvelle vue de détail'), text: 'Glissez un coin pour ajuster, faites glisser le cadre pour le déplacer.',
actions: `${B('Déplacer', 'secondary', { big: true, icon: 'move' })}${B('Retracer', 'secondary', { big: true, icon: 'pen' })}${B('Abandonner', 'ghost', { big: true })}${B('Valider le cadre', 'primary', { big: true, icon: 'check' })}` }) })
addBoard('09-tablette', '09 · À la tablette', page({ body, bezel: true, undoOff: true }) + note(`À la tablette, les poignées d'angle sont plus grosses et répondent dans un cercle de 22 px de rayon, tracé en pointillés (D6). Un doigt sur un coin le déplace, et la loupe au-dessus du doigt montre l'angle agrandi, comme pour les sommets (D4, D6). Le glisser de création n'existe que pour l'outil « Vue de détail » armé : deux doigts déplacent ou zooment le dessin et annulent un tracé commencé (D4).`, 'width:1180px;margin-top:12px'))
}
</script>
<script>
/* ================================================================== 10 keyboard */
{
const f = [675, 543, 724, 543] // default frame: a third of the visible width, 4:3, at the centre of the visible drawing
const br = [f[0] + f[2], f[1] + f[3]]
const m = mapOf([0, 0, W, H], CW, CH)
const pBR = m(br[0], br[1])
const extra = (u) => `${VEIL(f)}${OUTLINE(f, u)}${HANDLES(f, u)}<circle cx="${br[0]}" cy="${br[1]}" r="${13 * u}" fill="none" stroke="#fff" stroke-width="${5 * u}"/><circle cx="${br[0]}" cy="${br[1]}" r="${13 * u}" fill="none" stroke="#b85a3f" stroke-width="${2 * u}"/>`
const over = `<div class="tip" style="left:${pBR[0] + 14}px;top:${pBR[1] + 12}px">Coin bas droit</div>`
const names = [V_MAIN, V_HEAD]
const vl = [[V_MAIN, N_MAIN, false], [V_HEAD, N_HEAD, true]]
const body = ws({ names, active: V_MAIN, vl, cur: V_MAIN, tool: 'view', faint: true, pressed: true, centre: true, extra, over, rowH: 660,
strip: strip({ act: true, lead: slead('view', 'Nouvelle vue de détail'), text: 'Glissez un coin pour ajuster, faites glisser le cadre pour le déplacer.',
actions: `${B('Déplacer', 'secondary', { icon: 'move' })}${B('Retracer', 'secondary', { icon: 'pen' })}${B('Abandonner', 'ghost')}${B('Valider le cadre', 'primary', { icon: 'check' })}` }) })
const keys = `<div class="frame" style="width:560px;padding:12px 16px"><div style="font-weight:600;font-size:13px;margin-bottom:6px">Clavier</div>
<div class="krow"><span><kbd>Entrée</kbd> sur « Ajouter une vue de détail » : cadre au centre</span></div>
<div class="krow"><span><kbd>Tab</kbd> : le cadre, puis chaque coin</span></div>
<div class="krow"><span><kbd>Flèches</kbd> : déplacer (<kbd>Maj</kbd> × 10)</span></div>
<div class="krow"><span><kbd>Entrée</kbd> : Valider le cadre</span></div>
<div class="krow"><span><kbd>Échap</kbd> : Abandonner la création ?</span></div></div>`
addBoard('10-clavier', '10 · Au clavier', page({ body, undoOff: true }) + `<div style="display:flex;gap:20px;margin-top:16px;align-items:flex-start;width:1180px">${keys}<div style="display:flex;flex-direction:column;gap:12px;width:600px">${note(`Annonce : Cadre posé au centre, format 4:3.`)}${note(`Entrée sur « Ajouter une vue de détail » ou sur « Placer au centre » pose un cadre au centre, d'un tiers de la largeur visible, en 4:3 (D4). Tab atteint le cadre puis chaque coin, ici « Coin bas droit », et les flèches déplacent d'un pas ou de dix avec Maj (D6). Les boutons ont des noms, l'annonce polie dit que le cadre est posé, et aucun geste n'est obligatoire (D19). Échap pose d'abord la question avant d'abandonner (D18).`)}</div></div>`)
}
</script>
<script>
/* ================================================================== 11 manage the views */
{
const thumb = (f) => `<span class="vm-thumb">${drawing({ w: 94, h: 70, vb: f, noAnn: true })}</span>`
const mainThumb = `<span class="vm-thumb">${drawing({ w: 94, h: 70, noAnn: true })}</span>`
const disc = `<span class="disc"><span style="font-size:12px">▸</span>Valeurs précises</span>`
const acts = `<span class="vm-acts">${B('Recadrer sur le dessin', 'secondary', { icon: 'view' })}${disc}${B('Supprimer', 'dangertxt', { icon: 'trash' })}</span>`
const parent = `<span class="small muted">Vue parente : ${V_MAIN} · Utilise l'illustration de la vue parente.</span>`
const row = (name, f, extraHtml, a) => `<div class="vm-card">${thumb(f)}<div class="vm-main"><span class="vm-name">${name}<span class="badge">Vue de détail</span></span>${parent}${extraHtml || ''}</div>${a || acts}</div>`
const warn = `<div class="notice warn" style="align-items:center">${ico('alert', 'sm')}<span style="flex:1">Aucun accès sur « ${V_MAIN} »</span>${B(`Ajouter l'accès`, 'secondary', { icon: 'plus' })}</div>`
const mainRow = `<div class="vm-card">${mainThumb}<div class="vm-main"><span class="vm-name">${V_MAIN}<span class="badge">Vue principale</span></span><span class="small muted">Illustration valide</span></div><span class="vm-acts">${B('Choisir une illustration', 'secondary')}${B('Créer une vue de détail', 'secondary', { icon: 'view' })}</span></div>`
const top = `<div class="vm-card" style="background:var(--color-surface-strong);align-items:center"><span style="width:38px;height:38px;border-radius:10px;background:#fff;border:1px solid var(--color-border);display:grid;place-items:center;flex:none">${ico('view')}</span><div class="vm-main"><span class="vm-name">Nouvelle vue de détail</span></div><span class="vm-acts">${B('Tracer sur le dessin', 'primary', { icon: 'view' })}<a class="lnk s13" style="padding:0 6px">Vue avec sa propre illustration…</a></span></div>`
const body = `<div style="display:flex;flex-direction:column;gap:14px"><h2 class="sec" style="margin:0">Vues</h2>
<div><div class="vm-sec">Vue principale</div>${mainRow}</div>
<div style="display:flex;flex-direction:column;gap:10px"><div class="vm-sec" style="margin:0">Vues de détail</div>${top}${row(V_HEAD, HEADBOX)}${row(V_FET, FET)}${row(V_SHO, SHO, warn)}</div></div>`
addBoard('11-gerer-les-vues', '11 · Gérer les vues', page({ body, errs: '3 erreurs' }) + note(`« Gérer les vues » garde sa place, mais le parcours normal passe par « Tracer sur le dessin » : les quatre champs numériques sont repliés sous « Valeurs précises » (D17). Chaque vue de détail propose « Recadrer sur le dessin ». Une vue sans accès sur sa parente est signalée, et « Ajouter l'accès » y pose le rectangle du cadre (D11, D16). « Créer une vue de détail » se trouve sur la ligne de la vue principale (D2).`, 'width:1180px;margin-top:12px'))
}
</script>
<script>
/* ================================================================== 12 phone, read only */
{
const names = [V_MAIN, V_FET]
const vrows = [[V_MAIN, N_MAIN + 1, false], [V_FET, 0, true]].map(([n, c, d]) => `<div class="arow ${n === V_FET ? 'cur' : ''}" style="min-height:48px"><span style="flex:1;min-width:0"><span style="font-weight:500;display:block">${n}</span><span class="small muted">${d ? 'Vue de détail' : 'Vue principale'}</span></span><span class="small muted">${pl(c, 'annotation', 'annotations')}</span></div>`).join('')
const phone = `<div class="frame phone" style="width:391px;height:796px"><div class="ph-top">${ico('menu')}<b style="font-weight:600">Cheval, squelette et rachis</b><span class="ro">Lecture seule</span></div>
<div class="ph-tabs"><a>Général</a><a class="on">Annotations</a><a>Constats</a><a>Plus</a></div>
<div class="ph-body" style="padding:16px;gap:12px">${band(names, V_FET, 343)}<div class="canvas" style="flex:none;width:343px;height:257px;background:#fff">${drawing({ w: 343, h: 257, vb: FET, noAnn: true })}</div>
<div class="ocard"><div class="ot">Vues</div>${vrows}</div></div></div>`
addBoard('12-telephone-lecture-seule', '12 · Téléphone, lecture seule', `<div style="display:flex;gap:24px;align-items:flex-start">${phone}${note(`En lecture seule et sur téléphone, la bande des vues est la même ligne qu'en édition, sans bouton de retour : la puce de la vue parente, ici « ${V_MAIN} », ramène à la parente (D14). La fiche d'exemple n'a ici que deux vues, pour que la parente et la vue ouverte tiennent ensemble dans les 343 px de la ligne. Avec plus de vues, la ligne défile et la puce de la parente peut en sortir (critère 32).`, 'width:430px')}</div>`)
}
</script>
<script>
/* ================================================================== 13 bilan, nested view */
{
const incisives = drawing({ w: 640, h: 480, vb: [INCI[0], INCI[1], INCI[2], INCI[3] ], noAnn: true })
const dlg = `<div class="dlgu static" role="dialog" aria-modal="true" style="width:690px"><div class="dh" style="padding-left:14px"><span class="btn secondary sm">${ico('arrow-left', 'sm')}${V_HEAD}</span><h2>Incisives</h2><span class="dx" title="Fermer">${ico('close')}</span></div>
<div class="db"><div style="width:640px;height:480px;border:1px solid var(--color-border);border-radius:12px;overflow:hidden;background:#fff">${incisives}</div><p class="s13 muted" style="margin:0">Cliquez sur les zones pour les ajouter à l'observation en cours.</p></div></div>`
const page13 = `<div class="frame win11" style="height:820px"><div class="main"><div class="top" style="padding:0 16px">${ico('menu')}<span class="crumb">Outil de bilan › <b>Nouveau bilan</b></span>${ME}</div>
<div style="display:flex;gap:16px;padding:16px 24px;flex:1;min-height:0"><div class="card" style="flex:1;padding:14px;display:flex;align-items:center;justify-content:center">${drawing({ w: 640, h: 480, noAnn: false, faint: true })}</div>
<div style="width:340px;flex:none;display:flex;flex-direction:column;gap:10px"><div class="card" style="padding:14px;display:flex;flex-direction:column;gap:10px"><span class="s14" style="font-weight:600">Observations</span><span class="inp" style="background:var(--color-surface-strong)"></span><span class="inp" style="background:var(--color-surface-strong)"></span><span class="inp" style="background:var(--color-surface-strong)"></span></div></div></div></div>
<div class="dialog-wrap">${dlg}</div></div>`
addBoard('13-bilan-vue-imbriquee', '13 · Bilan, vue imbriquée', page13 + note(`Dans la fenêtre de détail du bilan, un bouton de retour apparaît quand la vue ouverte est elle-même la vue de détail d'une vue de détail : ici « Incisives », fille de « ${V_HEAD} ». Pour une vue directement fille de la vue principale, la fenêtre reste comme aujourd'hui, avec son seul bouton ✕ « Fermer » (D14). « Incisives » est une vue hypothétique, dessinée pour ce seul panneau.`, 'width:1180px;margin-top:12px'))
}
</script>
<script>
// Chip bands: the right fade and chevron appear where chips are cut (measured, as the built row does).
document.querySelectorAll('.vband').forEach((b) => { const r = b.querySelector('.vrow'); if (r.scrollWidth > r.clientWidth + 1) b.querySelector('.vhint').classList.add('show') })
</script>
<script>
// French typography: a non-breaking space inside « », and before : ; ? !
const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, { acceptNode: (n) => n.parentElement.closest('script,style') ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT })
const nodes = []; while (walker.nextNode()) nodes.push(walker.currentNode)
for (const n of nodes) n.nodeValue = n.nodeValue.replace(/« /g, '«\u00a0').replace(/ »/g, '\u00a0»').replace(/ ([:;?!])/g, '\u00a0$1')
</script>
</body>
</html>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 MiB