  /* Police Bangers embarquée localement (100% hors-ligne) */
  @font-face {
    font-family: 'Bangers';
    font-style: normal; font-weight: 400; font-display: swap;
    src: url('../fonts/bangers-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
  }
  @font-face {
    font-family: 'Bangers';
    font-style: normal; font-weight: 400; font-display: swap;
    src: url('../fonts/bangers-latinext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
  }
  :root {
    /* Thème repris du prototype bulles */
    --ink: #000000;
    --paper: #fffcf3;
    --paper-2: #fdfdfc;
	--white : #ffffff;
	--black : #000000;
	--yellow : #ffc107;
    --red: #E8272C;
    --blue: #2C6BFF;
    --teal: #1D9E75;
    --pink: #D4537E;
    --cyan: #1D9E75;   /* mappé sur teal pour compat des anciens usages */
    --font-display: 'Bangers', cursive;
    --font-body: 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
    --panel-border: 4px solid var(--ink);
    --radius: 8px;
    --shadow: 4px 4px 0 var(--ink);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  html, body {
    height: 100%;
    overflow: hidden;          /* pas de scrollbar de page */
  }
  body {
    background: var(--paper);
    background-image:
      radial-gradient(circle, #d9cba0 1.4px, transparent 1.4px);
    background-size: 16px 16px;
    font-family: var(--font-body);
    color: var(--ink);
    display: flex;
    flex-direction: column;    /* header (auto) + .app (remplit le reste) */
  }

  /* HEADER */
  header {
    background: var(--black);
    color: var(--ink);
    padding: 8px 16px 8px 0px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /*border-bottom: 4px solid var(--ink);*/
	border: 4px solid var(--ink);
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .logo {
    font-family: var(--font-display);
    font-size: 2.8rem;
    letter-spacing: 3px;
    color: var(--yellow);
    text-shadow: 3px 3px 0 var(--red);
    user-select: none;
  }

  .logo span { color: var(--red); }
  .logo-burst { display: inline-block; line-height: 0; }
  .logo-burst svg {
    width: 1.2em; height: 1.2em; display: inline-block;
    vertical-align: -0.22em; margin-right: 0.0em;
  }

  .header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
  }

  /* BUTTONS */
  .btn {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 8px 16px;
    border: 3px solid var(--ink);
    border-radius: var(--radius);
    cursor: pointer;
    transition: transform 0.08s, box-shadow 0.08s;
    box-shadow: var(--shadow);
    background: var(--yellow);
    color: var(--ink);
  }

  .btn:hover { transform: translate(-1px, -1px); box-shadow: 6px 6px 0 var(--ink); }
  .btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
  .btn.red { background: var(--red); color: #fff; }
  .btn.blue { background: var(--blue); color: #fff; }
  .btn.green { background: var(--teal); color: #fff; }
  .btn.sm { font-size: 0.82rem; padding: 6px 12px; border-radius: 6px; box-shadow: 2px 2px 0 var(--ink); }
  .btn.sm:hover { box-shadow: 4px 4px 0 var(--ink); }

  /* LAYOUT */
  .app {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    flex: 1;
    min-height: 0;             /* remplit exactement la place sous l'en-tête */
    overflow: hidden;
  }

  /* SIDEBAR */
  .sidebar {
    background: var(--paper-2);
    color: var(--ink);
    padding: 16px 14px;
    border-right: 4px solid var(--ink);
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
  }

  .sidebar-section h3 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: 2px;
    color: var(--ink);
    margin-bottom: 10px;
    border-bottom: 2px solid var(--ink);
    padding-bottom: 4px;
  }

  /* CHARACTER GALLERY */
  .char-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0px;
  }

  .char-option {
    background: var(--paper);
    border: 3px solid transparent;
    border-radius: 4px;
    padding: 6px;
    cursor: grab;
    transition: border-color 0.15s, transform 0.1s;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.65rem;
    color: var(--ink);
    font-weight: 700;
    text-align: center;
  }

  .char-option:hover { border-color: var(--yellow); transform: scale(1.05); }
  .char-option .emoji { font-size: 2rem; display: block; margin-bottom: 2px; }

  /* CUSTOM CHARACTER CREATOR */
  .add-char-box {
    background: var(--paper-2);
    border: 2px dashed var(--ink);
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
  }

  .add-char-box input[type="text"] {
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 3px;
    padding: 5px 8px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    width: 100%;
    color: var(--ink);
    outline: none;
  }

  .add-char-box input[type="text"]:focus { border-color: var(--yellow); }

  .emoji-preview {
    font-size: 2.2rem;
    text-align: center;
    min-height: 40px;
    line-height: 1;
  }

  .char-option.custom {
    position: relative;
  }

  .char-option.custom .del-char {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.6rem;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 5;
  }

  .char-option.custom:hover .del-char { display: flex; }

  /* IMAGE CHAR */
  .char-option .img-thumb {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    margin-bottom: 2px;
    border: 2px solid var(--ink);
  }

  .panel-img-char {
    display: block;
    width: 100px;
    height: auto;              /* la hauteur suit le ratio de l'image → sélection non carrée */
  }

  .upload-label {
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 3px;
    padding: 5px 8px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    text-align: center;
    transition: background 0.15s;
    display: block;
  }

  .upload-label:hover { background: var(--yellow); }

  /* EMOJI PICKER INLINE */
  .emoji-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 2px;
  }

  .emoji-tab {
    background: var(--paper-2);
    border: 2px solid var(--ink);
    border-radius: 3px;
    color: var(--ink);
    font-size: 0.7rem;
    padding: 2px 6px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
  }

  .emoji-tab.active { background: var(--yellow); color: var(--ink); }

  .emoji-picker-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 3px;
    max-height: 100px;
    overflow-y: auto;
    background: var(--paper-2);
    border: 2px solid var(--ink);
    border-radius: 4px;
    padding: 4px;
  }

  .emoji-picker-grid::-webkit-scrollbar { width: 4px; }
  .emoji-picker-grid::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 2px; }

  .ep-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    border-radius: 3px;
    padding: 2px;
    transition: background 0.1s;
    line-height: 1;
  }

  .ep-btn:hover { background: rgba(0,0,0,0.10); }

  .add-char-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--ink);
    margin-bottom: 8px;
  }

  .add-char-tab {
    flex: 1;
    background: var(--paper-2);
    border: none;
    color: #6b6247;
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 1px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.15s;
  }

  .add-char-tab.active { background: var(--yellow); color: var(--ink); border : 2px solid var(--ink) }
  .add-char-tab:first-child { border-radius: 3px 0 0 0; }
  .add-char-tab:last-child { border-radius: 0 3px 0 0; }

  /* BUBBLE STYLES */
  .bubble-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .bubble-opt {
    background: var(--paper);
    border: 3px solid transparent;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--ink);
    font-weight: 700;
    transition: border-color 0.15s;
  }

  .bubble-opt:hover, .bubble-opt.active { border-color: var(--yellow); background: var(--yellow); }

  /* EFFECTS */
  .effect-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .effect-opt {
    background: var(--paper);
    border: 3px solid transparent;
    border-radius: 4px;
    padding: 6px;
    cursor: grab;
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-align: center;
    color: var(--ink);
    transition: all 0.15s;
  }

  .effect-opt:hover { border-color: var(--yellow); }
  .pow { color: var(--red); }
  .wham { color: var(--blue); }
  .bam { color: #b800b8; }
  .zap { color: #e87c00; }

  /* COLORS */
  .color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid var(--ink);
    cursor: pointer;
    transition: transform 0.1s;
  }

  .color-swatch:hover { transform: scale(1.2); }
  .color-swatch.active { outline: 3px solid var(--yellow); outline-offset: 2px; }

  /* LAYOUT PICKER */
  .layout-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
  }

  .layout-bar span {
    font-family: var(--font-display);
    font-size: 1.1rem;
    letter-spacing: 1px;
  }

  .layout-opt {
    border: 3px solid var(--ink);
    background: white;
    cursor: pointer;
    padding: 6px;
    display: flex;
    gap: 2px;
    box-shadow: 3px 3px 0 var(--ink);
    transition: all 0.1s;
  }

  .layout-opt:hover, .layout-opt.active { background: var(--yellow); transform: translate(-1px,-1px); box-shadow: 5px 5px 0 var(--ink); }

  .layout-opt .mini-panel {
    background: var(--ink);
    border-radius: 1px;
  }

  /* COMIC STRIP */
  .main {
    padding: 0px;
    display: flex;
    flex-direction: column;
    gap: 0px;
    overflow: hidden;          /* le zoom/pan gère le déplacement, pas de scrollbar */
  }

  .strip-title-bar {
    background: var(--black);
    color: var(--ink);
    padding: 6px 14px;
    font-family: var(--font-display);
    font-size: 1.3rem;
    letter-spacing: 2px;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  #strip-title-input {
    background: transparent;
    border: none;
    border-bottom: 2px dashed var(--white);
    color: var(--white);
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 2px;
    width: 100%;
    outline: none;
  }

  .panel-node {
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 0;
  }

  .panel-node.split-h { flex-direction: row; }
  .panel-node.split-v { flex-direction: column; }

  /* SPLITTER (resize bar between children) */
  .panel-splitter {
    background: var(--gutter-color, #16130E);
    flex-shrink: 0;
    cursor: col-resize;
    z-index: 5;
    transition: background 0.15s;
  }

  .panel-splitter.h { width: var(--gutter-size, 4px); cursor: col-resize; }
  .panel-splitter.v { height: var(--gutter-size, 4px); cursor: row-resize; }
  .panel-splitter:hover, .panel-splitter.dragging { filter: brightness(1.5); }

  /* INDIVIDUAL PANEL */
  .panel {
    flex: 1;
    position: relative;
    min-width: 60px;
    min-height: 80px;
    background: white;
    overflow: hidden;
    cursor: crosshair;
    border-radius: var(--panel-radius, 0px);
  }

  /* Strip outer border also uses gutter color */
  .strip-container {
    background: var(--ink);
    border: 4px solid var(--gutter-color, --ink);
    box-shadow: 8px 8px 0 var(--ink);
    overflow: hidden;
    /* Proportions A4 (210 × 297 mm) : à 96 DPI = 794 × 1123 px.
       Exporté à 300 DPI (scale ≈ 3,12) → 2480 × 3508 px = vrai A4 300 DPI. */
    width: 794px;
    height: 1123px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-radius: var(--panel-radius, 0px);
  }

  #panels-root {
    display: flex;
    flex: 1;
    min-height: 0;
    border-top: 4px solid var(--gutter-color, #16130E);
    background: var(--gutter-color, #16130E); /* fills corners between panels */
    gap: 0;
  }

  /* INDIVIDUAL PANEL */
  .panel {
    flex: 1;
    position: relative;
    min-width: 60px;
    min-height: 80px;
    background: white;
    overflow: hidden;
    cursor: crosshair;
  }

  .panel.active-panel { outline: 4px solid var(--black); outline-offset: -4px; }

  /* PANEL BG */
  .panel-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    pointer-events: none;
    border-radius: inherit;
  }

  /* PANEL CONTROLS (split/delete buttons) */
  .panel-controls {
    position: absolute;
    bottom: 6px;
    right: 6px;
    display: flex;
    gap: 3px;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
    /* contre-scale du zoom → taille des boutons de case constante à l'écran */
    transform: scale(var(--inv-zoom, 1));
    transform-origin: bottom right;
  }

  .panel:hover .panel-controls,
  .panel.active-panel .panel-controls {
    opacity: 1;
    pointer-events: all;
  }

  .panel-ctrl {
    background: var(--ink);
    color: var(--yellow);
    border: none;
    border-radius: 3px;
    padding: 3px 7px;
    font-size: 0.75rem;
    font-family: var(--font-display);
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.4);
    transition: background 0.1s;
  }

  .panel-ctrl:hover { background: var(--blue); color: white; }
  .panel-ctrl.danger:hover { background: var(--red); color: white; }

  /* DRAGGABLE ITEMS IN PANEL */
  .panel-item {
    position: absolute;
    cursor: move;
    user-select: none;
    filter: drop-shadow(2px 2px 0 rgba(0,0,0,0.3));
    z-index: 10;
  }

  .panel-item.selected {
    outline: 2px dashed var(--blue);
    outline-offset: 3px;
  }

  /* GLOBAL OVERLAY (outside panels, in body) */
  #goverlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
  }

  #gov-toolbar {
    display: none;
    position: absolute;
    gap: 3px;
    white-space: nowrap;
    background: var(--ink);
    border-radius: 4px;
    padding: 3px 5px;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.6);
    pointer-events: all;
    transform: translateX(-50%);
  }

  #gov-handle {
    display: none;
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--blue);
    border: 2px solid white;
    border-radius: 50%;
    cursor: se-resize;
    pointer-events: all;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: white;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.5);
    transform: translate(-50%, -50%);
  }

  #gov-rotate {
    display: none;
    position: absolute;
    width: 18px;
    height: 18px;
    background: #b800b8;
    border: 2px solid white;
    border-radius: 50%;
    cursor: grab;
    pointer-events: all;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: white;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.5);
    transform: translate(-50%, -50%);
    user-select: none;
  }

  #gov-rotate:active { cursor: grabbing; }

  #gov-badge {
    display: none;
    position: absolute;
    background: var(--yellow);
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.6rem;
    font-weight: 900;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    transform: translate(-50%, -50%);
    pointer-events: none;
  }

  #gov-delete {
    display: none;
    position: absolute;
    width: 18px;
    height: 18px;
    background: var(--red);
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    pointer-events: all;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    color: white;
    box-shadow: 1px 1px 4px rgba(0,0,0,0.5);
    transform: translate(-50%, -50%);
    user-select: none;
  }

  #gov-delete:hover { background: #a00; }

  .item-ctrl-btn {
    background: transparent;
    color: var(--yellow);
    border: none;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.7rem;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
    transition: background 0.1s;
  }

  .item-ctrl-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
  .item-ctrl-btn.danger:hover { background: var(--red); }

  /* CHARACTER EMOJI IN PANEL */
  .panel-char {
    font-size: 4rem;
    line-height: 1;
    display: block;
    text-align: center;
  }

  .panel-char.flip { transform: scaleX(-1); }

  /* SPEECH BUBBLES */
  .speech-bubble {
    position: relative;
    background: var(--bubble-bg, white);
    border: 3px solid var(--ink);
    border-radius: 18px;
    padding: 8px 12px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 13px;
    min-width: 60px;
    text-align: center;
    line-height: 1.3;
    word-wrap: break-word;
  }

  .speech-bubble.thought {
    border-radius: 40px;
    border-style: dashed;
  }

  .speech-bubble.shout {
    background: var(--bubble-bg, var(--yellow));
    border-radius: 10px;
    /*clip-path: polygon(5% 0%, 95% 0%, 100% 5%, 100% 95%, 95% 100%, 5% 100%, 0% 95%, 0% 5%);*/
  }

  /* La pointe de bulle est désormais un objet indépendant (déplaçable / orientable) */
  .bubble-tail {
    display: block;
    overflow: visible;
    width: 40px;
    height: 40px;
  }

  .bubble-text {
    outline: none;
    min-width: 40px;
    display: block;
  }

  /* EFFECT TEXT */
  .effect-text {
    font-family: var(--font-display);
    font-size: 2.5rem;
    letter-spacing: 2px;
    text-shadow: 3px 3px 0 var(--ink);
    -webkit-text-stroke: 2px var(--ink);
    line-height: 1;
    outline: none;
    min-width: 30px;
    display: inline-block;
    white-space: nowrap;
    cursor: move;
    user-select: none;
  }
  .effect-text[contenteditable="true"] {
    cursor: text;
    user-select: text;
    outline: 2px dashed rgba(255,255,255,0.75);
    border-radius: 3px;
  }

  /* PANEL BG PICKER */
  .bg-picker {
    position: absolute;
    bottom: 6px;
    right: 6px;
    z-index: 30;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
  }

  .panel:hover .bg-picker { opacity: 1; }

  .bg-opt {
    width: 22px;
    height: 22px;
    border: 2px solid var(--ink);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.1s;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .bg-opt:hover { transform: scale(1.2); }

  /* PANEL SHADE OVERLAYS */
  /*.panel[data-bg="day"] .panel-bg { background: linear-gradient(to bottom, #87ceeb 0%, #e0f0ff 60%, #90c97a 60%, #5a8c3a 100%) !important; }*/
  .panel[data-bg="plain"] .panel-bg { background: white !important; }
  .panel[data-bg="drama"] .panel-bg { background: repeating-linear-gradient(45deg, #FFC72C 0, #FFC72C 10px, #ff6b00 10px, #ff6b00 20px) !important; }

  /* BOTTOM BAR */
  .bottom-bar {
    background: var(--paper);
    color: var(--ink);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 1px;
    border-top: 4px solid var(--ink);
  }

  .bottom-bar span { color: #6b6247; font-size: 0.8rem; font-family: var(--font-body); font-weight: 700; }

  /* MODAL */
  .modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 200;
    align-items: center;
    justify-content: center;
  }

  .modal-overlay.open { display: flex; }

  .modal {
    background: var(--paper);
    border: var(--panel-border);
    box-shadow: 10px 10px 0 var(--ink);
    padding: 28px 32px;
    max-width: 500px;
    width: 90%;
    animation: popIn 0.2s cubic-bezier(.175,.885,.32,1.275);
  }

  @keyframes popIn {
    from { transform: scale(0.5) rotate(-5deg); opacity: 0; }
    to { transform: scale(1) rotate(0deg); opacity: 1; }
  }

  .modal h2 {
    font-family: var(--font-display);
    font-size: 2rem;
    letter-spacing: 2px;
    margin-bottom: 16px;
    color: var(--red);
    text-shadow: 2px 2px 0 var(--ink);
  }

  .modal p { margin-bottom: 12px; line-height: 1.5; }

  /* EXPORT PREVIEW */
  #export-area {
    background: white;
    border: var(--panel-border);
    margin-top: 12px;
    padding: 10px;
    font-size: 0.8rem;
  }

  /* TOOLTIP */
  .tip {
    font-size: 0.72rem;
    color: #6b6247;
    font-style: italic;
    margin-top: 4px;
  }

  /* SCROLLBAR */
  .sidebar::-webkit-scrollbar { width: 6px; }
  .sidebar::-webkit-scrollbar-track { background: var(--paper-2); }
  .sidebar::-webkit-scrollbar-thumb { background: var(--ink); border-radius: 3px; }

  /* COLLAPSIBLE SECTIONS — cartes claires façon prototype */
  .sidebar-section {
    background: var(--paper);
    border: 3px solid var(--ink);
    border-radius: var(--radius);
    padding: 4px 12px 6px;
    box-shadow: var(--shadow);
  }

  .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 6px 0;
    user-select: none;
  }

  .section-header h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    letter-spacing: 2px;
    color: var(--ink);
    margin: 0;
    border: none;
    padding: 0;
  }

  .section-chevron {
    color: var(--ink);
    font-size: 0.75rem;
    transition: transform 0.2s;
    line-height: 1;
  }

  .sidebar-section.collapsed .section-chevron { transform: rotate(-90deg); }
  .sidebar-section.collapsed .section-body { display: none; }

  .section-body { padding-bottom: 10px; }

  /* CUSTOM COLOR ROW */
  .custom-color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
  }

  #panel-custom-color, #bubble-custom-color {
    width: 36px;
    height: 28px;
    border: 2px solid var(--ink);
    border-radius: 3px;
    padding: 0;
    cursor: pointer;
    background: none;
  }

  /* MARGIN CONTROLS */
  .margin-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
  }

  .margin-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--ink);
    width: 64px;
    flex-shrink: 0;
  }

  .margin-range {
    flex: 1;
    accent-color: var(--yellow);
    height: 4px;
    cursor: pointer;
  }

  .margin-val {
    font-size: 0.7rem;
    color: #aaa;
    width: 36px;
    text-align: right;
    flex-shrink: 0;
    font-family: monospace;
  }

  .margin-color-input {
    width: 32px;
    height: 24px;
    border: 2px solid var(--ink);
    border-radius: 3px;
    padding: 0;
    cursor: pointer;
    background: none;
    flex-shrink: 0;
  }

	/* Zoom utilisateur sur strip-container */
	#strip-container {
	  transform-origin: 0 0;     /* le JS gère translate + scale */
	}
	/* will-change n'est actif que PENDANT le geste : fluide en mouvement,
	   puis re-rasterisation nette à l'arrêt (texte / SVG / bords non flous). */
	#strip-container.zooming { will-change: transform; }

	/* Zone de travail : clippe le contenu, sert de repère pour le pan/zoom */
	.strip-zoom-wrapper {
	  position: relative;
	  flex: 1;
	  min-height: 0;
	  overflow: hidden;
	  cursor: grab;
	}
	.strip-zoom-wrapper.panning { cursor: grabbing; }

  /* STARBURST */
  @keyframes starburst { from{transform:scale(0) rotate(-20deg); opacity:0;} to{transform:scale(1) rotate(0deg); opacity:1;} }
  .new-item { animation: starburst 0.25s cubic-bezier(.175,.885,.32,1.275); }

  /* ── BULLES v2 (objet SVG + poignées, thème prototype) ── */
  .bubble-svg { display:block; overflow:visible; }
  .bubble-svg .bubble-text { outline:none; }
  .bubble-item.selected { outline:none !important; }   /* la sélection est montrée par les poignées */
  .panel-item:not(.selected) .b-guides,
  .panel-item:not(.selected) .b-handles { display:none; }
  .b-handles .bh { cursor:grab; }
  .b-handles .bh:active { cursor:grabbing; }

  /* Barre de réglages façon prototype */
  .bub-controls { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-top:4px; }
  .cbtn {
    font-family:var(--font-display); letter-spacing:.5px; font-size:.9rem;
    padding:6px 12px; border:3px solid var(--ink); background:var(--yellow); color:var(--ink);
    border-radius:6px; cursor:pointer; box-shadow:2px 2px 0 var(--ink);
    transition:transform .08s, box-shadow .08s; user-select:none; line-height:1.1;
  }
  .cbtn:hover { transform:translate(-1px,-1px); box-shadow:3px 3px 0 var(--ink); }
  .cbtn:active { transform:translate(2px,2px); box-shadow:0 0 0 var(--ink); }
  .cbtn.ghost { background:var(--paper); }
  .cbtn.on { background:var(--red); color:#fff; }
  .cbtn.wide { width:100%; text-align:center; font-size:1.05rem; }
  .bub-color { width:40px; height:30px; border:3px solid var(--ink); border-radius:5px; padding:0; background:none; cursor:pointer; }
  .bub-sep { flex-basis:100%; height:0; }

  /* ── ICÔNES SVG (sprite inline, héritent la couleur du texte) ── */
  .ico {
    width: 1.05em; height: 1.05em; display: inline-block; vertical-align: -0.16em;
    margin-right: 0.4em; flex-shrink: 0;
    fill: none; stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
  }
  h3 .ico { vertical-align: -0.13em; }
  .item-ctrl-btn .ico, #gov-handle .ico, #gov-rotate .ico, #gov-delete .ico {
    margin-right: 0; width: 1em; height: 1em; vertical-align: -0.12em;
  }
  .section-chevron .ico { margin-right: 0; width: 1.1em; height: 1.1em; vertical-align: -0.18em; }

/* ===== Impression ===== */
@media print {
  header, .sidebar, .layout-bar, .bottom-bar, .modal-overlay { display: none !important; }
  .app { display: block; }
  .main { padding: 0; }
  .item-controls { display: none !important; }
}