/* ============================================
   SEATING PLAN - Interactive
   ============================================ */

/* Alt+drag : feedback visuel de duplication sur la table/élément draggé.
   Léger halo doré + opacité réduite → l'utilisateur voit que ce qu'il drague
   sera dupliqué au drop (l'original reste à sa place). */
.seating-table.is-duplicating,
.seating-element.is-duplicating,
.seat-element.is-duplicating,
.seat-table.is-duplicating {
  opacity: 0.75;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent),
              0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent) !important;
  cursor: copy !important;
}

/* ───── Modale raccourcis clavier ───── */
.shortcut-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
}
.shortcut-row {
  display: grid;
  grid-template-columns: minmax(140px, auto) 1fr;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.12s;
}
.shortcut-row:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.shortcut-keys {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.shortcut-kbd {
  display: inline-block;
  min-width: 28px;
  padding: 3px 8px;
  background: var(--surface);
  border: 1px solid var(--muted-soft);
  border-bottom-width: 2px;
  border-radius: 5px;
  font-family: 'JetBrains Mono', Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--ink-soft);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}
.shortcut-plus {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 0 2px;
}
.shortcut-label {
  font-size: 13px;
  color: var(--ink);
  line-height: 1.4;
}
@media (max-width: 540px) {
  .shortcut-row { grid-template-columns: 1fr; gap: 6px; }
  .shortcut-keys { justify-content: flex-start; }
}


/* Toggle Adulte / Enfant en haut de la modale invité */
.guest-kind-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--bg-deep);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px;
  margin-bottom: var(--space-4);
}
.guest-kind-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  color: var(--ink-soft);
}
.guest-kind-opt input { display: none; }
.guest-kind-opt:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.guest-kind-opt.is-active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--accent) 20%, transparent), 0 0 0 1px var(--joy-gold-ink, var(--accent));
  font-weight: 600;
}

/* Bloc profil enfant — section additionnelle visible uniquement si kind='child' */
.guest-child-block {
  background: linear-gradient(135deg, color-mix(in srgb, var(--joy-rose-tint) 8%, transparent), color-mix(in srgb, var(--joy-apricot-tint) 6%, transparent));
  border: 1px solid color-mix(in srgb, var(--joy-rose-tint) 35%, transparent);
  border-radius: 10px;
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}
.guest-child-banner {
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  border-left: 3px solid var(--joy-rose-ink);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: var(--space-3);
  line-height: 1.4;
}

/* Badge enfant dans la liste invités */
.seating-guest-kidbadge {
  display: inline-block;
  background: linear-gradient(135deg, var(--joy-rose-tint), var(--joy-apricot-tint));
  color: var(--joy-rose-ink);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px 1px 5px;
  border-radius: 999px;
  margin-right: 6px;
  vertical-align: middle;
  white-space: nowrap;
}


.seating-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--space-5);
  height: calc(100vh - 320px);
  min-height: 600px;
}

@media (max-width: 960px) {
  .seating-layout { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .seating-sidebar { max-height: 400px; }
}

/* Stats bar */
/* En-tête éditorial du Plan de table (maquette) : eyebrow + titre serif scindé
   + actions rapides (Coin des enfants / Exporter). */
.seating-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-4);
}
.seating-header-titles { min-width: 0; }
.seating-page-title {
  margin: 2px 0 0;
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 400;
  line-height: 1.05;
}
.seating-header-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.seating-header-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 4px;
  border-radius: var(--radius-full, 999px);
  background: var(--joy-plum-tint); color: var(--joy-plum-ink);
  font-size: 11px; font-weight: 700;
}
@media (max-width: 640px) {
  .seating-header { align-items: flex-start; }
  .seating-header-actions { width: 100%; }
}

.seating-stats {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}
.seating-stat { flex: 1; min-width: 120px; }
.seating-stat-label {
  font-size: 10px; color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.18em; font-weight: 600; margin-top: 2px;
}
.seating-stat-value {
  font-size: clamp(1.9rem, 3vw, 2.4rem); font-weight: 400; color: var(--accent);
  font-family: var(--serif); line-height: 1; letter-spacing: -0.01em;
  font-feature-settings: "lnum","onum";
}
.seating-stat-sub { font-size: var(--text-xs); color: var(--muted); margin-top: 3px; }

/* Sidebar (guest list) */
.seating-sidebar {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.seating-sidebar-header {
  padding: var(--space-4);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}
.seating-sidebar-header h3 {
  font-family: var(--serif);
  font-size: var(--text-base);
  margin: 0;
}
.seating-sidebar-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.1;
  color: var(--ink);
  margin: 0;
  flex: 1;
}
.seating-sidebar-title em { font-style: italic; color: var(--accent); }
.seating-sidebar-count {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--accent);
}
.seating-search {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
}
.seating-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-family: inherit;
}
.seating-filters {
  display: flex;
  gap: 4px;
  padding: 0 var(--space-4) var(--space-3);
  flex-wrap: wrap;
}
.seating-filter-chip {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: all 0.15s;
}
.seating-filter-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.seating-guest-list {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-2);
}
.seating-guest-item {
  padding: 9px 11px;
  border-radius: 10px;
  cursor: grab;
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 2px;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s;
  user-select: none;
  touch-action: none;
}
.seating-guest-item:hover {
  background: color-mix(in srgb, var(--bg-deep) 55%, transparent);
  border-color: var(--line);
}
.seating-guest-item.assigned {
  opacity: 0.55;
  cursor: default;
}
.seating-guest-item.dragging {
  opacity: 0.4;
  border: 1px dashed var(--accent);
}
/* Avatar éditorial : cercle teinté par côté (joy), initiales serif. */
.seating-guest-avatar {
  --gh-ink: var(--accent); --gh-tint: var(--accent-soft);
  position: relative;
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--gh-tint);
  border: 1.5px solid var(--gh-ink);
  color: var(--gh-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 13px; line-height: 1;
}
.seating-guest-avatar-kid {
  position: absolute; bottom: -3px; right: -3px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--gh-ink);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8px;
}
.seating-guest-name {
  flex: 1;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.seating-guest-meta {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-soft);
}
/* Pastille régime / allergie sur la carte invité (façon maquette). */
.seating-guest-pill {
  display: inline-block;
  margin-left: 6px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  vertical-align: middle;
  white-space: nowrap;
  background: var(--joy-sage-tint);
  color: var(--joy-sage-ink);
}
.seating-guest-pill[data-tone="child"]   { background: var(--joy-plum-tint);    color: var(--joy-plum-ink); }
.seating-guest-pill[data-tone="allergy"] { background: var(--joy-rose-tint);    color: var(--joy-rose-ink); }
.seating-guest-pill[data-tone="diet"]    { background: var(--joy-apricot-tint); color: var(--joy-apricot-ink); }
.seating-guest-tablebadge {
  font-size: 10px;
  background: var(--accent);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
}

/* Canvas */
.seating-canvas-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.seating-canvas-toolbar {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}
.seating-canvas-toolbar .spacer { flex: 1; }

/* V41: more visible canvas — clear contrast against the page background,
   inset shadow for "drafting paper" depth, denser grid for spatial reference. */
.seating-canvas {
  flex: 1;
  position: relative;
  background:
    /* Major gridlines every 5 cells = ~20cm landmarks */
    linear-gradient(color-mix(in srgb, var(--accent-dark) 18%, transparent) 1px, transparent 1px) 0 0 / 200px 200px,
    linear-gradient(90deg, color-mix(in srgb, var(--accent-dark) 18%, transparent) 1px, transparent 1px) 0 0 / 200px 200px,
    /* Minor gridlines */
    linear-gradient(color-mix(in srgb, var(--accent-dark) 7%, transparent) 1px, transparent 1px) 0 0 / 40px 40px,
    linear-gradient(90deg, color-mix(in srgb, var(--accent-dark) 7%, transparent) 1px, transparent 1px) 0 0 / 40px 40px,
    /* Warm cream paper base */
    var(--bg-deep);
  min-height: 500px;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--surface) 60%, transparent),
    inset 0 4px 12px color-mix(in srgb, var(--ink) 6%, transparent),
    0 1px 3px color-mix(in srgb, var(--ink) 5%, transparent);
}
.seating-canvas.panning { cursor: grabbing; }
.seating-canvas-inner {
  position: absolute;
  top: 0;
  left: 0;
  width: 1600px;
  height: 1000px;
  transform-origin: 0 0;
  will-change: transform;
}

/* Zoom controls */
.seating-zoom-controls {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  overflow: hidden;
}
.seating-zoom-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: none;
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  transition: background 0.15s;
  padding: 0;
}
.seating-zoom-btn:last-child { border-bottom: none; }
.seating-zoom-btn:hover { background: var(--accent-light); }
.seating-zoom-level {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: var(--text-xs);
  color: var(--muted);
  pointer-events: none;
  z-index: 10;
  font-variant-numeric: tabular-nums;
}

/* Table */
.seat-table {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Empreinte façon maquette : fond OPAQUE teinté + bord fin (ne laisse pas
     transparaître la grille / le plan de fond). */
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--ink);
  text-align: center;
  cursor: move;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
  user-select: none;
  touch-action: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.seat-table:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.15); }
.seat-table.selected { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); z-index: 5; }
.seat-table.drop-target {
  border-color: var(--joy-sage-ink);
  background: var(--joy-sage-tint, var(--joy-sage-tint));
  transform: scale(1.05);
}
.seat-table.full {
  border-color: var(--danger);
}
/* Conflit de placement : invités « à ne pas asseoir ensemble » à la même table. */
.seat-table.conflict {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 22%, transparent);
}
.seat-table.conflict .seat-u-bg path { stroke: var(--danger); }
/* Icône « vœu de placement » sur la carte invité du rail. */
.seating-guest-link {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  vertical-align: -2px;
  color: var(--joy-plum-ink);
}
.seating-guest-link svg { display: block; }

.seat-table.shape-round { border-radius: 50%; }
.seat-table.shape-square { border-radius: 12px; }
.seat-table.shape-rect { border-radius: 8px; }
/* Impériale (banquet) : longue table légèrement teintée (maquette). */
.seat-table.shape-imperiale { border-radius: 8px; background: var(--joy-gold-tint, var(--surface)); }
/* Table en U (« cocon ») : l'empreinte est dessinée en SVG (seat-u-bg) ; le
   conteneur lui-même est transparent pour ne laisser voir que le U. */
.seat-table.shape-u { background: transparent; border: none; box-shadow: none; }
.seat-u-bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
/* Fond du U OPAQUE (override de l'attribut SVG translucide) — comme les autres tables. */
.seat-u-bg path { fill: color-mix(in srgb, var(--accent) 14%, var(--surface)); }

.seat-table-label {
  font-weight: 400;
  font-style: italic;
  font-size: var(--text-base);
  font-family: var(--serif);
  color: var(--ink);
  padding: 0 4px;
  pointer-events: none;
}
.seat-table-seats {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  pointer-events: none;
}
.seat-table-seats.ok { color: var(--joy-sage-ink, var(--joy-sage-ink)); font-weight: 600; }
.seat-table-seats.over { color: var(--danger); font-weight: 600; }

/* Table manage modal - guest assignment */
.seat-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}
@media (max-width: 640px) {
  .seat-modal-grid { grid-template-columns: 1fr; }
}

.seat-modal-col h4 {
  font-family: var(--serif);
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.seat-pick-list {
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.seat-pick-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: var(--text-sm);
  transition: background 0.15s;
}
.seat-pick-item:hover { background: var(--bg); }
.seat-pick-item.in-table { background: var(--accent-light); color: var(--accent); font-weight: 600; }
.seat-pick-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Two-line layout: name on top, dietary pills + allergies below */
.seat-pick-body { flex: 1; min-width: 0; }
.seat-pick-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: var(--text-sm);
}
.seat-pick-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-top: 3px;
}
.seat-pick-tag {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.seat-pick-allergy {
  font-size: 11px;
  color: var(--danger);
  font-weight: 600;
  padding: 1px 7px;
  background: var(--danger-light);
  border-radius: 999px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seat-pick-seat {
  font-size: 10px;
  color: var(--muted);
  background: var(--bg-deep);
  padding: 0 6px;
  border-radius: 999px;
  font-weight: 600;
}

/* Guest modal form */
.guest-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
@media (max-width: 520px) {
  .guest-form-grid { grid-template-columns: 1fr; }
}

/* Import preview table */
.seat-import-preview {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-top: var(--space-3);
}
.seat-import-preview table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.seat-import-preview th, .seat-import-preview td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.seat-import-preview th {
  background: var(--bg);
  font-weight: 600;
  position: sticky;
  top: 0;
}
.seat-import-preview tr.invalid td { color: var(--danger); background: color-mix(in srgb, var(--danger) 5%, transparent); }
.seat-import-dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.15s;
}
.seat-import-dropzone:hover, .seat-import-dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}
.seat-import-dropzone svg { color: var(--muted); margin-bottom: 8px; }
.seat-import-summary {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-3);
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-top: var(--space-3);
  font-size: var(--text-sm);
}
.seat-import-summary strong { color: var(--accent); }

/* Mobile: hide toolbar hint text, show compact */
@media (max-width: 640px) {
  .seating-canvas-toolbar { padding: var(--space-2) var(--space-3); }
  .seating-canvas-toolbar .hint-text { display: none; }
  .seating-stats { gap: var(--space-2); padding: var(--space-3); }
  .seating-stat { min-width: 80px; }
  .seating-stat-value { font-size: var(--text-base); }
  .seating-zoom-btn { width: 40px; height: 40px; font-size: 20px; }
}

/* Print view */
@media print {
  .app-sidebar, .app-header, .tabs-wrapper, .tab-grid-mobile, .back-link, .wedding-hero-actions, .seating-sidebar, .seating-canvas-toolbar, .seating-stats, .seating-zoom-controls, .seating-zoom-level { display: none !important; }
  .seating-layout { grid-template-columns: 1fr; height: auto; }
  .seating-canvas { overflow: visible; border: none; }
  .seating-canvas-inner { width: 100%; height: auto; transform: none !important; }
}

/* Colors for group/side */
.seat-side-bride { background: var(--joy-rose-tint); }
.seat-side-groom { background: var(--joy-sky-tint); }
.seat-side-both { background: var(--joy-sage-tint); }
.seat-side-friends { background: var(--joy-apricot-tint); }
.seat-side-other { background: var(--joy-sky-tint); }

/* ---- Diet color dots on table tiles (Phase 2) ---- */
.seat-table-diets {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 3px;
  align-items: center;
  pointer-events: none;
}
.seat-diet-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1.5px var(--surface), 0 1px 2px rgba(0,0,0,0.15);
  position: relative;
  font-size: 9px;
  line-height: 1;
}
.seat-diet-dot-n {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: var(--surface);
  color: var(--ink);
  font-size: 8px;
  font-weight: 700;
  border-radius: 999px;
  padding: 0 3px;
  line-height: 1.2;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

/* ---- Inline contact block for relance filters (Phase 4) ---- */
.seating-guest-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
  font-size: var(--text-xs);
}
.seating-guest-contact a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 999px;
}
.seating-guest-contact a:hover { text-decoration: underline; }

/* ============================================
   Phase 5 — Room elements + scale
   ============================================ */

/* Toolbox panel — hidden by default, expands when 🧩 Éléments is clicked */
.seat-el-toolbox {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  margin: 0 var(--space-3) var(--space-3);
}
.seat-el-toolbox.open { display: block; }
.seat-el-toolbox-title {
  font-size: var(--text-xs);
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.seat-el-toolbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.seat-el-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-left: 3px solid var(--el-color, var(--muted-soft));
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  text-align: left;
  transition: background 0.15s, transform 0.05s;
}
.seat-el-btn:hover { background: var(--accent-soft); }
.seat-el-btn:active { transform: scale(0.97); }
.seat-el-btn-icon { font-size: 18px; flex-shrink: 0; display: inline-flex; align-items: center; color: var(--el-color, var(--ink)); }
.seat-el-btn-icon svg { display: block; }
.seat-el-icon svg { display: block; }
.seat-el-btn-label { font-weight: 500; }

/* Icônes au trait de la barre d'outils / en-tête : alignement vertical propre
   sur le texte des boutons, et centrage dans les boutons de zoom. */
.seat-ui-ico { vertical-align: -3px; flex-shrink: 0; }
.seating-canvas-toolbar .btn .seat-ui-ico,
.seating-header-actions .btn .seat-ui-ico { margin-right: 1px; }
.seating-zoom-btn { display: inline-flex; align-items: center; justify-content: center; }
.seating-zoom-btn .seat-ui-ico { vertical-align: 0; }

/* Room element on canvas */
.seat-element {
  position: absolute;
  border-radius: 6px;
  box-sizing: border-box;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: none;
  transition: box-shadow 0.15s;
  z-index: 1; /* below tables (z-index 2) so guests drop on tables stay clear */
}
.seat-element:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.15); }
.seat-element:active { cursor: grabbing; }
.seat-el-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  max-width: 100%;
}
.seat-el-icon { font-size: 14px; flex-shrink: 0; }
.seat-el-label { text-overflow: ellipsis; overflow: hidden; }

/* Walls / windows are typically thin — make them filled rather than dashed */
.seat-el-wall, .seat-el-window {
  border-style: solid !important;
  border-width: 0 !important;
  background-color: var(--color, var(--ink-soft)) !important;
}
.seat-el-wall { background: var(--ink-soft) !important; color: var(--surface) !important; }
.seat-el-window { background: var(--joy-sky-tint) !important; color: var(--joy-sky-ink) !important; }
.seat-el-wall .seat-el-label, .seat-el-window .seat-el-label { color: inherit; }

/* Tables sit above elements visually */
.seat-table { z-index: 2; }

/* Ruler — soft beige lines along top + left edges */
.seat-ruler {
  position: absolute;
  pointer-events: none;
  z-index: 3;
}
.seat-ruler-h {
  top: 0; left: 0;
  height: 18px;
  width: 100%;
  border-bottom: 1px solid color-mix(in srgb, var(--accent-dark) 25%, transparent);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.seat-ruler-v {
  top: 0; left: 0;
  width: 22px;
  height: 100%;
  border-right: 1px solid color-mix(in srgb, var(--accent-dark) 25%, transparent);
  background: color-mix(in srgb, var(--surface) 60%, transparent);
}
.seat-ruler-tick {
  position: absolute;
  top: 0;
  width: 1px;
  height: 18px;
  background: color-mix(in srgb, var(--accent-dark) 35%, transparent);
}
.seat-ruler-tick > span {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 9px;
  color: var(--accent-dark);
  font-family: Georgia, serif;
}
.seat-ruler-tick-v {
  position: absolute;
  left: 0;
  width: 22px;
  height: 1px;
  background: color-mix(in srgb, var(--accent-dark) 35%, transparent);
}
.seat-ruler-tick-v > span {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 9px;
  color: var(--accent-dark);
  font-family: Georgia, serif;
}

/* Hide rulers on print to keep the plan clean */
@media print {
  .seat-ruler, .seat-el-toolbox { display: none !important; }
}

/* ---- Resize handle (SE corner of tables and elements) ---- */
.seat-table, .seat-element { position: absolute; }
.seat-resize-handle {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 14px;
  height: 14px;
  background: linear-gradient(135deg, transparent 50%, var(--accent) 50%);
  border-radius: 0 0 4px 0;
  cursor: nwse-resize;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 4;
  touch-action: none;
}
.seat-table:hover .seat-resize-handle,
.seat-element:hover .seat-resize-handle,
.seat-resize-handle:active {
  opacity: 1;
}
/* On touch devices, a hover state is unreliable — keep the handle visible */
@media (hover: none) {
  .seat-resize-handle { opacity: 0.7; }
}
@media print {
  .seat-resize-handle { display: none !important; }
}

/* ---- Panneau de calques (Phase 2b) ---- */
.seat-layers-panel {
  background: var(--surface, var(--surface));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg, 10px);
  padding: var(--space-2, 8px);
  margin-bottom: var(--space-3, 12px);
  max-width: 360px;
  box-shadow: var(--shadow-sm);
}
.seat-layers-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3, 12px);
  padding: 4px 8px 8px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 4px;
}
.seat-layers-head strong { font-family: var(--serif); font-size: var(--text-base, 0.95rem); }
.seat-layer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius-md, 6px);
}
.seat-layer-row:hover { background: var(--bg-deep, rgba(0,0,0,0.03)); }
.seat-layer-row.is-hidden { opacity: 0.5; }
.seat-layer-icon { font-size: 15px; flex: 0 0 auto; }
.seat-layer-name { flex: 1; font-size: var(--text-sm, 0.85rem); font-weight: 500; }
.seat-layer-count {
  display: inline-block;
  min-width: 18px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg-deep, rgba(0,0,0,0.05));
  border-radius: 999px;
  padding: 0 6px;
  margin-left: 4px;
}
.seat-layer-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-md, 6px);
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background 0.12s, border-color 0.12s;
}
.seat-layer-btn:hover { background: var(--bg-deep, rgba(0,0,0,0.06)); }
.seat-layer-btn.is-on { border-color: var(--accent); color: var(--accent-dark, var(--accent-dark)); }
.seat-layer-btn:disabled, .seat-layer-btn-ghost { cursor: default; opacity: 0.45; }
.seat-layer-btn-ghost:hover { background: transparent; }
.seat-layer-chevron {
  flex: 0 0 auto;
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 11px; padding: 0;
  border-radius: 3px;
}
.seat-layer-chevron:hover { background: var(--bg-deep, rgba(0,0,0,0.06)); }
.seat-layer-chevron-empty { cursor: default; }
.seat-layer-chevron-empty:hover { background: transparent; }
/* Lignes d'objet (indentées) */
.seat-layer-obj { padding-left: 4px; }
.seat-layer-obj-bullet { color: var(--muted); font-size: 12px; opacity: 0.7; }
.seat-layer-obj-name {
  flex: 1;
  text-align: left;
  border: none; background: transparent; cursor: pointer;
  font-size: var(--text-sm, 0.85rem);
  color: var(--ink);
  padding: 2px 4px; border-radius: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seat-layer-obj-name:hover { background: var(--bg-deep, rgba(0,0,0,0.06)); color: var(--accent-dark, var(--accent-dark)); }
/* Flash de mise en évidence d'un objet sélectionné depuis les calques */
@keyframes seatFlash {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  30% { box-shadow: 0 0 0 4px var(--accent, var(--accent)); }
}
.seat-flash { animation: seatFlash 1s ease; }
@media print { .seat-layers-panel { display: none !important; } }

/* ---- Image de fond (Phase 2 — calque « plan du lieu » / Canva) ----
   Derrière tout (z-index 0, sous le périmètre/floor rendus ensuite),
   non interactive : sert de référence visuelle pour poser les tables. */
.seat-bg-layer {
  position: absolute;
  z-index: 0;
  overflow: hidden;
}
.seat-bg-layer img { display: block; }
/* Déverrouillé : déplaçable / redimensionnable (reste sous les tables). */
.seat-bg-layer.is-editable {
  pointer-events: auto;
  cursor: move;
  z-index: 1;
  outline: 2px dashed var(--accent, var(--accent));
  outline-offset: -1px;
}
.seat-bg-resize { opacity: 1 !important; z-index: 5; }

/* ---- Verrouillage (Phase 1) ----
   Un objet verrouillé : curseur normal (pas de "move"), liseré discret, et
   badge cadenas cliquable. Les poignées resize/rotate ne sont pas rendues. */
.seat-table.locked,
.seat-element.locked {
  cursor: default;
}
.seat-table.locked { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--muted) 45%, transparent); }
.seat-element.locked { outline: 1.5px dashed color-mix(in srgb, var(--muted) 50%, transparent); outline-offset: -3px; }
.seat-lock-badge {
  position: absolute;
  top: -9px;
  right: -9px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  line-height: 1;
  background: var(--surface, var(--surface));
  border: 1px solid var(--line, rgba(0,0,0,0.15));
  border-radius: 50%;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,0.08));
  cursor: pointer;
  padding: 0;
  z-index: 6;
  touch-action: none;
  transition: transform 0.12s;
}
.seat-lock-badge:hover { transform: scale(1.15); }
@media print {
  .seat-lock-badge { display: none !important; }
}

/* ---- Rotation handle (elements only) — sits above the top edge ----
   Anchored 24px above so it stays reachable even on very thin shapes
   (walls, fenêtres). The connector line below it makes it obvious it
   belongs to the element. */
.seat-rotate-handle {
  position: absolute;
  left: 50%;
  top: -28px;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 50%;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 5;
  touch-action: none;
}
.seat-rotate-handle::after {
  /* the connector line */
  content: '';
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 12px;
  background: var(--accent);
  transform: translateX(-50%);
}
.seat-rotate-handle:active { cursor: grabbing; }
.seat-element:hover .seat-rotate-handle,
.seat-rotate-handle:active {
  opacity: 1;
}
@media (hover: none) {
  .seat-rotate-handle { opacity: 0.7; }
}
@media print {
  .seat-rotate-handle { display: none !important; }
}

/* ---- Live HUD: shows current size or rotation while dragging a handle ---- */
.seating-hud {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  background: color-mix(in srgb, var(--ink) 92%, transparent);
  color: var(--surface);
  padding: 5px 10px;
  font-family: var(--serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  white-space: nowrap;
  display: none;
}

/* ---- Bigger, more readable ruler labels ---- */
.seat-ruler-h { height: 24px; }
.seat-ruler-v { width: 28px; }
.seat-ruler-tick { height: 24px; }
.seat-ruler-tick-v { width: 28px; }
.seat-ruler-tick > span,
.seat-ruler-tick-v > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  font-family: Georgia, serif;
  top: 2px;
  left: 4px;
}

/* ---- Phase 5+ refinements: opaque types, bigger labels, canvas resize ---- */

/* Bigger element labels (was 11px). Allow wrapping on tall elements. */
.seat-el-inner {
  padding: 4px 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 1px rgba(0,0,0,0.05);
}
.seat-el-icon { font-size: 16px; }
.seat-el-label {
  text-overflow: ellipsis;
  overflow: hidden;
  font-family: var(--serif);
}

/* Opaque shapes (walls, windows, doors) — solid border, white label,
   compact paddings so the label fits even on thin elements. */
.seat-element.seat-el-opaque .seat-el-inner {
  text-shadow: 0 1px 2px rgba(0,0,0,0.45);
}
.seat-el-wall, .seat-el-window, .seat-el-door-in, .seat-el-door-out {
  border-style: solid !important;
  border-width: 1px !important;
}
.seat-el-wall      { color: var(--surface) !important; }
.seat-el-window    { color: var(--joy-sky-ink) !important; }
.seat-el-door-in   { color: var(--surface) !important; }
.seat-el-door-out  { color: var(--surface) !important; }

/* Toolbox: visual feedback while dragging an element type onto the canvas */
.seat-el-btn.dragging { opacity: 0.4; transform: scale(0.97); }

/* Canvas-resize handles — the WP can extend her working area */
.seat-canvas-resize {
  position: absolute;
  background: color-mix(in srgb, var(--accent-dark) 18%, transparent);
  z-index: 5;
  transition: background 0.12s;
}
.seat-canvas-resize:hover, .seat-canvas-resize:active {
  background: var(--accent);
}
.seat-canvas-resize-e {
  right: 0;
  top: 0;
  width: 6px;
  height: 100%;
  cursor: ew-resize;
  touch-action: none;
}
.seat-canvas-resize-s {
  left: 0;
  bottom: 0;
  width: 100%;
  height: 6px;
  cursor: ns-resize;
  touch-action: none;
}
.seat-canvas-resize-se {
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  background: var(--accent);
  border-radius: 4px 0 0 0;
  touch-action: none;
}
@media print {
  .seat-canvas-resize { display: none !important; }
}

/* ============================================
   CHAIRS — placement precis autour des tables
   ============================================ */

/* Container hint: le seat-table est position:absolute avec width/height fixés.
   Les chaises sont position:absolute par rapport à lui mais débordent (les
   coordonnées peuvent être négatives pour les chaises au-dessus). */
.seat-table { overflow: visible; }

.seat-chair {
  position: absolute;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  user-select: none;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: transform 0.1s, box-shadow 0.12s, border-color 0.12s;
  z-index: 3; /* above tables, under popovers */
}
.seat-chair:hover {
  transform: scale(1.12);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
  z-index: 4;
}
.seat-chair.drop-target {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-dark) 25%, transparent);
}
/* Source chair while being dragged: dimmed + grabbing cursor */
.seat-chair.dragging {
  opacity: 0.45;
  cursor: grabbing !important;
}
.seat-chair.occupied:active {
  cursor: grabbing;
}
/* Empty chair: light grey with seat number */
.seat-chair:not(.occupied) {
  border: 1.5px dashed color-mix(in srgb, var(--muted) 45%, transparent);
  background: transparent !important;
  color: var(--muted-soft) !important;
  box-shadow: none;
}
.seat-chair:not(.occupied):hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent) !important;
}
.seat-chair-num { font-size: 10px; font-weight: 600; }
.seat-chair-initials { font-size: 11px; }

/* Allergy ring: red dashed outer halo to alert at a glance */
.seat-chair-allergy {
  box-shadow: 0 0 0 2px var(--danger), 0 1px 4px rgba(0, 0, 0, 0.18);
}
/* Pregnant ring: pink halo (combinable with allergy ring via stacking) */
.seat-chair-pregnant {
  box-shadow: 0 0 0 2px var(--joy-rose-ink), 0 1px 4px rgba(0, 0, 0, 0.18);
}
.seat-chair-pregnant.seat-chair-allergy {
  box-shadow: 0 0 0 2px var(--danger), 0 0 0 4px var(--joy-rose-ink), 0 1px 4px rgba(0, 0, 0, 0.18);
}
/* Baby seat ring: warm orange dashed halo */
.seat-chair-baby {
  box-shadow: 0 0 0 2px var(--joy-apricot-ink), 0 1px 4px rgba(0, 0, 0, 0.18);
}
.seat-chair-baby.seat-chair-allergy {
  box-shadow: 0 0 0 2px var(--danger), 0 0 0 4px var(--joy-apricot-ink), 0 1px 4px rgba(0, 0, 0, 0.18);
}
.seat-chair-baby.seat-chair-pregnant {
  box-shadow: 0 0 0 2px var(--joy-rose-ink), 0 0 0 4px var(--joy-apricot-ink), 0 1px 4px rgba(0, 0, 0, 0.18);
}

/* Stack of small icon badges over the chair (top-right, slight overflow) */
.seat-chair-badges {
  position: absolute;
  top: -7px;
  right: -7px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  pointer-events: none;
  z-index: 6;
}
.seat-chair-badge {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  line-height: 1;
}
.seat-chair-badge-baby    { background: var(--joy-apricot-ink); }
.seat-chair-badge-allergy { background: var(--danger); color: var(--surface); }
.seat-chair-badge-pregnant{ background: var(--joy-rose-ink); }

/* ---- Allergy checkbox grid (guest modal) ---- */
.seat-allergy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px 12px;
  padding: 10px;
  background: var(--bg-deep, var(--bg-deep));
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}
.seat-allergy-chk {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  padding: 3px 4px;
  border-radius: 4px;
  transition: background 0.12s;
}
.seat-allergy-chk:hover { background: color-mix(in srgb, var(--danger) 7%, transparent); }
.seat-allergy-chk input { cursor: pointer; accent-color: var(--danger); }
.seat-allergy-chk input:checked + span { color: var(--danger); font-weight: 600; }

/* ---- Chair popover (click to place / manage) ---- */
.seat-chair-popover {
  position: fixed;
  z-index: 9000;
  min-width: 240px;
  max-width: 320px;
  max-height: 70vh;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
  padding: var(--space-2);
}
.seat-chair-popover-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 6px;
}
.seat-chair-popover-section {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 8px 10px 4px;
}
.seat-chair-popover-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: var(--text-sm);
  color: var(--ink);
  cursor: pointer;
}
.seat-chair-popover-item:hover { background: var(--accent-soft); }
.seat-chair-popover-danger { color: var(--danger); }
.seat-chair-popover-empty {
  padding: 10px;
  font-size: var(--text-sm);
  color: var(--muted);
  font-style: italic;
}
.seat-chair-popover-guest {
  padding: 8px 10px;
  background: var(--bg-deep);
  border-radius: 6px;
  margin: 4px 0 8px;
}
.seat-chair-popover-name {
  font-weight: 700;
  font-size: var(--text-sm);
  margin-bottom: 4px;
}
.seat-chair-popover-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.seat-chair-popover-tag {
  font-size: 10px;
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.seat-chair-popover-allergy {
  font-size: 11px;
  color: var(--danger);
  font-weight: 600;
}
.seat-chair-popover-footer {
  border-top: 1px solid var(--line-soft);
  margin-top: 6px;
  padding: 6px 4px 0;
  text-align: right;
}

@media print {
  .seat-chair-popover { display: none !important; }
  /* Print: keep chairs visible (useful) but compact */
  .seat-chair { box-shadow: none !important; border: 1px solid var(--muted-soft) !important; }
}

/* ============================================
   FULLSCREEN MODE for the seating editor
   ============================================ */

/* ============================================
   Mode plein écran — VRAI plein écran
   Garde uniquement : canvas + toolbar minimaliste (construction) + sidebar
   invités en drawer accessible via ☰. Tout le reste du chrome app disparaît.
   ============================================ */
body.seating-fullscreen #sidebar,
body.seating-fullscreen .sidebar,
body.seating-fullscreen #mobile-header,
body.seating-fullscreen .mobile-header,
body.seating-fullscreen .sidebar-overlay,
body.seating-fullscreen .tabs,
body.seating-fullscreen .tabs-wrapper,
body.seating-fullscreen .tab-grid-mobile,
body.seating-fullscreen .back-link,
body.seating-fullscreen .wedding-hero,
body.seating-fullscreen .wedding-detail-hero,
body.seating-fullscreen .dash-hero,
body.seating-fullscreen .dash-hero-countdown,
body.seating-fullscreen .section-header,
body.seating-fullscreen .seating-stats,
body.seating-fullscreen .seating-stat,
body.seating-fullscreen .seat-couple-access,
body.seating-fullscreen .fab-container,
body.seating-fullscreen .notif-panel {
  display: none !important;
}

/* Body / html en plein écran : aucun scroll parasite, full viewport */
body.seating-fullscreen,
html:has(body.seating-fullscreen) {
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
}

/* Toolbar minimaliste : seuls les outils de CONSTRUCTION restent visibles.
   On masque les actions secondaires (modèles, import/export Excel, impression)
   qui n'ont rien à faire en mode édition focus. */
body.seating-fullscreen .seat-tb-secondary {
  display: none !important;
}

/* Force tous les conteneurs parents à 100vw pour éviter qu'un max-width
   intermédiaire (sur .main-content, .container, etc.) crée une colonne
   vide à droite quand on bascule en plein écran. */
body.seating-fullscreen .main-content,
body.seating-fullscreen .main-content > *,
body.seating-fullscreen #wedding-tab-content {
  max-width: none !important;
  width: 100% !important;
}

body.seating-fullscreen .main-content {
  margin: 0 !important;
  padding: 0 !important;
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  overflow: hidden;
  background: var(--bg);
  z-index: 8000;
}

/* Modales et toasts AU-DESSUS de l'overlay plein écran (.main-content = 8000).
   Sinon, en plein écran, la modale d'édition (taille d'un élément, etc.) et
   l'ajout d'invité s'ouvrent mais restent invisibles derrière l'overlay. */
body.seating-fullscreen #modal-container { z-index: 9000 !important; }
body.seating-fullscreen #toast-container { z-index: 9001 !important; }

/* Wedding tab content takes all available space */
body.seating-fullscreen #wedding-tab-content {
  height: 100vh;
  width: 100vw !important;
  display: flex;
  flex-direction: column;
  margin: 0 !important;
  padding: 0 !important;
}

/* Single-column layout : la sidebar invités passe en mode drawer (sliding)
   en plein écran — exactement comme sur tablette/mobile. Accessible via le
   bouton ☰ Invités de la toolbar. */
body.seating-fullscreen .seating-layout {
  grid-template-columns: 1fr !important;
  width: 100vw !important;
  max-width: none !important;
  height: 100vh !important;
  min-height: 100vh !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
  position: relative !important;
}

/* Canvas wrap doit prendre toute la largeur en plein écran */
body.seating-fullscreen .seating-canvas-wrap {
  width: 100vw !important;
  max-width: none !important;
  border-radius: 0 !important;
  border-left: none !important;
  border-right: none !important;
}

/* Canvas (viewport zoomable) prend toute la place restante après la toolbar */
body.seating-fullscreen .seating-canvas {
  border-radius: 0 !important;
  border: none !important;
  width: 100% !important;
}
body.seating-fullscreen .seating-sidebar {
  position: fixed !important;
  top: 0; left: 0; bottom: 0;
  width: 320px;
  max-width: 85vw;
  max-height: none !important;
  z-index: 9100 !important;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(.22, .61, .36, 1);
  box-shadow: 8px 0 24px rgba(0, 0, 0, 0.2);
  border-radius: 0 !important;
}
body.seating-fullscreen .seating-layout.sidebar-open .seating-sidebar {
  transform: translateX(0);
}
body.seating-fullscreen .seating-layout.sidebar-open::before {
  content: '';
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 40%, transparent);
  z-index: 9050;
}
/* Le bouton ☰ Invités devient visible en plein écran (même sur desktop) */
body.seating-fullscreen .seating-sidebar-toggle {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}
/* La croix ✕ de la sidebar aussi devient visible */
body.seating-fullscreen .seating-sidebar-close {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* Slim toolbar at the top of fullscreen so we keep the toggle button reachable */
body.seating-fullscreen .seating-canvas-toolbar {
  border-radius: 0;
  border-left: none;
  border-right: none;
  padding: 8px 14px;
}

/* Canvas takes the rest of the viewport */
body.seating-fullscreen .seating-canvas-wrap {
  height: 100vh;
  display: flex;
  flex-direction: column;
}
body.seating-fullscreen .seating-canvas {
  flex: 1;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
}

/* Pulse the exit button so it stays discoverable */
body.seating-fullscreen #seating-fullscreen-btn {
  background: var(--accent);
  color: var(--surface);
  font-weight: 600;
}
body.seating-fullscreen #seating-fullscreen-btn:hover { filter: brightness(1.05); }

/* ============================================
   SEATING TEMPLATES — picker + save form
   ============================================ */

.seating-templates-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line-soft);
  padding: 0 var(--space-5);
  margin-top: var(--space-2);
}
.seating-templates-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.seating-templates-tab:hover { color: var(--ink); }
.seating-templates-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.seating-templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-3);
}
.seating-template-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.seating-template-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent-dark) 10%, transparent);
}
.seating-template-thumb {
  height: 130px;
  background: linear-gradient(135deg, var(--bg-deep), var(--surface));
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
}
.seating-template-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}
.seating-template-thumb-empty { font-size: 38px; opacity: 0.4; }
.seating-template-body { padding: var(--space-3); flex: 1; }
.seating-template-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  margin-bottom: 4px;
  letter-spacing: 0.2px;
}
.seating-template-desc {
  font-size: var(--text-xs);
  color: var(--muted);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.seating-template-meta {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.seating-template-actions {
  display: flex;
  gap: 4px;
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid var(--line-soft);
  background: var(--bg-deep);
}
.seating-template-actions .btn { flex: 1; }
.seating-template-actions .btn-icon { flex: 0 0 auto; }

/* Stats bar centered when no actions inside */
.seating-stats-centered {
  justify-content: center;
}
.seating-stats-centered .seating-stat {
  flex: 0 0 auto;
  min-width: 140px;
  text-align: center;
}

/* ---- Floor finish picker (concrete/parquet/grass...) ---- */
.floor-finish-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 6px;
}
.floor-finish-swatch {
  position: relative;
  height: 40px;
  border: 2px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink);
  text-shadow: 0 1px 2px color-mix(in srgb, var(--surface) 60%, transparent);
  padding: 0;
}
.floor-finish-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft, var(--bg-deep));
}
.floor-finish-swatch:hover { transform: scale(1.03); }

/* ---- Floor element: stays under everything ---- */
.seat-el-floor {
  z-index: 0 !important;
  /* Subtle inset shadow gives "ground" feel without being heavy */
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.06);
}

/* Pillars: small obstacles, default visible label */
.seat-el-pillar-round, .seat-el-pillar-rect {
  border-style: solid !important;
}

/* ============================================
   Lot 1 — PLAN DE TRAVAIL (architectural style)
   Rendu façon plan d'architecte : bordure dorée nette avec coins marqués,
   léger fond ivoire, cotes externes, label principal en haut-droite.
   ============================================ */
.seat-room-perimeter {
  position: absolute;
  z-index: 0;
  /* Bordure dorée nette + remplissage subtil "papier blueprint" */
  border: 2px solid var(--joy-gold-ink, var(--accent));
  background:
    repeating-linear-gradient(
      135deg,
      color-mix(in srgb, var(--accent) 3%, transparent) 0px,
      color-mix(in srgb, var(--accent) 3%, transparent) 8px,
      transparent 8px,
      transparent 16px
    ),
    radial-gradient(ellipse at center, color-mix(in srgb, var(--bg) 60%, transparent) 0%, color-mix(in srgb, var(--accent) 4%, transparent) 100%);
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent),
    inset 0 0 30px color-mix(in srgb, var(--accent) 8%, transparent),
    0 6px 24px color-mix(in srgb, var(--accent) 15%, transparent);
  pointer-events: none;
  border-radius: 2px;
}

/* Coins décoratifs (style plan d'architecte) */
.seat-room-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.seat-room-corner::before,
.seat-room-corner::after {
  content: '';
  position: absolute;
  background: var(--joy-gold-ink, var(--accent));
}
.seat-room-corner::before { width: 18px; height: 3px; top: 0; left: 0; }
.seat-room-corner::after  { width: 3px; height: 18px; top: 0; left: 0; }
.seat-room-corner-tl { top: -2px; left: -2px; }
.seat-room-corner-tr { top: -2px; right: -2px; transform: scaleX(-1); }
.seat-room-corner-bl { bottom: -2px; left: -2px; transform: scaleY(-1); }
.seat-room-corner-br { bottom: -2px; right: -2px; transform: scale(-1, -1); }

/* Cotes externes (mesures façon plan d'architecte) */
.seat-room-dim {
  position: absolute;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  font-size: 13px;
  font-weight: 500;
  color: var(--joy-gold-ink, var(--accent));
  background: var(--bg, var(--bg));
  padding: 1px 10px;
  letter-spacing: 0.05em;
  pointer-events: none;
  white-space: nowrap;
}
.seat-room-dim-top {
  top: -11px;
  left: 50%;
  transform: translateX(-50%);
}
.seat-room-dim-right {
  top: 50%;
  right: -10px;
  transform: translate(50%, -50%) rotate(90deg);
  transform-origin: center;
}

/* Label principal en haut-droite (style étiquette de plan) */
.seat-room-label {
  position: absolute;
  top: -16px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 12px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: white;
  font-family: var(--font-sans, system-ui);
  border-radius: 4px;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent);
  pointer-events: auto;
  white-space: nowrap;
  z-index: 2;
}
.seat-room-label-icon { font-size: 14px; line-height: 1; }
.seat-room-label-text { display: flex; flex-direction: column; gap: 1px; line-height: 1.1; }
.seat-room-label-text strong {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.seat-room-label-text small {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.92;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-style: italic;
  letter-spacing: 0.02em;
}

.seat-room-edit {
  background: color-mix(in srgb, var(--surface) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--surface) 30%, transparent);
  color: white;
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 11px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.seat-room-edit:hover {
  background: color-mix(in srgb, var(--surface) 35%, transparent);
  border-color: color-mix(in srgb, var(--surface) 50%, transparent);
  transform: scale(1.05);
}

/* État actif du bouton toolbar "Délimiter le plan de travail" */
.seating-canvas-toolbar button.btn.active {
  background: var(--joy-gold-tint, var(--joy-gold-tint));
  border-color: var(--joy-gold-ink, var(--accent));
  color: var(--joy-gold-ink, var(--accent));
  font-weight: 600;
}

/* Label du plan de travail — non-draggable, hover subtil uniquement */
.seat-room-label:hover {
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 45%, transparent);
}

/* Poignées de redimensionnement du plan de travail */
.seat-room-resize {
  position: absolute;
  background: var(--joy-gold-ink, var(--accent));
  opacity: 0.45;
  transition: opacity 0.15s, transform 0.15s;
  pointer-events: auto;
  z-index: 3;
  touch-action: none;
}
.seat-room-resize:hover { opacity: 1; }
.seat-room-resize-e {
  cursor: ew-resize;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 36px;
  border-radius: 4px;
}
.seat-room-resize-s {
  cursor: ns-resize;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  height: 8px;
  width: 36px;
  border-radius: 4px;
}
.seat-room-resize-se {
  cursor: nwse-resize;
  right: -6px;
  bottom: -6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
}
body.is-resizing-room .seating-canvas-inner { cursor: nwse-resize !important; }
body.is-resizing-room .seat-room-perimeter {
  outline: 2px dashed var(--joy-gold-ink, var(--accent));
  outline-offset: 4px;
}

/* ============================================
   Modal de saisie des dimensions du plan de travail
   ============================================ */
.seat-room-info-banner {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), color-mix(in srgb, var(--accent) 4%, transparent));
  border-left: 3px solid var(--joy-gold-ink, var(--accent));
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: var(--space-4);
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink, var(--ink));
}
.seat-room-info-banner strong { color: var(--joy-gold-ink, var(--accent)); }

.seat-room-unit-toggle {
  display: flex;
  gap: 8px;
}
.seat-room-unit-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1.5px solid var(--line, var(--line));
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  background: white;
}
.seat-room-unit-opt input { display: none; }
.seat-room-unit-opt:hover { border-color: var(--joy-gold-ink, var(--accent)); }
.seat-room-unit-opt.is-active {
  background: var(--joy-gold-tint, var(--joy-gold-tint));
  border-color: var(--joy-gold-ink, var(--accent));
  color: var(--joy-gold-ink, var(--accent));
  font-weight: 600;
}

.seat-room-dims-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: var(--space-3);
}
.seat-room-dims-grid input { font-size: 16px; font-weight: 500; }

.seat-room-preview {
  background: var(--bg-deep, var(--bg-deep));
  border: 1px dashed var(--line, var(--line));
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: space-around;
  margin-top: var(--space-3);
}
.seat-room-preview-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: center;
}
.seat-room-preview-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted, var(--muted));
}
.seat-room-preview-value {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--joy-gold-ink, var(--accent));
}

@media (max-width: 480px) {
  .seat-room-dims-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Lot 2 + 3 — UX desktop/tablette + mobile/iPad
   ============================================ */

/* ---- Bouton fermeture sidebar (visible uniquement en mode drawer) ---- */
.seating-sidebar-close {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line, var(--line));
  border-radius: 50%;
  width: 28px; height: 28px;
  font-size: 14px;
  cursor: pointer;
  color: var(--muted, var(--muted));
}
.seating-sidebar-close:hover {
  background: var(--bg-deep, var(--bg-deep));
  color: var(--ink, var(--ink));
}

/* Bouton "☰ Invités" caché par défaut (desktop), visible sur tablette/mobile */
.seating-sidebar-toggle { display: none; }

/* ============================================
   Tablette + mobile (< 960 px)
   La sidebar devient un drawer slide-in (off-screen par défaut),
   le canvas occupe toute la largeur pour gagner de l'espace.
   ============================================ */
@media (max-width: 960px) {
  .seating-layout {
    grid-template-columns: 1fr;
    position: relative;
  }

  /* Sidebar en drawer */
  .seating-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 320px;
    max-width: 85vw;
    max-height: none !important;
    z-index: 9000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(.22, .61, .36, 1);
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.15);
    border-radius: 0 !important;
  }
  .seating-layout.sidebar-open .seating-sidebar {
    transform: translateX(0);
  }

  /* Backdrop quand drawer ouvert */
  .seating-layout.sidebar-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: color-mix(in srgb, var(--ink) 50%, transparent);
    z-index: 8999;
    animation: seat-drawer-fade-in 0.2s ease;
  }
  @keyframes seat-drawer-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  /* Bouton fermer visible dans le header de la sidebar */
  .seating-sidebar-close { display: inline-flex; align-items: center; justify-content: center; }

  /* Bouton "☰ Invités" visible dans la toolbar */
  .seating-sidebar-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    font-weight: 600;
  }
}

/* ============================================
   Touch device : handles plus gros (44px Apple HIG target)
   Détection via pointer:coarse (tactile primaire, pas hybride)
   ============================================ */
@media (pointer: coarse) {
  /* Resize handles du canvas : 16px au lieu de 6px */
  .seat-canvas-resize {
    width: 18px !important;
    height: 18px !important;
    background: color-mix(in srgb, var(--accent) 40%, transparent) !important;
    border: 1.5px solid var(--accent) !important;
  }
  .seat-canvas-resize-e { right: -9px !important; top: 50% !important; height: 60px !important; width: 18px !important; }
  .seat-canvas-resize-s { bottom: -9px !important; left: 50% !important; height: 18px !important; width: 60px !important; }
  .seat-canvas-resize-se { right: -9px !important; bottom: -9px !important; width: 24px !important; height: 24px !important; }

  /* Handles de redimensionnement / rotation des tables et éléments */
  .seat-table-resize, .seat-el-resize, .seat-el-rotate {
    width: 22px !important;
    height: 22px !important;
    font-size: 12px !important;
  }

  /* Boutons toolbar : 44px touch target Apple */
  .seating-canvas-toolbar .btn {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 13px;
  }

  /* Boutons de zoom canvas (au moins 44px) */
  .seating-zoom-btn {
    width: 44px !important;
    height: 44px !important;
    font-size: 18px !important;
  }
}

/* ============================================
   Hint pinch-zoom (one-time popup au premier load touch)
   ============================================ */
.seating-touch-hint {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 60%, transparent);
  backdrop-filter: blur(4px);
  z-index: 10100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: seat-hint-fade 0.3s ease;
}
@keyframes seat-hint-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.seating-touch-hint-body {
  background: white;
  border-radius: 16px;
  padding: 28px 32px;
  text-align: center;
  max-width: 360px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
  animation: seat-hint-pop 0.4s cubic-bezier(.22, 1.2, .36, 1);
}
@keyframes seat-hint-pop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.seating-touch-hint-body strong {
  display: block;
  font-family: var(--font-heading, Georgia, serif);
  font-size: 20px;
  color: var(--joy-gold-ink, var(--accent));
  margin-bottom: 10px;
}
.seating-touch-hint-body p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 18px;
}
.seating-touch-hint-body button {
  background: var(--joy-gold-ink, var(--accent));
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.seating-touch-hint-body button:hover { background: var(--accent-dark); }

/* ============================================
   MODAL APERÇU AVANT IMPRESSION
   Sélection format A4/A3 + orientation portrait/landscape, avec aperçu papier
   ============================================ */
.print-fmt-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.print-fmt-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--line, var(--line));
  border-radius: 10px;
  cursor: pointer;
  background: white;
  transition: all 0.15s;
}
.print-fmt-opt input { display: none; }
.print-fmt-opt:hover { border-color: var(--joy-gold-ink, var(--accent)); }
.print-fmt-opt.is-active {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 8%, transparent), color-mix(in srgb, var(--accent) 4%, transparent));
  border-color: var(--joy-gold-ink, var(--accent));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 15%, transparent);
}
.print-fmt-opt span:first-child + span {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.print-fmt-opt strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink, var(--ink));
}
.print-fmt-opt small {
  font-size: 11px;
  color: var(--muted, var(--muted));
  font-style: italic;
  margin-top: 2px;
}
.print-fmt-icon {
  font-size: 22px;
  line-height: 1;
  color: var(--joy-gold-ink, var(--accent));
  flex-shrink: 0;
}
.print-fmt-opt.is-active .print-fmt-icon {
  color: var(--joy-gold-ink, var(--accent));
}

/* Aperçu papier (carte qui change de ratio selon format choisi) */
.print-preview-stage {
  background: var(--bg-deep, var(--bg-deep));
  border-radius: 10px;
  padding: 24px;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}
.print-preview-paper {
  background: white;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  transition: width 0.3s, height 0.3s;
  position: relative;
}
.print-preview-label {
  position: absolute;
  top: -10px;
  left: 12px;
  background: var(--joy-gold-ink, var(--accent));
  color: white;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 3px;
}
.print-preview-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.print-preview-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink, var(--ink));
}
.print-preview-subtitle {
  font-size: 11px;
  color: var(--muted, var(--muted));
}
.print-preview-fmt {
  margin-top: 8px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--joy-gold-ink, var(--accent));
  font-weight: 600;
}

/* Dimensions de l'aperçu (échelle réduite, ratios respectés)
   A4 : 210 × 297 mm = ratio 1 / 1.414
   A3 : 297 × 420 mm = ratio 1 / 1.414 (idem A4, juste plus grand)
   On garde une hauteur max 180px pour rester compact. */
.print-preview-A4-landscape   { width: 254px; height: 180px; }
.print-preview-A4-portrait    { width: 127px; height: 180px; }
.print-preview-A3-landscape   { width: 254px; height: 180px; }
.print-preview-A3-portrait    { width: 127px; height: 180px; }
/* A3 = même ratio que A4 mais on signale visuellement la différence d'épaisseur */
.print-preview-A3-landscape,
.print-preview-A3-portrait {
  border-width: 2px;
  border-color: var(--joy-gold-ink, var(--accent));
}

@media (max-width: 520px) {
  .print-fmt-toggle { grid-template-columns: 1fr; }
}

/* ============================================
   Carte "Accès couple au plan de table" en tête de l'onglet
   ============================================ */
.seat-couple-access {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: var(--space-4);
  background: var(--surface, var(--surface));
  border: 1px solid var(--line, var(--line));
  border-left: 3px solid var(--muted, var(--muted));
  border-radius: 8px;
  transition: border-left-color 0.2s, background 0.2s;
}
.seat-couple-access.is-on {
  border-left-color: var(--joy-sage-ink, var(--joy-sage-ink));
  background: linear-gradient(135deg, color-mix(in srgb, var(--joy-sage-ink) 4%, transparent), color-mix(in srgb, var(--joy-sage-ink) 1%, transparent));
}
.seat-couple-access-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.seat-couple-access-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep, var(--bg-deep));
  border-radius: 50%;
}
.seat-couple-access.is-on .seat-couple-access-icon {
  background: color-mix(in srgb, var(--joy-sage-ink) 12%, transparent);
}
.seat-couple-access-title {
  font-family: var(--font-heading, Georgia, serif);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink, var(--ink));
  margin-bottom: 2px;
}
.seat-couple-access-desc {
  font-size: 12px;
  color: var(--muted, var(--muted));
  line-height: 1.4;
  margin: 0;
}
/* Toggle switch iOS-style */
.seat-couple-access-toggle {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}
.seat-couple-access-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.seat-couple-access-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--line);
  border-radius: 999px;
  transition: 0.2s;
}
.seat-couple-access-slider:before {
  content: '';
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.seat-couple-access-toggle input:checked + .seat-couple-access-slider {
  background: var(--joy-sage-ink, var(--joy-sage-ink));
}
.seat-couple-access-toggle input:checked + .seat-couple-access-slider:before {
  transform: translateX(20px);
}

@media (max-width: 640px) {
  .seat-couple-access { flex-direction: column; align-items: stretch; gap: 12px; }
  .seat-couple-access-left { width: 100%; }
}

/* ============================================
   OUTILS D'IMPLANTATION — Mesures, Guides, Snap
   ============================================ */

/* ---- Mode mesure : curseur en croix + canvas tinté ---- */
.seating-canvas-inner.seat-meas-cursor {
  cursor: crosshair !important;
}
.seating-canvas-inner.seat-meas-cursor::before {
  content: '';
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--accent) 3%, transparent);
  pointer-events: none;
  z-index: 100;
}

/* Bannière d'instructions mode mesure (sticky top) */
.seat-meas-banner {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--joy-gold-ink, var(--accent));
  color: white;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  font-size: 14px;
  font-weight: 500;
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  gap: 16px;
  animation: seat-meas-banner-pop 0.3s ease;
  max-width: calc(100vw - 40px);
}
@keyframes seat-meas-banner-pop {
  from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0);    opacity: 1; }
}

/* ---- Bouton toolbar Mesure (état actif doré) ---- */
.seat-tb-measure.active {
  background: var(--joy-gold-ink, var(--accent)) !important;
  color: white !important;
  border-color: var(--joy-gold-ink, var(--accent)) !important;
}
.seat-tb-measure.active:hover {
  background: var(--accent-dark) !important;
}

/* ---- Mesures rendues (overlay SVG) ---- */
.seat-meas-overlay {
  pointer-events: none;
}
.seat-meas-overlay .seat-meas-delete circle {
  transition: r 0.15s ease, fill 0.15s ease;
}
.seat-meas-overlay .seat-meas-delete:hover circle {
  r: 11;
  fill: var(--joy-rose-ink);
}

/* ---- Guides d'alignement (cyan, draggables) ---- */
.seat-guide {
  position: absolute;
  z-index: 28;
  background: color-mix(in srgb, var(--joy-sky-ink) 85%, transparent);
  touch-action: none;
}
.seat-guide-v {
  top: 0;
  bottom: 0;
  width: 1px;
  cursor: ew-resize;
}
.seat-guide-h {
  left: 0;
  right: 0;
  height: 1px;
  cursor: ns-resize;
}
/* Zone d'attrape plus large que la ligne visible (pour faciliter le grab) */
.seat-guide::before {
  content: '';
  position: absolute;
  background: transparent;
}
.seat-guide-v::before { top: 0; bottom: 0; left: -4px; width: 9px; }
.seat-guide-h::before { left: 0; right: 0; top: -4px; height: 9px; }
.seat-guide:hover {
  background: var(--joy-sky-ink);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--joy-sky-ink) 30%, transparent);
}

/* Banner d'info sur les guides */
.seat-guides-info {
  background: color-mix(in srgb, var(--joy-sky-ink) 8%, transparent);
  border-left: 3px solid var(--joy-sky-ink);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink, var(--ink));
}
.seat-guides-info strong { color: var(--joy-sky-ink); }

/* ---- Touch device : guides plus épais pour faciliter le drag ---- */
@media (pointer: coarse) {
  .seat-guide-v { width: 2px; }
  .seat-guide-h { height: 2px; }
  .seat-guide-v::before { left: -10px; width: 22px; }
  .seat-guide-h::before { top: -10px; height: 22px; }
}

/* Bouton ⊕ Guides — état "masqué" indique que les guides existent mais sont
   actuellement invisibles. */
.seat-tb-construct.active-off {
  opacity: 0.5;
  text-decoration: line-through;
}

/* ---- Règles rendues clickables/draggables pour créer des guides ----
   Override critique : les .seat-ruler ont pointer-events:none par défaut,
   on doit explicitement les rendre interactifs ici. */
.seat-ruler-h, .seat-ruler-v {
  pointer-events: auto !important;
  cursor: pointer;
}
.seat-ruler-h { cursor: ew-resize; }
.seat-ruler-v { cursor: ns-resize; }
.seat-ruler-h:hover, .seat-ruler-v:hover {
  background: color-mix(in srgb, var(--joy-sky-ink) 12%, transparent) !important;
  border-color: var(--joy-sky-ink) !important;
}

/* Ghost guide pendant le drag depuis la règle (semi-transparent en mouvement) */
.seat-guide.is-ghost {
  opacity: 0.6;
  background: var(--joy-sky-ink) !important;
  pointer-events: none;
}
.seat-guide.is-ghost.seat-guide-v { width: 2px; }
.seat-guide.is-ghost.seat-guide-h { height: 2px; }
