/* ============================================
   SEATING CHART GENERATOR
   Markup: includes/seatingChartGeneratorContent.php · Behaviour: include/seating.js
   Same studio layout as the photo booth (include/digibooth.css): plan on the left, panel on the right.
   Table/seat drawing styles live in seating.js (SVG_CSS) so the PNG export looks identical.
   ============================================ */

.seat {
  --s-ink: #16131c;
  --s-muted: #6b7280;
  --s-line: #e5e7eb;
  --s-brand: #a21ce6;
  --s-brand-ink: #7d12b3;
  --s-brand-soft: rgba(162, 28, 230, 0.08);
  --s-floor: #faf8fc;
  --s-danger: #dc2626;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 40px;
  align-items: start;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 56px;
  color: var(--s-ink);
}

.seat [hidden] {
  display: none !important;
}

.seat svg[viewBox="0 0 24 24"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.seat button,
.seat input,
.seat select {
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.seat button:focus-visible,
.seat input:focus-visible,
.seat select:focus-visible {
  outline: 2px solid var(--s-brand);
  outline-offset: 2px;
}

/* Text fields draw their own focus ring */
.seat .seat__input:focus-visible,
.seat .seat-guest__name:focus-visible,
.seat .seat-ctx__name:focus-visible,
.seat .seat-stepper input:focus-visible {
  outline: none;
}

/* Mini table drawings (shape pickers, empty state) */
.seat-art .a-body {
  fill: #fff;
  stroke: #b9b2c6;
  stroke-width: 1.5;
}

.seat-art .a-seat {
  fill: #d9cde6;
}

/* ============================================
   PAGE HEADER (lined up with the tool below)
   ============================================ */
.seat-head {
  max-width: 1280px;
  margin: 0 auto;
  padding: 128px 24px 28px;
  color: #16131c;
}

.seat-head__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px 12px 5px 6px;
  border: 1px solid rgba(162, 28, 230, 0.16);
  border-radius: 999px;
  background: rgba(162, 28, 230, 0.06);
  color: #6b7280;
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
}

.seat-head__brand b {
  color: #7d12b3;
  font-weight: 600;
}

.seat-head__brand svg {
  width: 26px;
  height: 20px;
}

.seat-head__brand .a-body {
  stroke: #a21ce6;
}

.seat-head__brand .a-seat {
  fill: #a21ce6;
  opacity: 0.55;
}

.seat-head__title {
  max-width: 22ch;
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 2.875rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: #16131c;
  text-wrap: balance;
}

.seat-head__text {
  max-width: 60ch;
  margin: 12px 0 0;
  font-size: 1.0625rem;
  line-height: 1.55;
  color: #6b7280;
  text-wrap: pretty;
}

/* ============================================
   STAGE (the floor plan)
   ============================================ */
.seat__stage {
  position: sticky;
  top: 88px;
  height: calc(100vh - 112px);
  min-height: 560px;
  max-height: 900px;
  border: 1px solid var(--s-line);
  border-radius: 24px;
  background: var(--s-floor);
  overflow: hidden;
  scroll-margin-top: 80px;
}

.seat__svg {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}

.seat.is-panning .seat__svg {
  cursor: grabbing;
}

#seatDot {
  fill: #ddd5e6;
}

/* Interactive states (the drawing itself is in seating.js SVG_CSS) */
.sc-t {
  cursor: grab;
}

.sc-t:hover .sc-body {
  stroke: #a99fb8;
}

.sc-t.is-sel .sc-body {
  stroke: var(--s-brand);
  stroke-width: 2;
}

.sc-t.is-sel .sc-halo {
  display: block;
}

.sc-t.is-drag {
  cursor: grabbing;
}

.sc-t.is-drag .sc-shadow {
  transform: translateY(6px);
  opacity: 1.6;
}

.sc-t.is-target .sc-body {
  stroke: var(--s-brand);
  stroke-width: 2.5;
  fill: #f7effc;
}

.sc-s {
  cursor: pointer;
}

.sc-s:hover .sc-seat {
  stroke: var(--s-brand);
  stroke-dasharray: none;
}

.sc-s:not(.is-taken):hover .sc-seat {
  fill: #f3e6fb;
}

.sc-s.is-taken:hover .sc-seat {
  fill: var(--s-brand-ink);
}

.sc-s.is-open .sc-seat {
  stroke: var(--s-brand);
  stroke-width: 2.5;
  stroke-dasharray: none;
}

.seat.is-placing .sc-s:not(.is-taken) .sc-seat {
  stroke: var(--s-brand);
  stroke-dasharray: none;
  fill: #f3e6fb;
  animation: seat-pulse 1.4s ease-in-out infinite;
}

@keyframes seat-pulse {
  50% { fill: #e6ccf6; }
}

.sc-s.is-target .sc-seat {
  fill: var(--s-brand) !important;
  stroke: var(--s-brand) !important;
  stroke-width: 4 !important;
  stroke-dasharray: none !important;
}

.sc-s.is-flash .sc-seat {
  animation: seat-flash 1.2s ease-out 2;
}

@keyframes seat-flash {
  0%, 100% { stroke-width: 1.5; }
  40% { stroke-width: 9; stroke: rgba(162, 28, 230, 0.35); }
}

.sc-t.is-shake .sc-body {
  animation: seat-shake 0.4s ease;
}

@keyframes seat-shake {
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

/* ---------- Floating bars ---------- */
.seat__bar {
  position: absolute;
  top: 12px;
  z-index: 3;
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--s-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}

.seat__bar--start {
  inset-inline-start: 12px;
}

.seat__bar--end {
  inset-inline-end: 12px;
}

.seat__tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--s-ink);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.seat__tool:hover:not(:disabled) {
  background: #f3f4f6;
}

.seat__tool:disabled {
  color: #c4c7ce;
  cursor: default;
}

.seat__tool--danger:hover:not(:disabled) {
  background: #fef2f2;
  color: var(--s-danger);
}

.seat__zoom {
  min-width: 52px;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.seat__stats {
  position: absolute;
  bottom: 12px;
  inset-inline-start: 12px;
  z-index: 2;
  display: flex;
  gap: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--s-line);
  font-size: 0.8125rem;
  color: var(--s-muted);
  pointer-events: auto;
}

.seat__stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.seat__stats svg[viewBox] {
  width: 16px;
  height: 16px;
}

.seat__stats b {
  color: var(--s-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.seat__stats .is-done b {
  color: #15803d;
}

/* ---------- Empty plan ---------- */
.seat__empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  pointer-events: none;
}

.seat__empty > * {
  pointer-events: auto;
}

.seat__empty-art {
  width: 168px;
  height: 126px;
  opacity: 0.9;
}

.seat__empty .btn svg[viewBox] {
  width: 20px;
  height: 20px;
}

/* ---------- Armed guest (tap a guest, then a seat) ---------- */
.seat__armed {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 260px);
  padding: 4px 4px 4px 4px;
  border-radius: 999px;
  background: var(--s-ink);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  transform: translateX(-50%);
  box-shadow: 0 8px 24px rgba(22, 19, 28, 0.25);
  animation: seat-in 0.2s ease;
}

.seat__armed-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat__armed-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.seat__armed-close svg[viewBox] {
  width: 16px;
  height: 16px;
}

@keyframes seat-in {
  from { opacity: 0; transform: translate(-50%, -6px); }
}

/* ---------- Selected table bar ---------- */
.seat-ctx {
  position: absolute;
  bottom: 12px;
  inset-inline-end: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 24px);
  padding: 6px;
  border: 1px solid var(--s-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 32px -8px rgba(22, 19, 28, 0.22), 0 2px 6px rgba(22, 19, 28, 0.06);
  animation: seat-ctx-in 0.18s ease;
}

@keyframes seat-ctx-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* Narrow plans: the table bar needs the whole bottom edge */
@media (max-width: 1199px) {
  .seat.has-ctx .seat__stats {
    display: none;
  }
}

.seat-ctx__name {
  width: 140px;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--s-line);
  border-radius: 9px;
  background: #fff;
  color: var(--s-ink);
  font-size: 0.875rem;
  font-weight: 600;
}

.seat-ctx__name:focus {
  outline: none;
  border-color: var(--s-brand);
  box-shadow: 0 0 0 3px rgba(162, 28, 230, 0.14);
}

.seat-ctx__sep {
  width: 1px;
  height: 24px;
  background: var(--s-line);
}

.seat-seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: #f3f4f6;
}

.seat-seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.seat-seg button svg {
  width: 30px;
  height: 22px;
}

.seat-seg button[aria-pressed="true"] {
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.1), 0 0 0 1px rgba(16, 24, 40, 0.04);
}

.seat-seg button[aria-pressed="true"] .a-seat,
.seat-shape[aria-pressed="true"] .a-seat {
  fill: rgba(162, 28, 230, 0.45);
}

/* ---------- Stepper ---------- */
.seat-stepper {
  display: inline-flex;
  align-items: center;
  height: 36px;
  border: 1px solid var(--s-line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.seat-stepper button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--s-ink);
  cursor: pointer;
}

.seat-stepper button:hover {
  background: #f3f4f6;
}

.seat-stepper button svg[viewBox] {
  width: 16px;
  height: 16px;
}

.seat-stepper input {
  width: 34px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--s-ink);
  font-size: 0.9375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

.seat-stepper input::-webkit-outer-spin-button,
.seat-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.seat-stepper input:focus {
  outline: none;
  background: var(--s-brand-soft);
}

/* ---------- Seat popover ---------- */
.seat-pop {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 280px;
  max-height: 360px;
  padding: 10px;
  border: 1px solid var(--s-line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 20px 48px -12px rgba(22, 19, 28, 0.3), 0 2px 6px rgba(22, 19, 28, 0.06);
  animation: seat-pop-in 0.16s ease;
}

@keyframes seat-pop-in {
  from { opacity: 0; transform: scale(0.97); }
}

.seat-pop__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-inline-start: 4px;
}

.seat-pop__head .seat__tool {
  min-width: 30px;
  height: 30px;
}

.seat-pop__where {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.seat-pop__where span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-pop__current {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  background: var(--s-brand-soft);
}

.seat-pop__current-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seat-pop__current .seat__chip {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.8125rem;
}

.seat-pop__list {
  flex: 1;
  min-height: 0;
  margin: 0 -4px;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}

.seat-pop__list:empty {
  display: none;
}

.seat-pop__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--s-ink);
  font-size: 0.875rem;
  text-align: start;
  cursor: pointer;
}

.seat-pop__item:hover,
.seat-pop__item:focus-visible {
  background: #f3f4f6;
  outline: none;
}

.seat-pop__item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Toast ---------- */
.seat__toast {
  position: absolute;
  bottom: 72px;
  left: 50%;
  z-index: 7;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--s-ink);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, 8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.seat__toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================
   PANEL
   ============================================ */
.seat__group {
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--s-line);
}

.seat__panel > .seat__group:last-child {
  margin-bottom: 0;
  border-bottom: 0;
}

.seat__label {
  display: block;
  margin: 0 0 12px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--s-ink);
}

.seat__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.seat__label-row .seat__label {
  margin: 0;
}

.seat__sublabel {
  font-size: 0.875rem;
  color: var(--s-muted);
}

.seat__count {
  padding: 3px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--s-muted);
}

.seat__count.is-done {
  background: #dcfce7;
  color: #15803d;
}

.seat__input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--s-line);
  border-radius: 12px;
  background: #fff;
  color: var(--s-ink);
  font: 400 1rem/1.4 var(--font-sans);
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.seat__input::placeholder {
  color: #9ca3af;
}

.seat__input:focus {
  outline: none;
  border-color: var(--s-brand);
  box-shadow: 0 0 0 3px rgba(162, 28, 230, 0.14);
}

/* Input with a square action button inside */
.seat__field {
  position: relative;
  margin: 0;
}

.seat__field .seat__input {
  padding-inline-end: 50px;
}

.seat__field-btn {
  position: absolute;
  top: 5px;
  inset-inline-end: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--s-brand);
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.seat__field-btn:hover {
  background: var(--s-brand-ink);
}

.seat__field-btn svg[viewBox] {
  stroke-width: 2.2;
}

/* ---------- New table ---------- */
.seat__shapes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.seat-shape {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px 9px;
  border: 1px solid var(--s-line);
  border-radius: 12px;
  background: #fff;
  color: var(--s-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.seat-shape:hover {
  border-color: #c9ccd3;
}

.seat-shape svg {
  width: 56px;
  height: 42px;
}

.seat-shape[aria-pressed="true"] {
  border-color: var(--s-brand);
  box-shadow: inset 0 0 0 1px var(--s-brand);
}

.seat__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
}

.seat__wide {
  width: 100%;
}

.seat__panel .btn {
  padding: 12px 20px;
  font-size: 0.9375rem;
}

.seat__panel .btn svg[viewBox] {
  width: 20px;
  height: 20px;
}

/* ---------- Guest list ---------- */
.seat__list {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.seat__list:empty {
  display: none;
}

.seat.is-drop-list .seat__list {
  outline: 2px dashed rgba(162, 28, 230, 0.5);
  outline-offset: 4px;
  border-radius: 10px;
}

.seat-guest {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 4px;
  border-radius: 10px;
  transition: background-color 0.15s ease;
}

.seat-guest + .seat-guest {
  margin-top: 1px;
}

.seat-guest:hover {
  background: #f9fafb;
}

.seat-guest.is-armed {
  background: var(--s-brand-soft);
}

.seat-guest.is-ghosted {
  opacity: 0.4;
}

.seat-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1.5px dashed #c9bdd8;
  border-radius: 50%;
  background: #fff;
  color: #8b7f9c;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

.seat-avatar.is-seated {
  border: 0;
  background: var(--s-brand);
  color: #fff;
}

button.seat-avatar {
  cursor: grab;
  touch-action: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button.seat-avatar:hover {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px rgba(162, 28, 230, 0.16);
}

.seat-guest.is-armed .seat-avatar {
  box-shadow: 0 0 0 3px var(--s-brand);
  border-style: solid;
  border-color: #fff;
}

.seat-guest__name {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--s-ink);
  font-size: 0.9375rem;
  text-overflow: ellipsis;
}

.seat-guest__name:hover {
  border-color: var(--s-line);
}

.seat-guest__name:focus {
  outline: none;
  border-color: var(--s-brand);
  background: #fff;
}

.seat-guest__table {
  max-width: 96px;
  height: 30px;
  padding: 0 22px 0 10px;
  border: 1px solid var(--s-line);
  border-radius: 999px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 6px center / 14px;
  color: var(--s-muted);
  font-size: 0.8125rem;
  font-weight: 600;
  text-overflow: ellipsis;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

[dir="rtl"] .seat-guest__table {
  padding: 0 10px 0 22px;
  background-position: left 6px center;
}

.seat-guest.is-seated .seat-guest__table {
  border-color: rgba(162, 28, 230, 0.35);
  background-color: var(--s-brand-soft);
  color: var(--s-brand-ink);
}

.seat-guest__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.seat-guest:hover .seat-guest__remove,
.seat-guest:focus-within .seat-guest__remove {
  opacity: 1;
}

.seat-guest__remove:hover {
  background: #fef2f2;
  color: var(--s-danger);
}

.seat-guest__remove svg[viewBox] {
  width: 16px;
  height: 16px;
}

@media (hover: none) {
  .seat-guest__remove {
    opacity: 1;
  }
}

/* Floating chip that follows the pointer while a guest is dragged */
.seat-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  padding: 4px 12px 4px 4px;
  border-radius: 999px;
  background: var(--s-ink, #16131c);
  color: #fff;
  font: 600 0.875rem/1.2 var(--font-sans);
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(22, 19, 28, 0.3);
  pointer-events: none;
  will-change: transform;
}

.seat-ghost span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat-ghost .seat-avatar {
  width: 28px;
  height: 28px;
  border: 0;
  background: #a21ce6;
  color: #fff;
}

body.seat-dragging,
body.seat-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
  -webkit-user-select: none !important;
}

/* ---------- Export + chips ---------- */
.seat__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.seat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seat__chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--s-line);
  border-radius: 999px;
  background: #fff;
  color: var(--s-ink);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.seat__chip svg[viewBox] {
  width: 18px;
  height: 18px;
}

.seat__chip:hover {
  border-color: #c9ccd3;
}

.seat.is-exporting [data-export] {
  cursor: progress;
  opacity: 0.7;
}

/* ============================================
   CTA (below the tool)
   ============================================ */
.seat-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  max-width: 1232px;
  width: calc(100% - 48px);
  margin: 0 auto 72px;
  padding: 28px 0;
  border-top: 1px solid var(--color-border, #e5e7eb);
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}

.seat-cta p {
  margin: 0;
}

.seat-cta__title {
  flex-basis: 100%;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--color-text, #1a1a1a);
}

.seat-cta__text {
  flex: 1 1 380px;
  max-width: 60ch;
  margin-top: -8px !important;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--color-text-muted, #6b7280);
}

.seat-cta__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================
   FULL SCREEN (plan + panel together)
   ============================================ */
.seat:fullscreen {
  max-width: none;
  margin: 0;
  padding: 16px;
  gap: 20px;
  height: 100vh;
  background: #fff;
  overflow-y: auto;
}

.seat:fullscreen .seat__stage {
  top: 0;
  height: calc(100vh - 32px);
  max-height: none;
}

.seat:-webkit-full-screen {
  max-width: none;
  margin: 0;
  padding: 16px;
  gap: 20px;
  height: 100vh;
  background: #fff;
  overflow-y: auto;
}

.seat:-webkit-full-screen .seat__stage {
  top: 0;
  height: calc(100vh - 32px);
  max-height: none;
}

/* ============================================
   PRINT (Print button prints only the plan sheet)
   ============================================ */
#seatPrintSheet {
  display: none;
}

@media print {
  @page { margin: 12mm; }

  body.seat-printing > *:not(#seatPrintSheet) {
    display: none !important;
  }

  body.seat-printing {
    padding: 0 !important;
    background: #fff !important;
  }

  body.seat-printing #seatPrintSheet {
    display: block;
    color: #16131c;
    font-family: var(--font-sans);
  }
}

.sp-title {
  margin: 0 0 6mm;
  font-size: 22pt;
  font-weight: 800;
  text-align: center;
}

.sp-floor svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 235mm;
}

.sp-floor {
  break-after: page;
}

.sp-cards {
  columns: 3;
  column-gap: 6mm;
}

.sp-card {
  margin: 0 0 6mm;
  padding: 3mm 4mm;
  border: 0.3mm solid #d8d2e2;
  border-radius: 3mm;
  break-inside: avoid;
}

.sp-card h3 {
  display: flex;
  align-items: center;
  gap: 2.5mm;
  margin: 0 0 2mm;
  padding-bottom: 2mm;
  border-bottom: 0.3mm solid #e5e7eb;
  font-size: 11pt;
}

.sp-card h3 i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.5mm;
  height: 6.5mm;
  padding: 0 1.5mm;
  border-radius: 999px;
  background: #a21ce6;
  color: #fff;
  font-style: normal;
  font-size: 9pt;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.sp-card h3 small {
  margin-inline-start: auto;
  color: #6b7280;
  font-weight: 600;
}

.sp-card ol,
.sp-guests {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 10pt;
  line-height: 1.55;
}

.sp-card li b {
  display: inline-block;
  min-width: 5mm;
  color: #9ca3af;
  font-weight: 600;
}

.sp-list-title {
  margin: 8mm 0 3mm;
  font-size: 14pt;
  font-weight: 800;
  break-before: page;
}

.sp-guests {
  columns: 3;
  column-gap: 8mm;
}

.sp-guests li {
  display: flex;
  justify-content: space-between;
  gap: 3mm;
  border-bottom: 0.2mm dotted #d1d5db;
  break-inside: avoid;
}

.sp-guests li span:last-child {
  font-weight: 700;
  white-space: nowrap;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 959px) {
  .seat-head {
    padding: 112px 16px 20px;
  }

  .seat-head__brand {
    margin-bottom: 14px;
  }

  .seat-head__text {
    margin-top: 8px;
    font-size: 1rem;
  }

  .seat {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    margin-top: 0;
    padding: 0 16px 40px;
  }

  .seat__stage {
    position: relative;
    top: 0;
    height: 64vh;
    height: 64svh;
    min-height: 440px;
    border-radius: 20px;
  }

  .seat__bar {
    top: 8px;
  }

  .seat__bar--start {
    inset-inline-start: 8px;
  }

  .seat__bar--end {
    inset-inline-end: 8px;
  }

  .seat__stats {
    bottom: 8px;
    inset-inline-start: 8px;
  }

  .seat__armed {
    top: 60px;
    max-width: calc(100% - 24px);
  }

  /* Selected table bar and seat popover become bottom sheets */
  .seat-ctx {
    left: 8px;
    right: 8px;
    bottom: 8px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: none;
  }

  .seat-ctx__name {
    flex: 1 1 100%;
    width: auto;
  }

  .seat-ctx__sep {
    display: none;
  }

  .seat-pop {
    left: 8px !important;
    right: 8px;
    top: auto !important;
    bottom: 8px;
    width: auto;
    max-height: 70%;
  }

  .seat__toast {
    bottom: 56px;
  }

  .seat-cta {
    width: calc(100% - 32px);
    margin-bottom: 48px;
  }

  .seat-cta__actions,
  .seat-cta__actions .btn {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .seat__stats {
    gap: 10px;
    padding: 6px 10px;
  }

  .seat__zoom {
    display: none;
  }

  .seat-guest__table {
    max-width: 76px;
  }

  .seat-ctx {
    gap: 4px;
  }

  .seat-ctx .seat__tool {
    min-width: 34px;
  }

  .seat-seg button {
    width: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .seat *,
  .seat *::before {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition: none !important;
  }
}
