/* Afana — page « Description utilisation objet » (Accueil > Description).
   Schéma à couloirs : emprunteur en haut, statut au milieu, propriétaire en bas.
   Couleurs issues des variables de palette ; aucun style en ligne (politique de sécurité). */

#object-flow-view {
  --flow-surface: var(--surface); --flow-ink: var(--ink); --flow-muted: var(--muted);
  --flow-line: var(--pro-border, var(--line)); --flow-soft: var(--soft); --flow-accent: var(--accent);
  --st-pending: var(--pro-pending, #D99A1E); --st-accepted: color-mix(in srgb, var(--primary) 70%, var(--ink));
  --st-inuse: #3F8F6A; --st-return: var(--pro-return, #D9772B); --st-done: #8A94A0; --st-bad: var(--pro-danger, #B42318);
  max-width: 1240px; margin: 0 auto; padding: 8px 0 40px; color: var(--flow-ink);
}
:root[data-appearance="dark"] #object-flow-view { --st-inuse: #5FB58C; --st-done: #7C8896; }
#object-flow-view .flow-back {
  display: inline-flex; align-items: center; gap: 6px; margin: 24px 0 0; padding: 6px 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 14px; font-weight: 600; color: var(--flow-muted);
}
#object-flow-view .flow-back:hover { color: var(--flow-ink); }
#object-flow-view .flow-back svg { width: 16px; height: 16px; }
#object-flow-view .flow-top { padding: 16px 0 18px; }
#object-flow-view .flow-kicker { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 13px; font-weight: 700; color: var(--flow-muted); }
#object-flow-view .flow-kicker::before { content: ""; width: 22px; height: 2px; background: var(--flow-accent); }
#object-flow-view h1 { margin: 0; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; text-wrap: balance; }
#object-flow-view .flow-lead { margin: 14px 0 0; max-width: 68ch; font-size: 17px; color: var(--flow-muted); }
#object-flow-view .flow-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 26px 0 14px; }
#object-flow-view .flow-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--flow-muted); }
#object-flow-view .flow-legend span { display: inline-flex; align-items: center; gap: 8px; }
#object-flow-view .flow-sw { width: 14px; height: 14px; border-radius: 4px; }
#object-flow-view .flow-sw.act { background: var(--flow-surface); border: 2px solid var(--flow-accent); }
#object-flow-view .flow-sw.wait { border: 2px dashed var(--flow-muted); }
#object-flow-view .flow-seg { display: inline-flex; gap: 4px; padding: 4px; background: var(--flow-soft); border-radius: 12px; }
#object-flow-view .flow-seg button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--flow-muted); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
#object-flow-view .flow-seg button[aria-pressed="true"] { background: var(--flow-surface); color: var(--flow-ink); box-shadow: 0 1px 2px rgb(16 24 40 / .12); }
#object-flow-view :is(.flow-seg button, .flow-phase, .flow-card summary, .flow-back):focus-visible { outline: 2px solid var(--flow-accent); outline-offset: 2px; }

/* Schéma */
#object-flow-view .flow-lanes {
  display: grid; grid-template-columns: 132px repeat(6, minmax(0, 1fr)); gap: 10px; padding: 18px;
  background: var(--flow-surface); border: 1px solid var(--flow-line); border-radius: 18px; box-shadow: var(--pro-shadow, none);
}
#object-flow-view .flow-phase { display: flex; flex-direction: column; gap: 2px; padding: 6px 8px 10px; border: 0; border-radius: 10px; background: none; text-align: left; color: var(--flow-ink); font: inherit; cursor: pointer; }
#object-flow-view .flow-phase:hover { background: var(--flow-soft); }
#object-flow-view .flow-phase b { font-size: 13px; font-weight: 700; color: var(--flow-muted); }
#object-flow-view .flow-phase span { font-size: 16px; font-weight: 700; }
#object-flow-view .flow-lab { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 6px; font-size: 15px; font-weight: 700; }
#object-flow-view .flow-lab small { font-size: 12px; font-weight: 500; color: var(--flow-muted); }
#object-flow-view .flow-lane { display: contents; }
#object-flow-view .flow-card { position: relative; display: flex; flex-direction: column; padding: 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; background: var(--flow-surface); border: 1.5px solid var(--flow-accent); transition: opacity .2s; }
#object-flow-view .flow-card.wait { background: transparent; border: 1.5px dashed var(--flow-line); color: var(--flow-muted); }
#object-flow-view .flow-card summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; list-style: none; cursor: pointer; border-radius: 6px; }
#object-flow-view .flow-card summary::-webkit-details-marker { display: none; }
#object-flow-view .flow-card strong { font-size: 15px; line-height: 1.3; }
#object-flow-view .flow-card p { margin: 6px 0 0; color: var(--flow-muted); }
#object-flow-view .flow-chev { flex: none; width: 22px; height: 22px; margin: -1px -4px 0 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; opacity: .75; transition: transform .2s; }
#object-flow-view .flow-chev svg { width: 14px; height: 14px; }
#object-flow-view .flow-card summary:hover .flow-chev { opacity: 1; background: color-mix(in srgb, currentColor 12%, transparent); }
#object-flow-view .flow-card[open] .flow-chev { transform: rotate(90deg); }
#object-flow-view .flow-rail { position: relative; display: flex; align-items: center; justify-content: center; min-height: 54px; }
#object-flow-view .flow-rail::before { content: ""; position: absolute; left: -10px; right: -10px; top: 50%; height: 2px; background: var(--flow-line); }
#object-flow-view .flow-rail.first::before { left: 50%; }
#object-flow-view .flow-rail.last::before { right: 50%; }
#object-flow-view .flow-rail.arrow::after { content: ""; position: absolute; right: -12px; top: 50%; width: 8px; height: 8px; border-top: 2px solid var(--flow-line); border-right: 2px solid var(--flow-line); transform: translateY(-50%) rotate(45deg); }
#object-flow-view .flow-chip { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 999px; background: var(--flow-surface); border: 1.5px solid var(--c); font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--flow-ink); }
#object-flow-view .flow-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
#object-flow-view .st-pending { --c: var(--st-pending); } #object-flow-view .st-accepted { --c: var(--st-accepted); }
#object-flow-view .st-inuse { --c: var(--st-inuse); } #object-flow-view .st-ret { --c: var(--st-return); }
#object-flow-view .st-done, #object-flow-view .st-cancel { --c: var(--st-done); } #object-flow-view .st-refused { --c: var(--st-bad); }
#object-flow-view .flow-bell { position: absolute; right: 2px; display: inline-flex; align-items: center; gap: 4px; padding: 0 4px; font-size: 11px; font-weight: 600; color: var(--flow-muted); background: var(--flow-surface); }
#object-flow-view .flow-bell svg { width: 12px; height: 12px; }
#object-flow-view .flow-bell.to-b { top: -2px; } #object-flow-view .flow-bell.to-o { bottom: -2px; }
#object-flow-view.dim-o .lane-o .flow-card, #object-flow-view.dim-b .lane-b .flow-card { opacity: .22; }
#object-flow-view.dim-o .lab-o, #object-flow-view.dim-b .lab-b { opacity: .4; }

/* Étapes en détail */
#object-flow-view .flow-band { padding: 44px 0 8px; }
#object-flow-view h2 { margin: 0 0 16px; font-size: 28px; letter-spacing: -.02em; line-height: 1.15; }
#object-flow-view .flow-sub { margin: -10px 0 20px; color: var(--flow-muted); max-width: 70ch; }
#object-flow-view .flow-steps { display: flex; flex-direction: column; gap: 14px; }
#object-flow-view .flow-step { display: grid; grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1fr) minmax(0, .9fr); background: var(--flow-surface); border: 1px solid var(--flow-line); border-radius: 16px; overflow: hidden; scroll-margin-top: 140px; transition: box-shadow .2s; }
#object-flow-view .flow-step.flash { box-shadow: 0 0 0 3px var(--flow-accent); }
#object-flow-view .flow-step > div { padding: 16px 18px; }
#object-flow-view .flow-step > div + div { border-left: 1px solid var(--flow-line); }
#object-flow-view .flow-step .name { background: var(--flow-soft); }
#object-flow-view .flow-step .name b { display: block; font-size: 13px; color: var(--flow-muted); }
#object-flow-view .flow-step .name span { font-size: 19px; font-weight: 800; }
#object-flow-view .flow-step h3 { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--flow-muted); }
#object-flow-view .flow-step ul { margin: 0; padding-left: 18px; font-size: 15px; }
#object-flow-view .flow-step li + li { margin-top: 4px; }
#object-flow-view .flow-step .site { font-size: 14px; color: var(--flow-muted); }
#object-flow-view .flow-step .site .flow-chip { margin: 2px 0 8px; }
#object-flow-view.dim-o .flow-step .who-o, #object-flow-view.dim-b .flow-step .who-b { opacity: .3; }

/* Détours et repères */
#object-flow-view .flow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
#object-flow-view .flow-box { background: var(--flow-surface); border: 1px solid var(--flow-line); border-radius: 14px; padding: 16px 18px; }
#object-flow-view .flow-box strong { display: block; margin: 8px 0 4px; font-size: 16px; }
#object-flow-view .flow-box p { margin: 0; font-size: 15px; color: var(--flow-muted); }
#object-flow-view .flow-box p.when { display: flex; gap: 8px; margin: 2px 0 8px; padding: 8px 10px; border-radius: 10px; background: var(--flow-soft); color: var(--flow-ink); font-size: 14px; line-height: 1.45; }
#object-flow-view .flow-box p.when svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--flow-accent); }
#object-flow-view .flow-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding-bottom: 12px; }
#object-flow-view .flow-facts div { border-left: 3px solid var(--flow-accent); padding: 6px 14px; }
#object-flow-view .flow-facts b { display: block; }
#object-flow-view .flow-facts span { color: var(--flow-muted); font-size: 15px; }

@media (max-width: 980px) {
  #object-flow-view .flow-lanes { grid-template-columns: minmax(0, 1fr); padding: 12px; gap: 0; }
  #object-flow-view .flow-lanes > .flow-corner, #object-flow-view .flow-lanes > .flow-lab { display: none; }
  #object-flow-view .flow-phase { margin-top: 14px; padding: 10px 6px 6px; border-top: 1px solid var(--flow-line); border-radius: 0; }
  #object-flow-view .flow-phase.p1 { margin-top: 0; border-top: 0; }
  #object-flow-view .flow-rail { justify-content: flex-start; min-height: 44px; padding-left: 6px; }
  #object-flow-view .flow-rail::before, #object-flow-view .flow-rail::after { display: none; }
  #object-flow-view .flow-card { margin: 4px 0; }
  #object-flow-view .lane-b .flow-card summary strong::before, #object-flow-view .lane-o .flow-card summary strong::before { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 700; color: var(--flow-muted); }
  #object-flow-view .lane-b .flow-card summary strong::before { content: "Emprunteur"; }
  #object-flow-view .lane-o .flow-card summary strong::before { content: "Propriétaire"; }
  #object-flow-view .flow-step { grid-template-columns: minmax(0, 1fr); }
  #object-flow-view .flow-step > div + div { border-left: 0; border-top: 1px solid var(--flow-line); }
}
@media (prefers-reduced-motion: reduce) {
  #object-flow-view :is(.flow-card, .flow-step, .flow-chev) { transition: none; }
}

/* Lien depuis la case Publication de la Description */
#description-original .desc-steps .desc-step-link {
  margin-top: 8px; align-self: flex-start; font-size: 14px; font-weight: 700; color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--accent);
}
#description-original .desc-steps .desc-step-link:hover { text-decoration-color: var(--ink); }
