  /* Mise en page : terrain à gauche, réglages à droite ; une seule colonne sur mobile */
  :root {
    --bg: #eef1f4;
    --panel: #ffffff;
    --ink: #1a2330;
    --muted: #5c6877;
    --line: #d5dbe3;
    --accent: #d4501f;
    --accent-ink: #ffffff;
    --team: #1d3f8f;
    --def: #b3261e;
    --font-display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
    color-scheme: light;
  }
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #12161c; --panel: #1b212a; --ink: #e8ebf0; --muted: #98a3b3;
      --line: #2e3745; --accent: #ff7a45; --accent-ink: #1a1008; --team: #6aa3ff; --def: #ff8a80;
      color-scheme: dark;
    }
  }
  :root[data-theme="dark"] {
    --bg: #12161c; --panel: #1b212a; --ink: #e8ebf0; --muted: #98a3b3;
    --line: #2e3745; --accent: #ff7a45; --accent-ink: #1a1008; --team: #6aa3ff; --def: #ff8a80;
    color-scheme: dark;
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; }
  body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.4; }
  button, input, textarea, select { font: inherit; color: inherit; }
  :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

  .app { max-width: 1320px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  @media (max-width: 900px) { .app { grid-template-columns: minmax(0, 1fr); } }

  header { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; }
  h1 { font-family: var(--font-display); font-size: 34px; letter-spacing: .02em; text-transform: uppercase; margin: 0; line-height: 1; }
  #name { flex: 1 1 220px; min-width: 0; max-width: 420px; background: transparent; border: 0; border-bottom: 2px solid var(--line); padding: 4px 2px; font-size: 18px; font-weight: 600; }
  #name:focus { border-bottom-color: var(--accent); outline: none; }

  .stage { display: grid; gap: 12px; min-width: 0; }
  .toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .toolbar .sep { flex: 1 1 0; }
  .seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
  .seg button { background: var(--panel); border: 0; padding: 7px 14px; cursor: pointer; font-weight: 500; color: var(--ink); }
  .seg button + button { border-left: 1px solid var(--line); }
  .seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
  .seg button:disabled { opacity: .6; cursor: default; }
  #stage3d { position: relative; padding: 0; overflow: hidden; background: #10141b; }
  #stage3d[hidden] { display: none; }
  #gl { width: 100%; height: clamp(360px, 66vh, 760px); touch-action: none; cursor: grab; }
  #gl:active { cursor: grabbing; }
  #gl canvas { width: 100%; height: 100%; display: block; }
  .cam { position: absolute; left: 8px; top: 8px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 16px); }
  .cam .btn { padding: 4px 10px; font-size: 13px; background: rgba(27,33,42,.82); color: #e8ebf0; border-color: rgba(255,255,255,.18); }
  .cam .btn:hover { border-color: #fff; }
  .cam3note { position: absolute; right: 10px; bottom: 8px; font-size: 12px; color: rgba(232,235,240,.75); pointer-events: none; text-shadow: 0 1px 2px #000; }
  #glmsg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; color: #e8ebf0; font-size: 15px; pointer-events: none; }
  #glmsg:empty { display: none; }
  body.present #gl { height: calc(100vh - 230px); }
  .court-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
  #court { display: block; width: auto; max-width: 100%; margin: 0 auto; height: auto; max-height: 72vh; touch-action: none; user-select: none; -webkit-user-select: none; }
  #court.tool { cursor: crosshair; }
  #court.tool .p { pointer-events: none !important; }
  #court.viatool .p { pointer-events: auto !important; cursor: pointer; }
  #court .vh { cursor: grab; }
  .p { cursor: grab; }
  .p:active { cursor: grabbing; }
  #caption { min-height: 2.8em; padding: 8px 12px; border-left: 4px solid var(--accent); background: var(--panel); border-radius: 0 8px 8px 0; font-size: 16px; }
  #caption:empty::before { content: "Ajoute une légende à l'étape pour expliquer le mouvement."; color: var(--muted); }

  #legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0 4px; }
  #legend:empty { display: none; }
  .chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--team); }
  .chip.def { color: var(--def); }
  .dot { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px; font-family: var(--font-display); font-weight: 700; font-size: 14px; background: #2a6fdb; color: #fff; border: 2px solid transparent; }
  button.dot.tog { cursor: pointer; font-family: var(--font-display); padding: 0 4px; }
  .dot.tog.off { opacity: .35; text-decoration: line-through; filter: grayscale(.6); }
  .dot.def { background: #fff; color: #b3261e; border-color: #b3261e; }

  .transport { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
  .transport input[type=range] { flex: 1 1 200px; min-width: 120px; accent-color: var(--accent); }
  .btn { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-weight: 500; }
  .btn:hover { border-color: var(--muted); }
  .btn:disabled { opacity: .45; cursor: default; }
  .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; min-width: 108px; }
  .btn.small { padding: 4px 9px; font-size: 13px; }
  .check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
  .check input { accent-color: var(--accent); width: 16px; height: 16px; }
  select { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; max-width: 100%; }

  .timeline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .step { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); font-family: var(--font-display); font-size: 20px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
  .step[aria-current="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
  .step.add { border-style: dashed; color: var(--muted); font-size: 24px; }
  .tl-del { margin-left: 8px; color: var(--def); }
  .step { min-width: 40px; width: auto; padding: 0 8px; }
  .step.br { font-size: 17px; }
  .forkSw { display: inline-flex; border: 2px solid var(--accent); border-radius: 8px; overflow: hidden; }
  .forkSw .fk { border: 0; background: var(--panel); padding: 0 10px; height: 36px; font-family: var(--font-display); font-weight: 700; font-size: 16px; cursor: pointer; }
  .forkSw .fk + .fk { border-left: 1px solid var(--line); }
  .forkSw .fk[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
  #forkBar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 12px; border: 2px solid var(--accent); border-radius: 10px; background: var(--panel); }
  #forkBar[hidden] { display: none; }

  aside { display: grid; gap: 12px; min-width: 0; }
  @media (min-width: 901px) { aside { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; align-content: start; } }
  .box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
  .box > summary { list-style: none; cursor: pointer; padding: 11px 12px; display: flex; justify-content: space-between; align-items: center; }
  .box > summary::-webkit-details-marker { display: none; }
  .box > summary::after { content: "+"; color: var(--muted); font-weight: 700; }
  .box[open] > summary::after { content: "–"; }
  .box .inner { padding: 0 12px 12px; display: grid; gap: 10px; }
  .box h2 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .05em; font-size: 16px; margin: 0; color: var(--muted); }
  .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  .row .btn.grow { flex: 1 1 auto; }
  .lab { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
  textarea, #note, #annText, .txt { width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px; resize: vertical; }
  textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; min-height: 84px; }
  .hint { color: var(--muted); font-size: 13px; margin: 0; }
  #status { min-height: 1.2em; color: var(--muted); font-size: 13px; margin: 0; }
  kbd { font-family: inherit; border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; background: var(--bg); }

  .roster { display: grid; gap: 6px; }
  .rrow { display: grid; grid-template-columns: 22px 54px minmax(0, 1fr); gap: 6px; align-items: center; }
  .rrow input { width: 100%; min-width: 0; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; }
  .rrow input.num { text-align: center; font-weight: 600; }
  details details summary { cursor: pointer; font-weight: 500; color: var(--muted); }
  details details .roster { margin-top: 8px; }

  .swatches { display: flex; flex-wrap: wrap; gap: 8px; }
  .sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
  .sw[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }
  .sw.auto { background: linear-gradient(135deg, #6b2a00 50%, #f08a24 50%); }
  #plotOpts { display: grid; gap: 10px; }
  #plotOpts[hidden] { display: none; }
  .tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .tools button { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 7px 4px; cursor: pointer; font-size: 13px; }
  .tools button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }

  .lib { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 220px; overflow: auto; }
  .lib li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
  .lib .t { font-weight: 600; overflow-wrap: anywhere; }
  .lib .g { color: var(--muted); font-size: 12px; }

  #toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; max-width: 90vw; }
  #toast.on { opacity: .95; }

  #overlay { position: fixed; inset: 0; background: var(--bg); overflow: auto; z-index: 20; padding: 16px; }
  #overlay[hidden] { display: none; }
  #ovBar { display: flex; gap: 10px; align-items: center; max-width: 1100px; margin: 0 auto 12px; }
  #ovBody { max-width: 1100px; margin: 0 auto; display: grid; gap: 14px; }
  .sheetGrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .sheetGrid figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px; break-inside: avoid; }
  .sheetGrid svg { width: 100%; height: auto; display: block; max-height: none; }
  .sheetGrid figcaption { padding: 6px 4px 2px; font-size: 14px; }
  #ovBody video { width: 100%; max-height: 70vh; background: #000; border-radius: 8px; }

  /* Mode présentation : seulement le terrain, la lecture et les étapes */
  body.present header, body.present aside, body.present .toolbar { display: none; }
  body.present .app { grid-template-columns: minmax(0, 1fr); max-width: none; padding: 8px; }
  body.present #court { max-height: calc(100vh - 230px); }
  body.present #caption { font-size: 22px; }

  .acct { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--line); color: var(--muted); white-space: nowrap; }
  .acct.on { background: #dff3e4; color: #1d6b34; }
  body.viewer #acct { display: none; }

  /* Visionneuse : affichage seul, aucune édition */
  .viewOnly { display: none; }
  .viewOnly[hidden] { display: none !important; }
  body.viewer .viewOnly { display: inline-flex; }
  body.viewer aside, body.viewer .stepper, body.viewer .editOnly, body.viewer #startView, body.viewer .cam3note { display: none !important; }
  body.viewer .app { grid-template-columns: minmax(0, 1fr); max-width: 1180px; margin: 0 auto; }
  body.viewer #name { border-color: transparent; background: transparent; pointer-events: none; font-weight: 700; }
  body.viewer #court { pointer-events: none; }
  #viewFoot { display: none; text-align: center; color: var(--muted); font-size: 12px; padding: 6px 0 14px; }
  body.viewer #viewFoot { display: block; }

  /* Phases : début / placement / exportation */
  .stepper { display: flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
  .stepper button { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 14px 6px 8px; cursor: pointer; font-weight: 600; color: var(--muted); }
  .stepper .n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 13px; }
  .stepper button:disabled { opacity: .45; cursor: not-allowed; }
  .stepper button[aria-current="step"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .stepper button[aria-current="step"] .n { background: rgba(255,255,255,.28); color: var(--accent-ink); }
  body[data-phase="start"] .stage, body[data-phase="start"] aside { display: none; }
  body:not([data-phase="start"]) #startView { display: none; }
  body[data-phase="start"] #name, body[data-phase="start"] #modeBadge { display: none; }
  body[data-phase="edit"] #asideExport { display: none; }
  body[data-phase="export"] #asideEdit, body[data-phase="export"] .editOnly { display: none !important; }
  body[data-phase="export"] #court { pointer-events: none; }
  body.noDef #boxDef { display: none; }
  .modeBadge { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--line); color: var(--ink); }
  #startView { grid-column: 1 / -1; display: grid; gap: 20px; max-width: 980px; margin: 0 auto; width: 100%; }
  #startView h2 { font-family: var(--font-display); text-transform: uppercase; letter-spacing: .04em; font-size: 22px; margin: 0 0 4px; }
  .modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  @media (max-width: 760px) { .modes { grid-template-columns: minmax(0, 1fr); } }
  .modeCard { text-align: left; border: 2px solid var(--line); background: var(--panel); border-radius: 12px; padding: 14px; cursor: pointer; display: grid; gap: 6px; align-content: start; color: var(--ink); }
  .modeCard b { font-size: 17px; }
  .modeCard span { font-size: 14px; color: var(--muted); line-height: 1.35; }
  .modeCard[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232, 88, 42, .18); }
  .modeCard .ico { font-size: 26px; }
  .startPanel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 12px; }
  .startForm { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 14px; }
  @media (max-width: 560px) { .startForm { grid-template-columns: minmax(0, 1fr); } }
  .startForm label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
  .startForm input, .startForm select { width: 100%; height: 44px; box-sizing: border-box; padding: 0 12px; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-family: inherit; }
  .startForm input:focus, .startForm select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
  .startActions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; }
  .startActions .big { height: 44px; padding: 0 26px; font-size: 16px; }
  .startActions .btn[hidden] { display: none; }
  .startCols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
  @media (max-width: 760px) { .startCols { grid-template-columns: minmax(0, 1fr); } }
  .phaseNav { display: flex; justify-content: flex-end; }
  #startContinue { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
  body.present .stepper { display: none; }
  @media print {
    .app { display: none; }
    #overlay { position: static; padding: 0; background: #fff; }
    #ovBar { display: none; }
    .sheetGrid { grid-template-columns: repeat(2, 1fr); }
  }

  /* Barre sous le terrain (paysage) : outils à gauche, ☰ au centre, couleurs à droite */
  .fabs { display: none; }
  .fab { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); font-size: 17px; font-weight: 700; line-height: 1; cursor: pointer; padding: 0; flex: 0 0 auto; }
  .fabL { background: var(--accent); color: var(--accent-ink); }
  .fabR { background: var(--accent); }
  .fabR.auto { background: linear-gradient(135deg, #6b2a00 50%, #f08a24 50%); }
  .fabB { background: #222; color: #fff; }
  .fabS { background: #fff; color: var(--accent); border-color: var(--accent); }
  .fabP { background: #1f9d55; color: #fff; }
  .fabP:disabled { opacity: .4; }
  .fabU, .fabRd { position: absolute; top: 50%; margin-top: -20px; background: #fff; color: #333; border-color: #bbb; font-size: 20px; }
  .fabU { left: 8px; }
  .fabRd { left: 56px; }
  .fabU:disabled, .fabRd:disabled { opacity: .35; }
  .fabMenuS { left: 8px; grid-template-columns: repeat(5, auto); max-width: calc(100vw - 20px); }
  .fabMenuS .fabNote { grid-column: 1 / -1; min-height: 38px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; min-width: 260px; }
  .fabMenuS .fabHead { grid-column: 1 / -1; font-size: 13px; font-weight: 600; color: var(--muted); }
  .fabMenuS .fabWide { grid-column: span 2; }
  .fabItem.cur { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 700; }
  .fab[aria-expanded="true"] { outline: 3px solid var(--accent); outline-offset: 2px; }
  .fabMenu { position: absolute; bottom: 50px; display: grid; gap: 6px; background: rgba(255,255,255,.98); border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.3); max-height: calc(var(--lh) - 8px); overflow: auto; z-index: 26; }
  .fabMenu[hidden] { display: none; }
  .fabMenuL { left: 8px; grid-template-columns: repeat(3, auto); }
  .fabMenuR { right: 8px; grid-template-columns: repeat(3, auto); }
  .fabItem { padding: 8px 12px; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-size: 14px; cursor: pointer; white-space: nowrap; color: inherit; }
  .fabItem[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
  .fabMenuR .sw { width: 38px; height: 38px; }
  /* ---------- Mobile (≤ 900 px) : le terrain reste visible en haut, les annotations juste en dessous ---------- */
  @media (max-width: 900px) {
    body[data-phase="edit"] .app { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 8px; }
    body[data-phase="edit"] .app > *, body[data-phase="edit"] #asideEdit > details { min-width: 0; }
    body[data-phase="edit"] .stage, body[data-phase="edit"] #asideEdit { display: contents; }
    body[data-phase="edit"] #card2d, body[data-phase="edit"] #stage3d { order: 1; }
    body[data-phase="edit"] #card2d { position: sticky; top: 0; z-index: 20; padding: 4px; box-shadow: 0 4px 10px rgba(0,0,0,.12); }
    body[data-phase="edit"] #court { max-height: 40vh; }
    body[data-phase="edit"] .toolbar { order: 2; }
    body[data-phase="edit"] #caption { order: 4; }
    body[data-phase="edit"] #forkBar { order: 5; }
    body[data-phase="edit"] .transport { order: 6; }
    body[data-phase="edit"] .timeline { order: 7; }
    body[data-phase="edit"] #legend { order: 8; }
    body[data-phase="edit"] #asideEdit > details { order: 10; }
    body[data-phase="edit"] #asideEdit > #boxAnnot { order: 3; }
    body[data-phase="edit"] .phaseNav { order: 30; }
    body[data-phase="edit"] #viewFoot { order: 40; }
    body[data-phase="edit"] .tools { grid-template-columns: repeat(4, 1fr); }
    body[data-phase="edit"] .tools button { padding: 11px 2px; font-size: 13px; min-height: 42px; }
  }

  /* ---------- Téléphone en paysage : terrain fixe en haut, annotations juste en dessous ---------- */
  @media (orientation: landscape) and (max-height: 520px) {
    body.viewer { --lh: calc(100vh - 112px); --lh: calc(100dvh - 112px); }
    body.viewer .app { display: flex; flex-direction: column; align-items: stretch; gap: 2px; padding: 2px 4px; max-width: none; }
    body.viewer .app > * { min-width: 0; }
    body.viewer .app > header { display: none; }
    body.viewer .stage { display: contents; }
    body.viewer .toolbar { order: 0; margin: 0; }
    body.viewer #card2d, body.viewer #stage3d { order: 1; height: var(--lh); padding: 2px; box-sizing: border-box; box-shadow: none; }
    body.viewer #court { max-height: calc(var(--lh) - 4px); max-width: 100%; }
    body.viewer #gl { height: calc(var(--lh) - 4px); }
    body.viewer .transport { order: 2; }
    body.viewer #caption { order: 3; }
    body.viewer #forkBar { order: 4; }
    body.viewer .timeline { order: 5; }
    body.viewer #legend { order: 6; }
    body.viewer #viewFoot { order: 7; }
    body[data-phase="edit"] { --lh: calc(100vh - 50px); --lh: calc(100dvh - 50px); }
    body[data-phase="edit"] .app { display: flex; flex-direction: column; align-items: stretch; gap: 0; padding: 2px 4px; max-width: none; }
    body[data-phase="edit"] .app > *, body[data-phase="edit"] #asideEdit > details { min-width: 0; }
    body[data-phase="edit"] .app > header { gap: 4px 10px; flex-wrap: nowrap; align-items: center; }
    body[data-phase="edit"] header h1 { display: none; }
    body[data-phase="edit"] header #name { flex: 1 1 auto; min-width: 0; font-size: 15px; padding: 2px 4px; }
    body[data-phase="edit"] header #modeBadge, body[data-phase="edit"] header #acct { display: none; }
    body[data-phase="edit"] .stepper button { padding: 4px 10px; font-size: 13px; }
    body[data-phase="edit"] .stage, body[data-phase="edit"] #asideEdit { display: contents; }
    body[data-phase="edit"] #card2d, body[data-phase="edit"] #stage3d { order: 1; position: sticky; top: 0; z-index: 20; height: var(--lh); padding: 2px; box-sizing: border-box; box-shadow: none; }
    body[data-phase="edit"] #court { max-height: calc(var(--lh) - 4px); max-width: 100%; }
    body[data-phase="edit"] #gl { height: calc(var(--lh) - 4px); }
    body[data-phase="edit"] .fabs { display: flex; justify-content: center; gap: 22px; align-items: center; order: 2; position: sticky; top: var(--lh); z-index: 25; height: 46px; padding: 0 10px; box-sizing: border-box; background: var(--bg); }
    body[data-phase="edit"] #asideEdit > #boxAnnot { display: none; }
    body[data-phase="edit"]:not(.menuOpen) :is(.toolbar, #caption, #forkBar, .transport, .timeline, #legend, #asideEdit > details, .phaseNav, #viewFoot) { display: none; }
    body[data-phase="edit"].menuOpen :is(#card2d, #stage3d, .fabL, .fabR, .fabS, .fabP, .fabU, .fabRd, .fabMenu) { display: none; }
    body[data-phase="edit"].menuOpen .fabs { order: 99; top: auto; bottom: 0; justify-content: center; border-top: 1px solid var(--line); box-shadow: 0 -4px 10px rgba(0,0,0,.12); }
    body[data-phase="edit"].menuOpen .fabB { width: auto; padding: 0 22px; border-radius: 22px; font-size: 15px; font-weight: 600; }
    body[data-phase="edit"] .transport > #play, body[data-phase="edit"] .transport > #scrub { display: none; }
    body[data-phase="edit"]:not(.menuOpen) .app > header { display: none; }
    body[data-phase="edit"] .toolbar { order: 3; }
    body[data-phase="edit"] #caption { order: 4; }
    body[data-phase="edit"] #forkBar { order: 5; }
    body[data-phase="edit"] .transport { order: 6; }
    body[data-phase="edit"] .timeline { order: 7; }
    body[data-phase="edit"] #legend { order: 8; }
    body[data-phase="edit"] #asideEdit > details { order: 10; }
    body[data-phase="edit"] .phaseNav { order: 30; }
    body[data-phase="edit"] #viewFoot { order: 40; }
  }
