/* Aviveil Seating Canvas, SVG Tables, and Area Overlay Styles */
.sg {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 14px;
}

.cv {
  position: relative;
  width: 100%;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.cv > img,
.cv > svg,
#seatStage > img,
#seatStage > svg#sv,
#seatStage > svg.em-interaction-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}

.drop {
  display: block;
  text-align: center;
  padding: 48px 20px;
  border: 1px dashed var(--ln);
  border-radius: 12px;
  color: var(--mu);
  cursor: pointer;
  transition: border-color 0.2s, background-color 0.2s;
}

.drop:hover {
  border-color: var(--a);
  background: rgba(255, 255, 255, 0.05);
}

.drop input {
  display: none;
}

/* SVG Tables */
.tb {
  cursor: pointer;
}

.tb circle,
.tb rect,
.tb path {
  fill: var(--a);
  fill-opacity: .38;
  stroke: var(--a);
  stroke-width: 2;
  transition: fill-opacity 0.2s, stroke 0.2s;
}

.tb.unlabeled circle,
.tb.unlabeled rect,
.tb.unlabeled path {
  stroke-dasharray: 6 4;
  stroke: #d97706;
  fill: #f59e0b;
  fill-opacity: .26;
}

.tb.s circle,
.tb.s rect,
.tb.s path {
  fill: var(--r);
  stroke: var(--r);
  fill-opacity: .55;
}

.tb text {
  fill: #1b1b22;
  font-weight: 600;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
  user-select: none;
}

.tb text.tb-occ {
  font-weight: 500;
  opacity: 0.85;
}

.tb.full circle,
.tb.full rect,
.tb.full path {
  stroke-dasharray: 5 3;
}

.tb.bk circle,
.tb.bk rect,
.tb.bk path {
  fill: var(--y);
  stroke: var(--y);
}

.tb.review circle,
.tb.review rect,
.tb.review path {
  stroke: var(--y) !important;
  stroke-width: 3.5 !important;
  fill: #fef08a;
  fill-opacity: 0.35;
}

.tb text.tb-review-note {
  fill: #b45309;
  stroke: #fef08a;
  stroke-width: 2.5px;
  paint-order: stroke;
  font-weight: 700;
}

.scan-progress-wrap {
  cursor: default;
  max-width: 520px;
  margin: 24px auto;
}

.scan-progress-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--tx);
  margin-bottom: 12px;
}

.scan-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.scan-progress-bar {
  height: 100%;
  background: #ffffff;
  border-radius: 999px;
  transition: width 0.25s ease;
}

.scan-progress-stages {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--mu);
}

.scan-progress-stages span.on {
  color: #ffffff;
  font-weight: 700;
}

.tb.hit circle,
.tb.hit rect,
.tb.hit path {
  fill: #ef7d8c !important;
  stroke: #ef7d8c !important;
  fill-opacity: .85;
  animation: pl 1s infinite alternate;
}

.tb.bk.hit circle,
.tb.bk.hit rect,
.tb.bk.hit path {
  fill: #ef7d8c !important;
  stroke: #ef7d8c !important;
}

.seat-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px 12px;
  background: var(--c);
  border: 1px solid var(--ln);
  border-radius: 10px;
}

.seat-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.seat-edit-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.seat-shape-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 210px;
  background: #141519;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 250;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65);
}

.seat-shape-popover button {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  background: transparent;
  color: #ffffff;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
}

.seat-shape-popover button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}

.cv.view-only {
  touch-action: pan-y;
}

.cv.edit-active,
#sv.edit-active {
  touch-action: none !important;
  overscroll-behavior: none !important;
}

.cv.edit-active {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

body.seat-edit-scroll-lock,
html:has(body.seat-edit-scroll-lock) {
  overflow: hidden !important;
  overscroll-behavior: none !important;
  touch-action: none !important;
}

body.seat-edit-scroll-lock main,
body.seat-edit-scroll-lock .app-content-wrap {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

@keyframes pl {
  to {
    fill-opacity: .45;
  }
}

/* Drawing Area Cursor */
#sv.dr {
  touch-action: none;
  cursor: crosshair;
}

/* Sidebar elements */
aside .card {
  margin-bottom: 12px;
}

aside input,
aside textarea {
  width: 100%;
  margin: 4px 0 8px;
}

aside button {
  margin: 0 6px 6px 0;
}

/* Mobile & Tablet Responsiveness (<= 820px) */
@media (max-width: 820px) {
  .sg {
    grid-template-columns: 1fr;
    gap: 16px;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .cv {
    max-height: 62vh;
    border-radius: 10px;
  }

  .seat-toolbar {
    padding: 8px 10px;
    gap: 8px;
  }

  .seat-toolbar-group {
    flex: 1 1 auto;
    justify-content: space-between;
    gap: 6px;
  }

  .seat-toolbar button {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 13px;
    touch-action: manipulation;
  }

  aside button {
    min-height: 38px;
    touch-action: manipulation;
  }
}

/* Elements Absolute-Positioned Overlay Layer */
.elements-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.element-node {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
  z-index: 20;
}

.element-node.editable {
  transition: filter 0.15s ease;
}

.element-node > svg {
  position: static;
  inset: auto;
  width: auto;
  height: auto;
  display: block;
  overflow: visible;
  pointer-events: auto;
  -webkit-user-select: none;
  user-select: none;
}

.element-node svg text {
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}

.element-node:not(.editable):hover {
  transform: translate(-50%, -50%) scale(1.06);
  z-index: 30;
}

.element-node.editable:hover {
  z-index: 30;
}

/* 1. Round Table: A perfect circle */
.element-round-table .element-table-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #1a1a1d;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.element-round-table.selected .element-table-circle {
  border-color: var(--a, #c9b6e4);
  background: rgba(201, 182, 228, 0.25);
}

.element-round-table.hit .element-table-circle {
  border-color: var(--y);
  background: rgba(239, 220, 176, 0.25);
}

.element-round-table.full .element-table-circle {
  border-style: dashed;
}

/* 2. Square Table: A crisp square */
.element-square-table .element-table-box {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #1a1a1d;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.element-square-table.selected .element-table-box {
  border-color: var(--a, #c9b6e4);
  background: rgba(201, 182, 228, 0.25);
}

.element-square-table.hit .element-table-box {
  border-color: var(--y);
  background: rgba(239, 220, 176, 0.25);
}

.element-square-table.full .element-table-box {
  border-style: dashed;
}

.element-table-num {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.1;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.element-table-occ {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

/* 3. Architectural Structures (Door, Elevator, Stairs, Stage, etc.) */
.element-structure {
  z-index: 15;
}

.element-structure-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.element-structure-label {
  font-size: 11px;
  line-height: 1;
}

.element-door .element-structure-pill {
  border: 1px solid rgba(243, 214, 164, 0.7);
  background: rgba(30, 25, 20, 0.85);
  color: #f3d6a4;
}

.element-elevator .element-structure-pill {
  border: 1px solid rgba(169, 211, 224, 0.7);
  background: rgba(20, 28, 34, 0.85);
  color: #a9d3e0;
}

.element-stairs .element-structure-pill {
  border: 1px solid rgba(239, 220, 176, 0.7);
  background: rgba(32, 28, 22, 0.85);
  color: #efdcb0;
}

.element-escalator .element-structure-pill {
  border: 1px solid rgba(181, 220, 195, 0.7);
  background: rgba(20, 30, 24, 0.85);
  color: #b5dcc3;
}

.element-exit .element-structure-pill {
  border: 1px solid rgba(234, 181, 192, 0.8);
  background: rgba(34, 20, 24, 0.85);
  color: #eab5c0;
}

.element-stage .element-structure-pill {
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  background: rgba(25, 25, 30, 0.88);
  color: #ffffff;
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.element-generic .element-structure-pill {
  border: 1px solid rgba(184, 184, 198, 0.65);
  background: rgba(24, 24, 28, 0.85);
  color: #b8b8c6;
}

.element-structure.selected .element-structure-pill {
  border-color: var(--r, #eab5c0);
  box-shadow: 0 0 0 3px rgba(234, 181, 192, 0.45), 0 4px 14px rgba(0, 0, 0, 0.6);
}

.element-rect-table .element-table-box {
  width: 68px;
  height: 44px;
}

.element-round-table.backup .element-table-circle,
.element-square-table.backup .element-table-box {
  border-color: var(--y, var(--y));
  background: rgba(250, 204, 21, 0.25);
}

.element-structure-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* B2B SaaS Minimalist Summary Panel (Strict #141414 Dark Theme & Tabular Numbers) */
.seat-summary-panel {
  background: #141414 !important;
  color: #ffffff !important;
  border: 1px solid #262626 !important;
  border-radius: 8px !important;
  padding: 14px 16px !important;
  font-variant-numeric: tabular-nums !important;
}

.seat-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #262626;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.65);
  font-variant-numeric: tabular-nums;
}

.seat-summary-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.seat-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  line-height: 1.45;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

.seat-summary-num {
  font-weight: 600;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
}

/* ====================================================================
 * Full-Screen Seating Map Editor — Redesign (Spec & Main.dc.html)
 * ==================================================================== */

:root,
.seat-editor-fullscreen {
  /* Surfaces */
  --bg-canvas:   #0e1014;
  --bg-panel:    #14171d;
  --bg-control:  #1a1e27;
  --bg-input:    #0e1014;
  --bg-hover:    #1f2430;

  /* Borders */
  --border:        #262b36;
  --border-strong: #333a49;

  /* Text */
  --text:       #e6e8ee;
  --text-muted: #9aa3b2;
  --text-soft:  #b4bccb;

  /* Accent */
  --accent:         #b9a4f6;
  --accent-on:      #17122b;
  --accent-subtle:  #2a2250;
  --accent-text:    #cdbcff;
  --accent-outline: #6f5bc0;

  /* Semantic */
  --success: #7fd6a0;
  --warning: #f0b35a;
  --danger:  #ff9aa6;
  --danger-border: #4a2a31;

  /* Radius */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;

  /* Font */
  --font: Inter, system-ui, sans-serif;
}

.seat-editor-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: var(--bg-canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.seat-editor-fullscreen input,
.seat-editor-fullscreen textarea,
.seat-editor-fullscreen select {
  -webkit-user-select: text;
  user-select: text;
}

.em-stage,
#seatViewport,
#seatStage,
#seatStage > img,
#seatStage svg text {
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.seat-editor-fullscreen :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Top Bar (56px) */
.em-top.seat-editor-topbar {
  height: 56px;
  min-height: 56px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  box-sizing: border-box;
  z-index: 30;
}

/* Main 4-Zone Workspace */
.em-main.seat-editor-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* 1. Tool Rail (56px, icon-only) */
.em-rail {
  width: 56px;
  flex: none;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 0;
  box-sizing: border-box;
  overflow-y: auto;
}

/* 2. Library Panel (248px) */
.em-lib {
  width: 248px;
  flex: none;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  box-sizing: border-box;
}

/* 3. Canvas Area (flex: 1, min 480px) */
.em-stage.seat-editor-canvas-area {
  flex: 1;
  min-width: 480px;
  position: relative;
  background: var(--bg-canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
}

/* 4. Inspector Panel (304px) */
.em-insp.seat-editor-toolbar {
  width: 304px;
  flex: none;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  box-sizing: border-box;
  color: var(--text);
}

.em-main.tools-collapsed .em-lib,
.em-main.tools-collapsed .em-insp {
  display: none;
}

/* Icon Buttons (.em-ib) */
.seat-editor-fullscreen .em-ib {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.seat-editor-fullscreen .em-ib.on {
  background: var(--accent-subtle);
  color: var(--accent-text);
}

.seat-editor-fullscreen .em-ib:hover:not(:disabled):not(.on) {
  background: var(--bg-hover);
}

.seat-editor-fullscreen .em-ib:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.seat-editor-fullscreen .em-ib.em-sm {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: var(--r-sm);
}

.seat-editor-fullscreen svg.em-i {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Buttons (.em-btn) */
.seat-editor-fullscreen .em-btn {
  height: 36px;
  min-height: 36px;
  padding: 0 14px;
  margin: 0;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--bg-control);
  color: var(--text);
  font: 500 13px var(--font);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  white-space: nowrap;
}

.seat-editor-fullscreen .em-btn:hover:not(:disabled) {
  background: var(--bg-hover);
}

.seat-editor-fullscreen .em-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Primary action button — ONLY for Done editing & Add N tables */
.seat-editor-fullscreen .em-btn.pri {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-on);
  font-weight: 600;
}

.seat-editor-fullscreen .em-btn.pri:hover:not(:disabled) {
  filter: brightness(1.05);
  background: var(--accent);
}

/* Danger button — text & subtle border only, never solid red background */
.seat-editor-fullscreen .em-btn.dng {
  color: var(--danger);
  border-color: var(--danger-border);
  background: var(--bg-control);
}

.seat-editor-fullscreen .em-btn.dng:hover:not(:disabled) {
  background: var(--bg-hover);
}

.seat-editor-fullscreen .em-btn.gh {
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
}

.seat-editor-fullscreen .em-btn.gh:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--text);
}

.seat-editor-fullscreen .em-btn.gh.dng {
  color: var(--danger);
}

.seat-editor-fullscreen .em-btn.on {
  border-color: var(--accent-outline);
  color: var(--accent-text);
}

/* Live Stat Chips */
.em-chip {
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  background: var(--bg-control);
  border: 1px solid var(--border);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.em-chip b {
  color: var(--text);
  font-weight: 600;
}

/* Section Headers */
.em-h {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.em-grid {
  display: grid;
  gap: 8px;
}

/* Library Tiles */
.seat-editor-fullscreen .em-tile {
  height: 64px;
  min-height: 64px;
  margin: 0;
  padding: 0;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--bg-control);
  color: var(--text);
  font: 500 12px var(--font);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-sizing: border-box;
}

.seat-editor-fullscreen .em-tile:hover,
.seat-editor-fullscreen .em-tile.on {
  border-color: var(--accent-outline);
}

.seat-editor-fullscreen .em-tile.h40 {
  height: 40px;
  min-height: 40px;
  flex-direction: row;
  justify-content: flex-start;
  padding: 0 10px;
  gap: 8px;
}

/* Inputs & Labels */
.seat-editor-fullscreen .em-in {
  height: 34px;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-input);
  color: var(--text);
  padding: 0 10px;
  font: 13px var(--font);
  font-variant-numeric: tabular-nums;
}

.seat-editor-fullscreen .em-in:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.seat-editor-fullscreen .em-lab {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  margin: 0;
}

.em-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Segmented Control (Chairs per table) */
.em-seg {
  display: flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  overflow: hidden;
}

.seat-editor-fullscreen .em-seg button {
  flex: 1;
  height: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--bg-control);
  color: var(--text-soft);
  font: 500 12px var(--font);
  cursor: pointer;
  border-right: 1px solid var(--border-strong);
  font-variant-numeric: tabular-nums;
}

.seat-editor-fullscreen .em-seg button:last-child {
  border-right: 0;
}

.seat-editor-fullscreen .em-seg button.on {
  background: var(--accent-subtle);
  color: var(--accent-text);
}

/* Inspector Summary Rows */
.em-sum {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid #20252f;
  color: var(--text-soft);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.em-sum b {
  color: var(--text);
  font-weight: 600;
}

.em-sep {
  height: 1px;
  background: var(--border);
  flex: none;
}

/* Bottom Floating Canvas Toolbar */
.em-float {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  z-index: 45;
}

.em-float-popover {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 150px;
  z-index: 60;
}

.seat-editor-fullscreen .em-float-popover button {
  height: 30px;
  min-height: 30px;
  padding: 0 10px;
  margin: 0;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text);
  font: 500 12px var(--font);
  text-align: left;
  justify-content: flex-start;
  cursor: pointer;
}

.seat-editor-fullscreen .em-float-popover button:hover {
  background: var(--bg-hover);
}

/* Top-Left Hint & Empty State */
.em-hint {
  position: absolute;
  top: 14px;
  left: 16px;
  color: var(--text-muted);
  font-size: 12px;
  pointer-events: none;
  z-index: 35;
}

.em-empty-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 23, 29, 0.92);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-soft);
  font-size: 13px;
  z-index: 32;
  text-align: center;
}

/* Canvas Viewport inside Edit Map */
.em-stage .cv.edit-active {
  background: var(--bg-canvas);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  outline: none;
  box-shadow: none;
  width: min(92%, 960px);
  max-height: calc(100vh - 110px);
}

.em-stage.tool-pan .cv.edit-active,
.em-stage.space-pan .cv.edit-active {
  cursor: grab;
}

.em-stage.is-panning .cv.edit-active {
  cursor: grabbing;
}

.em-stage.tool-table .cv.edit-active,
.em-stage.tool-measure .cv.edit-active,
.em-stage.tool-text .cv.edit-active {
  cursor: crosshair;
}

/* Canva-style Edit Map Selection Frame, Corner & Edge Handles, Rotation Handle & Floating Badge */
.em-sel-box {
  position: absolute;
  inset: -6px;
  border: 1.5px solid var(--accent, #8b5cf6);
  border-radius: 4px;
  pointer-events: none;
  z-index: 40;
  box-sizing: border-box;
}

.em-sel-box.is-circle {
  border-radius: 8px;
}

.em-sel-box.is-locked-box {
  border: 1.5px dashed var(--text-muted, #71717a);
}

/* Corner Handles: Canva Circular White Nodes with Accent Ring */
.em-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--accent, #8b5cf6);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  z-index: 45;
  box-sizing: border-box;
  transition: transform 0.12s ease, background-color 0.12s ease;
  touch-action: none;
}

.em-corner::after {
  content: '';
  position: absolute;
  inset: -8px;
}

.em-corner:hover {
  transform: scale(1.25);
  background: #f5f3ff;
}

.em-corner.nw { top: -6px; left: -6px; cursor: nwse-resize; }
.em-corner.ne { top: -6px; right: -6px; cursor: nesw-resize; }
.em-corner.sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.em-corner.se { bottom: -6px; right: -6px; cursor: nwse-resize; }

/* Edge Handles: Canva Signature Pill Bars in Edge Centers */
.em-edge-handle {
  position: absolute;
  background: #ffffff;
  border: 2px solid var(--accent, #8b5cf6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  z-index: 45;
  box-sizing: border-box;
  transition: transform 0.12s ease, background-color 0.12s ease;
  touch-action: none;
}

.em-edge-handle::after {
  content: '';
  position: absolute;
  inset: -7px;
}

.em-edge-handle.n,
.em-edge-handle.s {
  width: 18px;
  height: 6px;
  border-radius: 3px;
  left: 50%;
  transform: translateX(-50%);
  cursor: ns-resize;
}
.em-edge-handle.n { top: -3px; }
.em-edge-handle.s { bottom: -3px; }

.em-edge-handle.n:hover,
.em-edge-handle.s:hover {
  transform: translateX(-50%) scale(1.25);
  background: #f5f3ff;
}

.em-edge-handle.w,
.em-edge-handle.e {
  width: 6px;
  height: 18px;
  border-radius: 3px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}
.em-edge-handle.w { left: -3px; }
.em-edge-handle.e { right: -3px; }

.em-edge-handle.w:hover,
.em-edge-handle.e:hover {
  transform: translateY(-50%) scale(1.25);
  background: #f5f3ff;
}

/* Canva Live Dimension Tooltip Badge */
.em-dim-badge {
  position: absolute;
  bottom: -66px;
  left: 50%;
  transform: translateX(-50%);
  background: #14171f;
  color: #cdbcff;
  border: 1px solid rgba(139, 92, 246, 0.45);
  border-radius: 4px;
  padding: 2px 7px;
  font-family: var(--font, 'Inter Tight', sans-serif);
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 46;
}

/* Preset quick-select chips in Inspector */
.em-preset-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.em-preset-lbl {
  font-size: 11px;
  color: var(--text-muted, #71717a);
}

.em-chip-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted, #a1a1aa);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-variant-numeric: tabular-nums;
}

.em-chip-btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--accent, #8b5cf6);
  color: #ffffff;
}

.em-chip-btn.active {
  background: var(--accent, #8b5cf6);
  border-color: var(--accent, #8b5cf6);
  color: #ffffff;
}

.em-rot-stem {
  display: none;
}

/* Canva-style circular quick-rotate handle positioned below bottom-center */
.em-rot-handle {
  position: absolute;
  bottom: -40px;
  left: 50%;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffffff;
  color: #16171b;
  border: 1px solid rgba(0, 0, 0, 0.14);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.45);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  z-index: 44;
  transition: transform 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.em-rot-handle:hover {
  transform: translateX(-50%) scale(1.08);
  background: #f5f3ff;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.45);
}

.em-rot-handle:active {
  cursor: grabbing;
  transform: translateX(-50%) scale(0.96);
  background: var(--accent);
  color: #16171b;
}

.em-rot-handle svg {
  width: 15px;
  height: 15px;
  display: block;
  pointer-events: none;
}

.em-float-tag {
  position: absolute;
  top: -54px;
  left: 50%;
  transform: translateX(-50%);
  height: 18px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--accent-on);
  font: 600 10px var(--font);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  z-index: 43;
}

.element-node.is-overlapping .em-table-shape {
  stroke: var(--danger) !important;
  stroke-width: 2px !important;
}

.element-node.is-locked {
  cursor: default;
}

/* Venue & Custom Area Visual Blocks on Edit Map Canvas — free-form resizable */
.em-venue-box {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  padding: 4px 8px;
  word-break: break-word;
  line-height: 1.2;
}

.em-venue-stage {
  background: var(--accent-subtle);
  border: 1.5px solid var(--accent);
  color: var(--accent-text);
  border-radius: 3px;
  font: 600 12px var(--font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.em-venue-buffet {
  background: #1f2a24;
  border: 1.5px solid #4f8f6c;
  color: #8fd1ad;
  border-radius: 3px;
  font: 600 11px var(--font);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.em-venue-entrance {
  background: rgba(240, 179, 90, 0.14);
  border: 1.5px solid rgba(240, 179, 90, 0.55);
  border-left: 4px solid var(--warning);
  color: var(--warning);
  border-radius: 3px;
  font: 600 11px var(--font);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.em-venue-exit {
  background: rgba(127, 214, 160, 0.14);
  border: 1.5px solid rgba(127, 214, 160, 0.55);
  border-right: 4px solid var(--success);
  color: var(--success);
  border-radius: 3px;
  font: 600 11px var(--font);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.em-venue-other,
.em-venue-custom {
  background: rgba(168, 85, 247, 0.14);
  border: 1.5px solid rgba(208, 192, 238, 0.65);
  color: #eff1f5;
  border-radius: 6px;
  font: 600 11px var(--font);
  letter-spacing: 0.04em;
}
  padding: 5px 10px;
  font: 600 11px var(--font);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.em-venue-text {
  background: transparent;
  border: 1px dashed transparent;
  color: var(--text);
  padding: 4px 8px;
  font: 500 13px var(--font);
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1280px) {
  .em-stage.seat-editor-canvas-area {
    min-width: 320px;
  }
}

@media (max-width: 900px) {
  .em-lib {
    width: 210px;
    padding: 12px;
  }
  .em-insp.seat-editor-toolbar {
    width: 250px;
    padding: 12px;
  }
}

@media (max-width: 768px) {
  .em-main.seat-editor-body {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .em-stage.seat-editor-canvas-area {
    min-width: 0 !important;
    width: 100% !important;
    height: 52vh;
    min-height: 280px;
    flex: none;
  }

  .em-rail {
    width: 100%;
    height: 48px;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    align-items: center;
    justify-content: flex-start;
  }

  .em-lib {
    width: 100% !important;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 12px;
    flex: none;
  }

  .em-insp.seat-editor-toolbar {
    width: 100% !important;
    border-left: none;
    border-top: 1px solid var(--border);
    padding: 12px;
    flex: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .seat-editor-fullscreen *,
  .seat-editor-fullscreen *::before,
  .seat-editor-fullscreen *::after {
    transition: none !important;
    animation: none !important;
  }
}




/* ---- Quiet line icons + floor plan sidebar (hairlines, tokens only) ---- */
.ic { flex-shrink: 0; display: block; }
.ic-row { display: inline-flex; align-items: center; gap: 8px; }
.seat-toolbar button, .seat-editor-topbar button, .seat-palette-grid button, .seat-side-link { display: inline-flex; align-items: center; justify-content: center; }

.seat-side-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; }
.seat-side-link { margin: 0; padding: 4px 0; background: none; border: none; color: var(--mu); font-size: 12px; cursor: pointer; transition: color 150ms ease; }
.seat-side-link:hover { color: var(--tx); }
.seat-side-sep { height: 1px; background: var(--ln); margin: 12px 0; }
.seat-scan-btn { width: 100%; margin: 12px 0 0; padding: 10px; border-radius: 8px; justify-content: center; font-weight: 500; }
.seat-stats { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.seat-stats > div { display: flex; justify-content: space-between; align-items: baseline; }
.seat-stats dt { color: var(--mu); }
.seat-stats dd { margin: 0; color: var(--tx); font-size: 14px; }

/* Blueprint Opacity Range Slider (reset base.css input padding/border so thumb aligns 0%..100%) */
input[type="range"].em-opacity-slider,
aside input[type="range"].em-opacity-slider,
.seat-editor-fullscreen input[type="range"].em-opacity-slider {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 24px;
  padding: 0;
  margin: 4px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  cursor: pointer;
}

input[type="range"].em-opacity-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(
    to right,
    #b9a4f6 0%,
    #b9a4f6 var(--pct, 100%),
    rgba(128, 128, 128, 0.28) var(--pct, 100%),
    rgba(128, 128, 128, 0.28) 100%
  );
}

input[type="range"].em-opacity-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -5px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #b9a4f6;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: transform 0.12s ease;
}

input[type="range"].em-opacity-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

input[type="range"].em-opacity-slider::-moz-range-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  border: none;
  background: rgba(128, 128, 128, 0.28);
}

input[type="range"].em-opacity-slider::-moz-range-progress {
  height: 6px;
  border-radius: 999px;
  background: #b9a4f6;
}

input[type="range"].em-opacity-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #b9a4f6;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

@media (max-width: 820px) {
  input[type="range"].em-opacity-slider,
  aside input[type="range"].em-opacity-slider,
  .seat-editor-fullscreen input[type="range"].em-opacity-slider {
    min-height: 44px;
    height: 44px;
  }
}
