:root {
  --bg: #0F0F0F;
  --bg2: #1A1A1A;
  --card: #242424;
  --border: #333;
  --text: #F5F0E8;
  --accent: #D4A853;
  --accent-hover: #E8BC6A;
  --on-accent: #0a0a0a;
  --wall: #4A4A44;
  --muted: #888;
  --danger: #C0392B;
  --success: #27AE60;
  --seat-size: 32px;
  --header-h: 52px;
  --mobile-nav-h: 56px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0; padding: 0;
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh; height: 100dvh;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* ── SCREENS ── */
.screen { display: none; }
.screen.active { display: flex; }

/* ── CONFIG SCREEN ── */
#config-screen {
  width: 100%; height: 100vh; height: 100dvh;
  align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #1a1a1a 0%, #0a0a0a 100%);
  padding: 20px;
}
.config-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px 32px;
  width: 480px;
  max-width: 95vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.config-card h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 900;
  text-align: center;
  margin: 0 0 6px 0;
  color: var(--accent);
  letter-spacing: -1px;
}
.config-home { display: inline-flex; align-items: center; gap: 6px; font-size: .62rem; color: var(--muted); text-decoration: none; margin-bottom: 18px; }
.config-home:hover { color: var(--accent); }
.config-demo { margin: -10px 0 20px; font-size: .62rem; color: var(--muted); }
.config-demo a { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }
.config-card .subtitle {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 28px;
}
.config-field { margin-bottom: 18px; }
.config-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.config-field input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 1rem;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}
.config-field input:focus { border-color: var(--accent); }
.config-row {
  display: flex;
  gap: 14px;
}
.config-row .config-field { flex: 1; }
.btn-accent {
  width: 100%;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.5px;
  margin-top: 6px;
}
.btn-accent:hover { background: var(--accent-hover); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(212,168,83,0.25); }
.btn-accent:active { transform: translateY(0); }
.btn-resume {
  width: 100%; margin-top: 10px; background: transparent;
  border: 1px dashed var(--border); color: var(--muted);
  border-radius: 12px; padding: 12px; font-size: 0.9rem; cursor: pointer;
  font-family: 'DM Sans', sans-serif; display: none; align-items: center;
  justify-content: center; gap: 8px; transition: all 0.2s;
}
.btn-resume:hover { border-color: var(--accent); color: var(--accent); }

/* ── MAIN EDITOR ── */
#editor-screen { height: 100vh; height: 100dvh; flex-direction: column; }
#editor-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; background: var(--bg2); border-bottom: 1px solid var(--border);
  flex-shrink: 0; z-index: 10; min-height: var(--header-h); height: auto; gap: 8px;
}
#editor-header .logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem; font-weight: 700; color: var(--accent);
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
#editor-header .logo i { font-size: 1rem; }
#editor-header .event-name {
  font-family: 'Playfair Display', serif;
  font-size: 1rem; font-weight: 600; text-align: center;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0;
}
.header-buttons { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.header-btn {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 12px; color: var(--text); cursor: pointer;
  font-size: 0.8rem; font-family: 'DM Sans', sans-serif; font-weight: 500;
  transition: all 0.2s; display: flex; align-items: center; gap: 5px; white-space: nowrap;
}
.header-btn:hover { border-color: var(--accent); color: var(--accent); }
.header-btn.accent { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.header-btn.accent:hover { background: var(--accent-hover); }

#editor-body { display: flex; flex: 1; overflow: hidden; position: relative; }

/* ── LEFT PANEL ── */
#left-panel {
  width: 310px; min-width: 310px; background: var(--bg2);
  border-right: 1px solid var(--border); display: flex; flex-direction: column;
  flex-shrink: 0; transition: transform 0.3s ease; z-index: 30;
}
.panel-header {
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.panel-header h2 {
  font-family: 'Playfair Display', serif; font-size: 1.05rem; font-weight: 700; margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.panel-header h2 .count {
  font-family: 'DM Sans', sans-serif; font-size: 0.7rem; background: var(--accent);
  color: var(--on-accent); border-radius: 100px; padding: 2px 10px; font-weight: 700;
}
.btn-close-panel {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 1.1rem; padding: 4px 8px; display: none;
}
.participant-form { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.participant-form .row { display: flex; gap: 6px; margin-bottom: 8px; }
.participant-form input {
  flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 12px; color: var(--text); font-size: 0.85rem; font-family: 'DM Sans', sans-serif;
  outline: none; min-width: 0;
}
.participant-form input:focus { border-color: var(--accent); }
.participant-form input::placeholder { color: #555; }
.btn-icon {
  background: var(--accent); border: none; border-radius: 8px; color: var(--on-accent);
  cursor: pointer; width: 40px; min-width: 40px; display: flex; align-items: center;
  justify-content: center; font-size: 0.9rem; transition: all 0.2s;
}
.btn-icon:hover { background: var(--accent-hover); }
.btn-import {
  width: 100%; background: transparent; border: 1px dashed var(--border); border-radius: 8px;
  padding: 6px; color: var(--muted); font-size: 0.75rem; cursor: pointer;
  font-family: 'DM Sans', sans-serif; transition: all 0.2s; text-align: center;
}
.btn-import:hover { border-color: var(--accent); color: var(--accent); }

.participant-list { flex: 1; overflow-y: auto; padding: 8px 12px; }
.participant-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: 10px; margin-bottom: 4px;
  transition: all 0.15s; background: transparent; border: 1px solid transparent;
  gap: 8px;
}
.participant-item:hover { background: var(--card); border-color: var(--border); }
.participant-item .name {
  font-size: 0.85rem; font-weight: 500; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0;
}
.participant-item .seat-badge {
  font-size: 0.68rem; padding: 2px 8px; border-radius: 100px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.seat-badge.unassigned { background: rgba(200,50,50,0.15); color: #E74C3C; }
.seat-badge.assigned { background: rgba(39,174,96,0.15); color: #27AE60; }
.participant-item .del-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.8rem; padding: 4px 6px; opacity: 0.5; transition: all 0.2s; flex-shrink: 0;
  min-width: 28px; min-height: 28px; display: flex; align-items: center; justify-content: center;
}
.participant-item .del-btn:hover { opacity: 1; color: var(--danger); }
.participant-item.pending { background: rgba(212,168,83,0.15); border-color: var(--accent); }
.participant-item.pending .name { color: var(--accent); }

.import-textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); font-size: 0.8rem; font-family: 'DM Sans', sans-serif;
  padding: 8px 12px; resize: vertical; min-height: 60px; outline: none; display: none;
  margin-top: 6px;
}
.import-textarea:focus { border-color: var(--accent); }

/* ── CENTER: ROOM (canevas métrique) ── */
#room-container {
  flex: 1; position: relative; overflow: hidden;
  background-color: #0b0b0b;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,0.045) 1px, transparent 0);
  background-size: 22px 22px;
  cursor: default;
  touch-action: none;
}
#room-container.panning { cursor: grabbing; }
#room-container.panning #stage { cursor: grabbing; }
#stage {
  position: absolute; left: 0; top: 0;
  background: #111;
  border: 1px solid #2e2e2e;
  box-shadow: 0 30px 70px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.02);
  transform-origin: 0 0;
  cursor: default;
}
#room-grid {
  position: absolute; inset: 0; pointer-events: none; display: none;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 24px, rgba(255,255,255,0.045) 24px 25px),
    repeating-linear-gradient(90deg, transparent 0 24px, rgba(255,255,255,0.045) 24px 25px),
    repeating-linear-gradient(0deg, transparent 0 99px, rgba(255,255,255,0.09) 99px 100px),
    repeating-linear-gradient(90deg, transparent 0 99px, rgba(255,255,255,0.09) 99px 100px);
}
#room-grid.on { display: block; }
.room-hint {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  color: #3a3a3a; font-size: 2rem; pointer-events: none;
  font-family: 'Playfair Display', serif; font-style: italic; letter-spacing: 1px;
  white-space: nowrap;
}
.snap-guide { position: absolute; background: rgba(212,168,83,0.8); display: none; pointer-events: none; z-index: 4; }
.snap-guide.v { width: 1px; top: 0; bottom: 0; }
.snap-guide.h { height: 1px; left: 0; right: 0; }

/* règles */
.ruler {
  position: absolute; background: #151515; color: #8a8a8a; z-index: 25;
  pointer-events: none; overflow: hidden; font-family: 'DM Sans', sans-serif;
}
#rulerH { left: 0; top: 0; right: 0; height: 20px; border-bottom: 1px solid #2c2c2c; }
#rulerV { left: 0; top: 0; bottom: 0; width: 20px; border-right: 1px solid #2c2c2c; }
.ruler .tick { position: absolute; background: #3d3d3d; }
.ruler .tick.maj { background: #5a5a5a; }
.ruler .lbl { position: absolute; font-size: 9px; color: #8f8f8f; line-height: 1; }
#rulerH .lbl { top: 3px; }
#rulerV .lbl { left: 3px; transform: rotate(-90deg); transform-origin: left top; }

/* barre de vue */
#viewbar {
  position: absolute; right: 14px; bottom: 14px; z-index: 30;
  display: flex; align-items: center; gap: 2px;
  background: rgba(20,20,20,0.94); border: 1px solid #333; border-radius: 9px;
  padding: 3px; box-shadow: 0 8px 24px rgba(0,0,0,0.45);
}
#viewbar button {
  height: 26px; min-width: 26px; padding: 0 7px; border-radius: 6px;
  color: #b9b3a6; font-size: 11px; border: none; background: none; cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}
#viewbar button:hover { background: #262626; color: #fff; }
#viewbar .zlabel {
  min-width: 46px; text-align: center; font-size: 11px; color: #d6d0c4;
  font-variant-numeric: tabular-nums;
}
#viewbar .sep { width: 1px; height: 16px; background: #333; margin: 0 3px; }
#viewbar button.tg.on { background: rgba(212,168,83,0.16); color: var(--accent); }
#viewbar #roomSizeBtn { color: #8f8f8f; font-size: 10.5px; }
#room-container.exporting .ruler,
#room-container.exporting #viewbar,
#room-container.exporting .snap-guide { display: none !important; }

/* ── TABLE ── */
.table-group {
  position: absolute; cursor: grab; z-index: 1; transition: filter 0.2s;
}
.table-group:active { cursor: grabbing; z-index: 10; }
.table-group.selected { z-index: 5; }
.table-group.dragging { z-index: 20; filter: drop-shadow(0 8px 24px rgba(212,168,83,0.4)); }

.table-visual {
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #3a3a3a, #1e1e1e);
  border: 2px solid #444;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-size: 1.1rem; font-weight: 700;
  color: var(--accent); position: relative; margin: 0 auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: border-color 0.3s, box-shadow 0.3s;
  cursor: pointer;
}
.table-visual.rect {
  border-radius: 10px;
  background: linear-gradient(135deg, #3a3a3a, #1e1e1e);
  font-size: 0.9rem;
}
.table-group:hover .table-visual { border-color: var(--accent); box-shadow: 0 0 20px rgba(212,168,83,0.15); }
.table-group.selected .table-visual {
  border-color: var(--accent);
  box-shadow: 0 0 28px rgba(212,168,83,0.3), 0 0 0 4px rgba(212,168,83,0.1);
}

/* ── SEATS ── */
.seat {
  position: absolute;
  width: var(--seat-size); height: var(--seat-size);
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px dashed var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.6rem; font-weight: 700; color: var(--muted);
  cursor: pointer; transition: all 0.2s;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.seat:hover { border-color: var(--accent); color: var(--accent); background: #1a1a1a; }
.seat.occupied {
  border-style: solid; border-color: var(--accent);
  background: linear-gradient(135deg, #2a2418, #1a1a1a);
  color: var(--accent); font-size: 0.55rem;
}
.seat.empty-highlight { border-color: var(--success); background: rgba(39,174,96,0.1); }

/* ── RIGHT PANEL ── */
#right-panel {
  width: 300px; min-width: 300px; background: var(--bg2);
  border-left: 1px solid var(--border); display: flex; flex-direction: column;
  flex-shrink: 0; transition: transform 0.3s ease; z-index: 30;
}
#right-panel.empty {
  display: flex; align-items: center; justify-content: center; color: var(--muted);
  font-size: 0.9rem; text-align: center; padding: 24px;
}
#right-panel.empty .empty-state i { font-size: 2.5rem; margin-bottom: 10px; display: block; opacity: 0.3; }
.table-detail { display: flex; flex-direction: column; height: 100%; }
.table-detail .panel-header { border-bottom: 1px solid var(--border); }
.seats-list { flex: 1; overflow-y: auto; padding: 6px 12px; }
.seat-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 10px; margin-bottom: 3px; background: transparent; transition: all 0.15s;
}
.seat-row:hover { background: var(--card); }
.seat-row .seat-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--bg);
  border: 1px solid var(--border); display: flex; align-items: center;
  justify-content: center; font-size: 0.7rem; font-weight: 700; color: var(--muted);
  flex-shrink: 0;
}
.seat-row select {
  flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 10px; color: var(--text); font-size: 0.8rem; font-family: 'DM Sans', sans-serif;
  outline: none; cursor: pointer; min-width: 0; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px;
}
.seat-row select:focus { border-color: var(--accent); }
.seat-row .clear-seat {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.8rem; padding: 6px 4px; opacity: 0.4; transition: all 0.2s; flex-shrink: 0;
  min-width: 26px; min-height: 30px; display: flex; align-items: center; justify-content: center;
}
.seat-row .clear-seat:hover { opacity: 1; color: var(--danger); }

.panel-footer { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.panel-footer button {
  flex: 1; padding: 8px; border-radius: 8px; font-size: 0.78rem; font-family: 'DM Sans', sans-serif;
  font-weight: 600; cursor: pointer; transition: all 0.2s; border: none;
}
.btn-clear { background: transparent; border: 1px solid var(--border) !important; color: var(--muted); }
.btn-clear:hover { border-color: var(--danger) !important; color: var(--danger); }

/* ── MODAL ── */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.overlay.active { display: flex; }
.modal {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 24px; width: 420px; max-width: 95vw; box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  text-align: center;
}
.modal h3 { font-family: 'Playfair Display', serif; font-size: 1.2rem; margin: 0 0 10px 0; }
.modal .preview { background: var(--bg); border-radius: 12px; padding: 16px; margin: 12px 0; }
.modal .preview img { max-width: 100%; border-radius: 8px; }
.modal-buttons { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.modal-buttons button { min-width: 120px; }

/* ─── Recherche, stats, groupes, placement ─── */
.search-box { padding: 10px 14px 4px 14px; }
.search-box input {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 0.85rem; outline: none;
}
.search-box input:focus { border-color: var(--accent); }
.stats-bar {
  display: flex; gap: 10px; flex-wrap: wrap; padding: 8px 14px 10px 14px;
  font-size: 0.7rem; color: var(--muted); border-bottom: 1px solid var(--border);
}
.stats-bar b { color: var(--accent); font-weight: 700; }
.stats-bar .stats-warn { color: #E74C3C; }
.stats-bar .stats-warn b { color: #E74C3C; }
.stats-bar .stats-ok { color: #27AE60; }
.stats-bar .stats-ok b { color: #27AE60; }
.group-badge {
  font-size: 0.6rem; padding: 1px 6px; border-radius: 10px; margin-left: 5px;
  background: rgba(212,168,83,0.15); color: var(--accent); white-space: nowrap;
  display: inline-block; max-width: 90px; overflow: hidden; text-overflow: ellipsis;
  vertical-align: middle; flex-shrink: 1;
}
.group-badge.affinity { color: #8B6A2E; }
.group-badge.sep { background: rgba(231,76,60,0.12); color: #E74C3C; }
.participant-item .grp-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.78rem; padding: 4px 6px; opacity: 0.55; transition: all 0.2s;
  flex-shrink: 0; min-width: 28px; min-height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.participant-item .grp-btn:hover, .participant-item .grp-btn.on { opacity: 1; color: var(--accent); }
.modal.wide { max-width: 620px; width: 92%; max-height: 86vh; overflow-y: auto; }
.modal select, .modal input[type=text] {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 0.85rem; outline: none;
}
.modal input[type=text]:focus { border-color: var(--accent); }
.modal label.field-label {
  display: block; font-size: 0.7rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.6px; margin: 14px 0 6px 0;
}
.modal .hint { font-size: 0.7rem; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.avoid-list { max-height: 190px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; }
.avoid-list label {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  font-size: 0.82rem; cursor: pointer; border-bottom: 1px solid var(--border);
}
.avoid-list label:last-child { border-bottom: none; }
.avoid-list label:hover { background: var(--card); }
.avoid-list input { accent-color: var(--accent); }
.placement-table { margin-bottom: 14px; }
.placement-table h4 {
  font-family: 'DM Sans', sans-serif; font-size: 0.82rem; color: var(--accent);
  margin: 0 0 6px 0; border-bottom: 1px solid var(--border); padding-bottom: 4px;
}
.placement-table .p-guests { display: flex; flex-wrap: wrap; gap: 5px; }
.placement-table .p-guest {
  font-size: 0.75rem; padding: 3px 9px; background: var(--card);
  border-radius: 12px; border: 1px solid var(--border);
}
.placement-table .p-guest .p-num { color: var(--muted); font-size: 0.65rem; margin-right: 3px; }
.placement-table .p-empty { font-size: 0.72rem; color: var(--muted); font-style: italic; }
.unplaced-block h4 { color: #E74C3C; border-color: rgba(231,76,60,0.35); }
.warning-line { font-size: 0.75rem; color: #E74C3C; margin: 3px 0; line-height: 1.35; }

/* ── STICKER ── */
.sticker { display: none; position: fixed; pointer-events: none; z-index: 999;
  background: var(--accent); color: var(--on-accent); padding: 6px 14px;
  border-radius: 100px; font-size: 0.8rem; font-weight: 700;
  font-family: 'DM Sans', sans-serif; box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 80px; right: 16px; background: var(--accent); color: var(--on-accent);
  padding: 10px 18px; border-radius: 10px; font-weight: 700; font-size: 0.85rem;
  z-index: 200; opacity: 0; transform: translateY(10px); transition: all 0.3s;
  pointer-events: none; font-family: 'DM Sans', sans-serif;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── RESIZE HANDLES ── */
.resize-handle {
  position: absolute; width: 18px; height: 18px;
  background: var(--accent); border: 2px solid var(--bg);
  border-radius: 3px; z-index: 25; cursor: nwse-resize;
  transform: translate(-50%, -50%); display: none;
  box-shadow: 0 0 8px rgba(212,168,83,0.6);
  pointer-events: auto;
}
.resize-handle::after {
  content: ''; position: absolute; inset: -8px;
}
.table-group.selected.resize-mode .resize-handle { display: block; }
.resize-handle.tl { cursor: nwse-resize; }
.resize-handle.tr { cursor: nesw-resize; }
.resize-handle.bl { cursor: nesw-resize; }
.resize-handle.br { cursor: nwse-resize; }
.resize-handle.t { cursor: ns-resize; }
.resize-handle.r { cursor: ew-resize; }
.resize-handle.b { cursor: ns-resize; }
.resize-handle.l { cursor: ew-resize; }

/* ── ROTATION HANDLE ── */
.rotate-handle {
  position: absolute; width: 14px; height: 14px;
  background: var(--accent); border: 2px solid var(--bg);
  border-radius: 50%; z-index: 25; cursor: grab;
  transform: translate(-50%, -50%); display: none;
  box-shadow: 0 0 6px rgba(212,168,83,0.5);
  pointer-events: auto;
}
.rotate-handle::after {
  content: ''; position: absolute; inset: -6px;
}
.table-group.selected.resize-mode .rotate-handle { display: block; }

/* ══════════════════════════════════════════ */
/* 📱 RESPONSIVE — Tablet ≤1024px           */
/* ══════════════════════════════════════════ */
@media (max-width: 1024px) {
  #left-panel { width: 280px; min-width: 280px; }
  #right-panel { width: 280px; min-width: 280px; }
  .header-btn { padding: 6px 10px; font-size: 0.75rem; }
  .header-btn .btn-text { display: none; }
}

/* ══════════════════════════════════════════ */
/* 📱 RESPONSIVE — Smartphone ≤768px        */
/* ══════════════════════════════════════════ */
@media (max-width: 768px) {
  #editor-body { position: relative; }

  /* Left panel: slides in from left as overlay */
  #left-panel {
    position: absolute; top: 0; left: 0; bottom: 0;
    width: 100%; max-width: 340px; min-width: unset;
    transform: translateX(-100%);
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 30px rgba(0,0,0,0.6);
    overflow-y: auto;
    padding-bottom: var(--mobile-nav-h);
  }
  #left-panel.open { transform: translateX(0); }

  /* Right panel: slides in from right as overlay */
  #right-panel {
    position: absolute; top: 0; right: 0; bottom: 0;
    width: 100%; max-width: 340px; min-width: unset;
    transform: translateX(100%);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 30px rgba(0,0,0,0.6);
    overflow-y: auto;
    padding-bottom: var(--mobile-nav-h);
    padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px));
  }
  #right-panel.open { transform: translateX(0); }
  #right-panel.empty { display: flex; }

  /* Show close buttons on mobile panels */
  .btn-close-panel { display: flex; }
  #right-panel .panel-header .header-btn { display: none; }
  #right-panel .panel-header .btn-close-panel { display: flex; }

  /* Room takes full width */
  #room-container { flex: 1; }

  /* Header: compact */
  #editor-header .logo .logo-text { display: none; }
  .header-btn .btn-text { display: none; }
  .header-btn { padding: 6px 10px; gap: 0; }
  #editor-header .event-name { font-size: 0.85rem; }

  /* Smaller tables on mobile */
  :root { --seat-size: 28px; }

  /* TOAST */
  .toast { bottom: 76px; right: 10px; font-size: 0.8rem; padding: 8px 14px; }

  /* Room hint */
  .room-hint { font-size: 1.2rem; }
}

/* ── MOBILE BOTTOM NAV ── */
#mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--bg2); border-top: 1px solid var(--border);
  height: var(--mobile-nav-h);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
@media (max-width: 768px) {
  #mobile-nav { display: flex; }
  #editor-screen { padding-bottom: 0; }
  #editor-body { height: calc(100vh - var(--header-h) - var(--mobile-nav-h)); height: calc(100dvh - var(--header-h) - var(--mobile-nav-h)); }
}
.nav-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px;
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 0.6rem;
  font-weight: 500; transition: color 0.2s; padding: 6px 4px;
}
.nav-tab i { font-size: 1.1rem; }
.nav-tab.active { color: var(--accent); }

/* ── BACKDROP ── */
#panel-backdrop {
  display: none; position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,0.5);
}
#panel-backdrop.active { display: block; }

/* ── CONFIG RESPONSIVE ── */
@media (max-width: 768px) {
  #viewbar {
    bottom: calc(var(--mobile-nav-h) + 12px); right: 10px;
    max-width: calc(100% - 20px);
  }
  #viewbar #zoom100, #viewbar #roomSizeBtn { display: none; }
  #viewbar .zlabel { min-width: 38px; }
  #viewbar button { padding: 0 6px; }
  #viewbar .sep { margin: 0 1px; }
}
@media (max-width: 480px) {
  .config-card { padding: 28px 20px; border-radius: 18px; }
  .config-card h1 { font-size: 1.6rem; }
  .config-row { flex-direction: column; gap: 10px; }
}

/* ══════════════════════════════════════════════════════════════
   AFFICHAGE — Auto (système) / Clair / Sobre
   Le mode sombre reste le thème par défaut de :root ; les modes
   clairs posent data-theme sur <body> et redéfinissent les variables.
   ══════════════════════════════════════════════════════════════ */
body[data-theme="clair"] {
  --bg: #F6F4EF;
  --bg2: #FFFFFF;
  --card: #FFFFFF;
  --border: #D2CBBB;
  --text: #1F1D1A;
  --accent: #8A6A2F;
  --accent-hover: #A17E3C;
  --on-accent: #FFFFFF;
  --wall: #6E6250;
  --muted: #6E6A62;
  --danger: #B03A2E;
  --success: #1E8449;

  --canvas-bg: #EDE9E0;
  --canvas-dot: rgba(0, 0, 0, 0.09);
  --stage-bg: #FFFDF8;
  --stage-border: #D9D2C3;
  --grid: rgba(0, 0, 0, 0.08);
  --grid-maj: rgba(0, 0, 0, 0.14);
  --ruler-bg: #F7F3EA;
  --ruler-fg: #5F5A50;
  --ruler-border: #D5CDBD;
  --tick: #B3AA94;
  --tick-maj: #8E8574;
  --viewbar-bg: rgba(255, 255, 255, 0.96);
  --viewbar-border: #D8D2C6;
  --viewbar-fg: #4E4A41;
  --viewbar-hover: #F0EBE0;
  --table-g1: #FFFFFF;
  --table-g2: #E6DCC7;
  --table-border: #9C8F75;
  --seat-bg: #FFFFFF;
  --seat-border: #B3A88F;
  --seat-hover: #F4EFE4;
  --occupied-g1: #F3E2BC;
  --occupied-g2: #FFFDF8;
  --hint: #B3AA94;
  --config-grad: radial-gradient(ellipse at center, #FFFFFF 0%, #EFEBE2 100%);
}

body[data-theme="sobre"] {
  --bg: #F2F2F0;
  --bg2: #FFFFFF;
  --card: #FAFAF8;
  --border: #CECEC8;
  --text: #1C1C1A;
  --accent: #4A4A44;
  --accent-hover: #5E5E56;
  --on-accent: #FFFFFF;
  --wall: #4F4F49;
  --muted: #6B6B66;
  --danger: #A03A32;
  --success: #2E6B45;

  --canvas-bg: #ECECEA;
  --canvas-dot: rgba(0, 0, 0, 0.06);
  --stage-bg: #FFFFFF;
  --stage-border: #D8D8D3;
  --grid: rgba(0, 0, 0, 0.07);
  --grid-maj: rgba(0, 0, 0, 0.12);
  --ruler-bg: #F4F4F1;
  --ruler-fg: #5F5F5A;
  --ruler-border: #D2D2CC;
  --tick: #B0B0A9;
  --tick-maj: #8C8C85;
  --viewbar-bg: rgba(255, 255, 255, 0.97);
  --viewbar-border: #D8D8D3;
  --viewbar-fg: #55554F;
  --viewbar-hover: #EFEFEA;
  --table-g1: #FFFFFF;
  --table-g2: #ECECE7;
  --table-border: #B0B0A8;
  --seat-bg: #FAFAF8;
  --seat-border: #BDBDB5;
  --seat-hover: #F3F3EF;
  --occupied-g1: #EFEFEA;
  --occupied-g2: #FFFFFF;
  --hint: #C4C4BD;
  --config-grad: radial-gradient(ellipse at center, #FFFFFF 0%, #EDEDEA 100%);
}

body[data-theme] #config-screen { background: var(--config-grad); }
body[data-theme] .config-card { box-shadow: 0 20px 60px rgba(60, 50, 30, 0.12); }

body[data-theme] #room-container {
  background-color: var(--canvas-bg);
  background-image: radial-gradient(circle at 1px 1px, var(--canvas-dot) 1px, transparent 0);
}
body[data-theme] #stage {
  background: var(--stage-bg);
  border-color: var(--stage-border);
  box-shadow: 0 24px 60px rgba(60, 50, 30, 0.10), inset 0 0 0 1px rgba(0, 0, 0, 0.02);
}
body[data-theme] #room-grid {
  background-image:
    repeating-linear-gradient(0deg, transparent 0 24px, var(--grid) 24px 25px),
    repeating-linear-gradient(90deg, transparent 0 24px, var(--grid) 24px 25px),
    repeating-linear-gradient(0deg, transparent 0 99px, var(--grid-maj) 99px 100px),
    repeating-linear-gradient(90deg, transparent 0 99px, var(--grid-maj) 99px 100px);
}
body[data-theme] .room-hint { color: var(--hint); }

body[data-theme] .ruler { background: var(--ruler-bg); color: var(--ruler-fg); }
body[data-theme] #rulerH { border-bottom-color: var(--ruler-border); }
body[data-theme] #rulerV { border-right-color: var(--ruler-border); }
body[data-theme] .ruler .tick { background: var(--tick); }
body[data-theme] .ruler .tick.maj { background: var(--tick-maj); }
body[data-theme] .ruler .lbl { color: var(--ruler-fg); }

body[data-theme] #viewbar {
  background: var(--viewbar-bg);
  border-color: var(--viewbar-border);
  box-shadow: 0 8px 24px rgba(60, 50, 30, 0.12);
}
body[data-theme] #viewbar button { color: var(--viewbar-fg); }
body[data-theme] #viewbar button:hover { background: var(--viewbar-hover); color: var(--text); }
body[data-theme] #viewbar .zlabel { color: var(--text); }
body[data-theme] #viewbar .sep { background: var(--viewbar-border); }
body[data-theme] #viewbar button.tg.on { background: rgba(138, 106, 47, 0.14); color: var(--accent); }
body[data-theme="sobre"] #viewbar button.tg.on { background: rgba(0, 0, 0, 0.07); color: var(--accent); }

body[data-theme] .table-visual {
  background: radial-gradient(circle at 40% 35%, var(--table-g1), var(--table-g2));
  border-color: var(--table-border);
  box-shadow: 0 4px 12px rgba(60, 50, 30, 0.12);
}
body[data-theme] .table-visual.rect { background: linear-gradient(135deg, var(--table-g1), var(--table-g2)); }
body[data-theme] .table-group:hover .table-visual { box-shadow: 0 0 20px rgba(138, 106, 47, 0.12); }
body[data-theme] .table-group.selected .table-visual {
  border-width: 3px;
  box-shadow: 0 0 0 4px rgba(138, 106, 47, 0.16), 0 0 30px rgba(138, 106, 47, 0.30);
}
body[data-theme] .seat.occupied { border-width: 2px; }
body[data-theme] .seat.occupied span, body[data-theme] .seat.occupied { font-size: 0.62rem; }
body[data-theme] .seat { background: var(--seat-bg); border-color: var(--seat-border); }
body[data-theme] .seat:hover { background: var(--seat-hover); }
body[data-theme] .seat.occupied {
  background: linear-gradient(135deg, var(--occupied-g1), var(--occupied-g2));
  color: var(--accent);
}
body[data-theme] .overlay { background: rgba(28, 26, 22, 0.35); }
body[data-theme] .modal { box-shadow: 0 20px 60px rgba(60, 50, 30, 0.18); }
body[data-theme] input::placeholder,
body[data-theme] textarea::placeholder { color: #9A9487; }
body[data-theme] ::-webkit-scrollbar-thumb:hover { background: #B9B2A4; }

/* menu d'affichage */
#themeMenu {
  position: absolute; right: 0; bottom: calc(100% + 8px);
  min-width: 158px; padding: 4px; z-index: 40;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  display: flex; flex-direction: column; gap: 2px;
}
#themeMenu[hidden] { display: none; }
#themeMenu button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 7px 10px; border: none; border-radius: 6px;
  background: none; color: var(--text); cursor: pointer; text-align: left;
  font-family: 'DM Sans', sans-serif; font-size: 0.8rem;
}
#themeMenu button:hover { background: var(--bg); }
#themeMenu button[aria-checked="true"] { color: var(--accent); font-weight: 700; }
#themeMenu button[aria-checked="true"]::after { content: "✓"; }

/* ══════════════════════════════════════════════════════════════
   ÉLÉMENTS DE SALLE — murs, portes, fenêtres, comptoirs
   ══════════════════════════════════════════════════════════════ */
.lp-tabs {
  display: flex; gap: 4px; padding: 8px 10px; flex: 0 0 auto;
  border-bottom: 1px solid var(--border); background: var(--bg2);
}
.lp-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 6px; border: 1px solid transparent; border-radius: 8px;
  background: none; color: var(--muted); cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 0.76rem;
}
.lp-tab:hover { color: var(--text); }
.lp-tab.on { background: var(--bg); border-color: var(--border); color: var(--text); font-weight: 600; }
#left-panel { display: flex; flex-direction: column; min-height: 0; }
.lp-pane { display: flex; flex-direction: column; min-height: 0; flex: 1; overflow: hidden; }
.lp-pane[hidden] { display: none; }

.el-intro { padding: 10px 14px; color: var(--muted); font-size: 0.74rem; line-height: 1.45; border-bottom: 1px solid var(--border); }
.el-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 14px 8px; }
.el-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  padding: 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg2); color: var(--text); cursor: pointer; text-align: left;
  font-family: 'DM Sans', sans-serif;
}
.el-btn:hover { border-color: var(--accent); }
.el-btn i { color: var(--accent); font-size: 1rem; margin-bottom: 3px; }
.el-btn b { font-size: 0.8rem; font-weight: 600; }
.el-btn small { font-size: 0.64rem; color: var(--muted); }
.el-btn.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: rgba(212, 168, 83, 0.10); }
.el-tip { padding: 0 14px 10px; color: var(--muted); font-size: 0.66rem; line-height: 1.6; }
.el-tip kbd {
  font-family: 'DM Sans', sans-serif; font-size: 0.62rem; padding: 1px 4px;
  border: 1px solid var(--border); border-radius: 4px; background: var(--bg);
}
.el-list { flex: 1; min-height: 60px; overflow-y: auto; border-top: 1px solid var(--border); padding: 6px 8px; }
.el-empty { padding: 18px 10px; text-align: center; color: var(--muted); font-size: 0.72rem; line-height: 1.5; }
.el-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px;
  border-radius: 7px; cursor: pointer; font-size: 0.75rem; color: var(--muted);
}
.el-row:hover { background: var(--bg); }
.el-row.on { background: var(--bg); color: var(--text); }
.el-row > i { width: 14px; text-align: center; color: var(--accent); flex: 0 0 auto; }
.el-row .el-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.el-row .el-del {
  border: none; background: none; color: var(--muted); cursor: pointer;
  padding: 2px 4px; opacity: 0; transition: opacity 0.15s;
}
.el-row:hover .el-del { opacity: 1; }
.el-row .el-del:hover { color: var(--danger); }

/* ── objets sur le canevas ── */
#objects-layer { position: absolute; inset: 0; z-index: 0; }
#room-container.tool-active #stage,
#room-container.tool-active .table-group { cursor: crosshair; }

.wall-piece {
  position: absolute; background: var(--wall); border-radius: 1px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); pointer-events: none;
}
.wall-hit { position: absolute; background: transparent; cursor: move; touch-action: none; }
.wall-hit.selected { outline: 2px solid var(--accent); outline-offset: 2px; }
.wall-hit.locked { cursor: default; }
.wall-draft {
  position: absolute; background: var(--accent); opacity: 0.55;
  border-radius: 1px; pointer-events: none;
}

.opening {
  position: absolute; background: var(--stage-bg); cursor: pointer;
  touch-action: none; z-index: 2;
}
.opening .jamb { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--wall); }
.opening .jamb.l { left: 0; }
.opening .jamb.r { right: 0; }
.opening .door-svg {
  position: absolute; left: 0; top: 0; overflow: visible;
  pointer-events: none; z-index: 3;
}
.opening .door-svg .door-arc {
  fill: none; stroke: var(--accent); stroke-width: 1.5; opacity: 0.55;
}
.opening .door-svg .door-leaf {
  fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linecap: round;
}
.opening.window .glass {
  position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  background: var(--accent); opacity: 0.85; transform: translateY(-50%);
}
.opening.window .glass.snd { top: calc(50% + 3px); opacity: 0.45; }
.opening.window::before, .opening.window::after {
  content: ""; position: absolute; top: -3px; bottom: -3px; width: 2px;
  background: var(--accent); opacity: 0.5;
}
.opening.window::before { left: -2px; }
.opening.window::after { right: -2px; }
.opening.selected { outline: 2px solid var(--accent); outline-offset: 3px; z-index: 6; }

.counter {
  position: absolute; background: var(--card); border: 1.5px solid var(--table-border);
  border-radius: 6px; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  cursor: move; touch-action: none; z-index: 1;
}
.counter .ct-label {
  font-family: 'DM Sans', sans-serif; font-size: 0.7rem; font-weight: 600;
  color: var(--accent); letter-spacing: 0.02em; padding: 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.counter .ct-dims {
  font-family: 'DM Sans', sans-serif; font-size: 0.56rem; color: var(--muted);
  font-weight: 500; pointer-events: none;
}
.counter.selected { outline: 2px solid var(--accent); outline-offset: 2px; z-index: 5; }

/* Flèche : élément directionnel, 4 orientations */
.arrow {
  position: absolute; color: var(--accent); cursor: move; touch-action: none; z-index: 2;
}
.arrow svg { display: block; width: 100%; height: 100%; overflow: visible; }
.arrow .arrow-label {
  position: absolute; left: 50%; top: 50%;
  font-family: 'DM Sans', sans-serif; font-size: 0.6rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--ink);
  background: var(--bg); border-radius: 3px; padding: 1px 4px;
  white-space: nowrap; pointer-events: none;
}
.arrow.selected { outline: 2px solid var(--accent); outline-offset: 3px; z-index: 6; }
.plan-obj.locked { cursor: default; opacity: 0.88; }

.obj-handle {
  position: absolute; width: 12px; height: 12px; background: var(--accent);
  border: 2px solid var(--bg2); border-radius: 50%; z-index: 20;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); touch-action: none;
}
.obj-handle.wall-a { left: -5px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.obj-handle.wall-b { right: -5px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.obj-handle.ow { right: -5px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.obj-handle.br { right: -6px; bottom: -6px; cursor: nwse-resize; }
.obj-handle.rot { left: 50%; top: -24px; transform: translateX(-50%); cursor: grab; }
.obj-handle.arrow-tip { right: -6px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }

.tool-hint {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 30; display: flex; align-items: center; gap: 10px;
  max-width: calc(100% - 40px); padding: 6px 8px 6px 14px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 22px;
  color: var(--text); font-size: 0.75rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.tool-hint[hidden] { display: none; }
.tool-hint span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-hint button {
  border: none; background: var(--accent); color: var(--on-accent);
  border-radius: 16px; padding: 5px 12px; cursor: pointer; white-space: nowrap;
  font-family: 'DM Sans', sans-serif; font-size: 0.72rem; font-weight: 600;
}

/* inspecteur d'élément */
.obj-props { padding: 10px 14px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--border); }
.obj-row { display: flex; align-items: center; gap: 10px; font-size: 0.78rem; }
.obj-row > label { flex: 0 0 84px; color: var(--muted); }
.obj-input { display: flex; align-items: center; gap: 6px; flex: 1; }
.obj-input input {
  width: 84px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg); color: var(--text); font-family: 'DM Sans', sans-serif; font-size: 0.78rem;
}
.obj-input span { color: var(--muted); font-size: 0.7rem; }
.obj-static { color: var(--text); font-size: 0.75rem; }
.obj-seg { display: flex; gap: 4px; flex: 1; }
.obj-seg button {
  flex: 1; padding: 6px; border: 1px solid var(--border); border-radius: 7px;
  background: var(--bg); color: var(--muted); cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 0.7rem;
}
.obj-seg button.on { border-color: var(--accent); color: var(--accent); background: rgba(212, 168, 83, 0.12); }

@media (max-width: 768px) {
  .el-grid { gap: 6px; padding: 10px; }
  .el-btn { padding: 8px; }
  .obj-row > label { flex-basis: 74px; }
  .tool-hint { top: 8px; font-size: 0.7rem; }
  .el-tip { display: none; }
}

/* ─── ÉVÉNEMENT SERVEUR : retour + statut de sauvegarde ─── */
.header-btn.event-back { text-decoration: none; }
.save-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'DM Sans', sans-serif;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
  white-space: nowrap;
  padding: 0 4px;
}
.save-status.ok { color: var(--success); }
.save-status.err { color: var(--danger); }
.save-status::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  opacity: .8;
}

/* ─── MODE ÉVÉNEMENT : invités gérés côté serveur ─── */
body.event-mode .participant-form { display: none; }
body.event-mode .participant-item .del-btn { display: none; }
body.event-mode #eventGuestsLink { display: flex !important; }

/* ─── Libellés libres sur le plan ─── */
#labels-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}
.plan-label {
  position: absolute;
  pointer-events: auto;
  cursor: grab;
  color: var(--text);
  font-family: var(--sans);
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  padding: 2px 5px;
  border: 1px solid transparent;
  border-radius: 4px;
  transform-origin: left top;
  user-select: none;
}
.plan-label:active { cursor: grabbing; }
.plan-label.selected {
  border-color: var(--accent);
  background: rgba(212, 168, 83, .12);
  box-shadow: 0 0 0 3px rgba(212, 168, 83, .12);
}
.plan-label.color-muted { color: var(--muted); }
.plan-label.color-brass { color: var(--accent); }
.plan-label.color-light { color: var(--text); opacity: .72; }
body[data-theme="clair"] .plan-label.color-light { color: #6B6457; opacity: 1; }
body[data-theme="sobre"] .plan-label.color-light { color: #D6D0C4; opacity: 1; }
