:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-soft: #f3ede4;
  --border: #e6ddd0;
  --text: #2c2419;
  --text-muted: #7a6f62;
  --accent: #b8860b;
  --accent-soft: #f5ecd6;
  --accent-dark: #8b6914;
  --danger: #c45c5c;
  --danger-soft: #fceaea;
  --hall-bg: #ebe4d8;
  --hall-stage: #d4c4a8;
  --table: #fffdf8;
  --table-border: #c9b896;
  --seat: #f8f3ea;
  --shadow: 0 8px 32px rgba(44, 36, 25, 0.08);
  --radius: 14px;
  --font: "Manrope", system-ui, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, serif;
  --app-height: 100dvh;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --header-h: 90px;
  --tabs-h: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  height: var(--app-height);
  overflow: hidden;
}

body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(184, 134, 11, 0.08), transparent 40%),
    var(--bg);
  padding-top: var(--safe-top);
}

.app {
  height: var(--app-height);
  max-height: var(--app-height);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mobile-tabs {
  display: none;
}

.setup-toggle {
  display: none;
}

.setup-title {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.btn--block {
  width: 100%;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 1.25rem;
}

.header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.1;
}

.header__subtitle {
  margin: 0.15rem 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.header__stats {
  display: flex;
  gap: 1.5rem;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-left: auto;
}

.header__auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header__auth-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-form {
  display: grid;
  gap: 0.875rem;
}

.auth-error {
  margin: 0;
  font-size: 0.85rem;
  color: var(--danger);
}

.auth-switch {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.auth-switch__btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: var(--accent-dark);
  cursor: pointer;
  text-decoration: underline;
}

.stat {
  text-align: center;
}

.stat__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-dark);
}

.stat__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(320px, 420px) 1fr;
  gap: 0;
  min-height: 0;
  align-items: start;
}

.panel {
  padding: 1.5rem;
}

.panel--editor {
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  overflow: hidden;
  height: calc(var(--app-height) - var(--header-h) - var(--tabs-h));
  max-height: calc(var(--app-height) - var(--header-h) - var(--tabs-h));
}

.panel--hall {
  display: flex;
  flex-direction: column;
  height: calc(var(--app-height) - var(--header-h) - var(--tabs-h));
  min-height: calc(var(--app-height) - var(--header-h) - var(--tabs-h));
  overflow: hidden;
}

.panel__section {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.panel__section--grow {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.panel__section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel__section h2,
.panel__section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.panel__hint {
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.setup-form {
  display: grid;
  gap: 0.875rem;
}

.field {
  display: grid;
  gap: 0.35rem;
  font-size: 0.875rem;
}

.field span {
  color: var(--text-muted);
  font-weight: 500;
}

.field--inline {
  grid-template-columns: auto 72px;
  align-items: center;
  justify-content: start;
  margin-bottom: 0.75rem;
}

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.15);
}

.btn {
  border: none;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s, background 0.15s, color 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  padding: 0.75rem 1rem;
  background: var(--accent);
  color: #fff;
}

.btn--primary:hover {
  background: var(--accent-dark);
}

.btn--ghost {
  padding: 0.45rem 0.75rem;
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--border);
}

.btn--ghost:hover {
  background: var(--accent-soft);
}

.btn--sm {
  font-size: 0.8125rem;
}

.btn--icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  line-height: 1;
}

.btn--danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn--danger:hover {
  background: #f8d4d4;
}

.tables-list {
  flex: 1;
  overflow-y: auto;
  display: grid;
  gap: 0.875rem;
  padding-right: 0.25rem;
}

.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.table-card__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.table-card--collapsed .table-card__header {
  margin-bottom: 0;
}

.table-card__toggle {
  flex-shrink: 0;
  color: var(--text-muted);
}

.table-card__toggle-icon {
  display: block;
  font-size: 0.9rem;
  line-height: 1;
  transition: transform 0.2s;
}

.table-card--collapsed .table-card__toggle-icon {
  transform: rotate(-90deg);
}

.table-card__name {
  flex: 1;
  min-width: 0;
  font-weight: 600;
}

.table-card__summary {
  display: none;
  flex-shrink: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.table-card--collapsed .table-card__summary {
  display: block;
}

.table-card--collapsed .table-card__body {
  display: none;
}

.table-card__guests {
  display: grid;
  gap: 0.5rem;
}

.guest-field {
  display: grid;
  grid-template-columns: 24px 28px 1fr;
  align-items: center;
  gap: 0.35rem;
  border-radius: 8px;
  transition: background 0.15s, box-shadow 0.15s;
}

.guest-field__drag {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.72rem;
  line-height: 1;
  letter-spacing: -0.08em;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.guest-field__drag:active {
  cursor: grabbing;
}

.guest-field--dragging {
  opacity: 0.55;
}

.guest-field--drop-target {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 2px rgba(184, 134, 11, 0.35);
}

.modal__guests-hint {
  font-weight: 500;
  font-size: 0.78rem;
}

.modal__guests-hint--mobile {
  display: none;
}

.modal__nudge {
  display: none;
  gap: 0.5rem;
}

.modal__nudge-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.nudge-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 44px);
  gap: 0.35rem;
  max-width: 168px;
}

.nudge-pad__btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  touch-action: manipulation;
}

.nudge-pad__btn--up { grid-column: 2; grid-row: 1; }
.nudge-pad__btn--left { grid-column: 1; grid-row: 2; }
.nudge-pad__btn--center { grid-column: 2; grid-row: 2; font-size: 0.85rem; }
.nudge-pad__btn--right { grid-column: 3; grid-row: 2; }
.nudge-pad__btn--down { grid-column: 2; grid-row: 3; }

.nudge-pad__btn:active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.guest-field__actions {
  display: none;
  flex-direction: column;
  gap: 0.2rem;
}

.guest-field__swap {
  width: 32px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.guest-field__swap:disabled {
  opacity: 0.35;
  cursor: default;
}

.guest-field__swap:not(:disabled):active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
}

.guest-field__num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.empty-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem 1rem;
}

.empty-hint--hall {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
  max-width: 280px;
  pointer-events: none;
}

.hall {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.hall-toolbar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}

.hall-toolbar__layout {
  display: none;
}

.hall-toolbar__zoom,
.hall-toolbar__size,
.hall-toolbar__group {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.hall-toolbar__label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-right: 0.1rem;
}

.hall__canvas {
  position: relative;
  flex-shrink: 0;
}

.hall__viewport {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  overscroll-behavior: contain;
}

.hall-toolbar__zoom-value {
  min-width: 2.75rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.hall-toolbar__zoom-btn {
  width: 32px;
  height: 32px;
  min-height: 32px;
  font-size: 1.1rem;
  touch-action: manipulation;
}

.hall__quick-list {
  display: none;
  gap: 0.45rem;
  padding: 0.55rem 0 0;
  overflow-x: auto;
  flex-shrink: 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.hall__quick-list::-webkit-scrollbar {
  display: none;
}

.hall-quick-chip {
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.hall-quick-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.hall__stage {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  pointer-events: none;
  margin: 0;
  padding: 1rem 2rem;
  text-align: center;
  background: linear-gradient(180deg, var(--hall-stage), #c9b896);
  border: 2px solid #b8a078;
  border-radius: 12px 12px 4px 4px;
  color: #4a3f2f;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow: inset 0 2px 8px rgba(255, 255, 255, 0.35);
}

.hall__floor {
  position: absolute;
  top: 0;
  left: 0;
  min-height: 520px;
  padding: 0.75rem;
  transform-origin: 0 0;
  --table-scale: 1;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 39px,
      rgba(180, 160, 130, 0.12) 39px,
      rgba(180, 160, 130, 0.12) 40px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 39px,
      rgba(180, 160, 130, 0.12) 39px,
      rgba(180, 160, 130, 0.12) 40px
    ),
    var(--hall-bg);
  border: 2px solid var(--border);
  border-radius: 8px;
}

.hall__floor-size {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  z-index: 12;
  margin: 0;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--border);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  pointer-events: none;
  user-select: none;
}

.hall__resize-handle {
  position: absolute;
  z-index: 15;
  touch-action: none;
  background: var(--accent-soft);
  border: 2px solid var(--accent);
  box-shadow: 0 2px 8px rgba(44, 36, 25, 0.12);
}

.hall__resize-handle--corner {
  right: -1px;
  bottom: -1px;
  width: 20px;
  height: 20px;
  border-radius: 6px 0 8px 0;
  cursor: nwse-resize;
}

.hall__resize-handle--east {
  top: 50%;
  right: -1px;
  width: 12px;
  height: 44px;
  margin-top: -22px;
  border-radius: 6px 0 0 6px;
  cursor: ew-resize;
}

.hall__resize-handle--south {
  left: 50%;
  bottom: -1px;
  width: 44px;
  height: 12px;
  margin-left: -22px;
  border-radius: 0 0 6px 6px;
  cursor: ns-resize;
}

.hall:not(.hall--layout-mode) .hall__resize-handle {
  display: none;
}

@media (min-width: 961px) {
  .hall:not(.hall--layout-mode) .hall__resize-handle {
    display: block;
  }
}

.hall.hall--resizing-floor {
  cursor: inherit;
}

.hall.hall--resizing-floor .hall-table {
  pointer-events: none;
}

.hall-table {
  position: absolute;
  width: calc(200px * var(--table-scale));
  height: calc(200px * var(--table-scale));
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
  user-select: none;
  z-index: 2;
  transition: filter 0.15s, z-index 0s, width 0.15s, height 0.15s;
}

.hall-table--dragging {
  cursor: grabbing;
  z-index: 100;
  filter: drop-shadow(0 12px 24px rgba(44, 36, 25, 0.22));
  transition: filter 0.15s;
}

.hall-table__surface {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(96px * var(--table-scale));
  height: calc(96px * var(--table-scale));
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--table));
  border: 3px solid var(--table-border);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.5rem;
  z-index: 1;
  pointer-events: none;
}

.hall-table__label {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text);
}

.hall-table__count {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font);
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hall-seat {
  position: absolute;
  width: 72px;
  transform: translate(-50%, -50%);
  text-align: center;
}

.hall-seat__chair {
  width: calc(28px * var(--table-scale));
  height: calc(28px * var(--table-scale));
  margin: 0 auto 0.2rem;
  border-radius: 8px 8px 4px 4px;
  background: var(--seat);
  border: 1px solid var(--table-border);
  box-shadow: 0 2px 4px rgba(44, 36, 25, 0.1);
}

.hall-seat__name {
  display: block;
  font-size: calc(0.68rem * var(--table-scale));
  line-height: 1.2;
  color: var(--text);
  word-break: break-word;
  max-width: calc(72px * var(--table-scale));
}

.hall-seat--empty .hall-seat__name {
  color: var(--text-muted);
  font-style: italic;
}

.hall-table--selected .hall-table__surface {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(184, 134, 11, 0.25), var(--shadow);
}

.hall-table--selected {
  z-index: 5;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(44, 36, 25, 0.45);
  backdrop-filter: blur(2px);
}

.modal__dialog {
  position: relative;
  width: min(420px, 100%);
  max-height: min(90vh, 640px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(44, 36, 25, 0.2);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.modal__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.modal__close {
  flex-shrink: 0;
}

.modal__body {
  padding: 1.25rem;
  overflow-y: auto;
  display: grid;
  gap: 0.875rem;
}

.modal__guests-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
}

.modal__guests {
  display: grid;
  gap: 0.5rem;
}

.modal__footer {
  padding: 0.75rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.table-card--active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.2);
}

/* Telegram Mini App theme overrides */
body.is-telegram {
  --bg: var(--tg-bg, #faf7f2);
  --surface: var(--tg-surface, #ffffff);
  --text: var(--tg-text, #2c2419);
  --text-muted: var(--tg-hint, #7a6f62);
  --accent: var(--tg-button, #b8860b);
  --accent-dark: var(--tg-link, #8b6914);
  background: var(--bg);
}

body.is-telegram .header {
  background: color-mix(in srgb, var(--surface) 88%, transparent);
}

body.is-telegram .btn--primary {
  background: var(--tg-button, var(--accent));
  color: var(--tg-button-text, #fff);
}

@media (max-width: 960px) {
  :root {
    --header-h: 72px;
    --tabs-h: calc(56px + var(--safe-bottom));
  }

  html, body {
    overflow: hidden;
  }

  .header {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .header__brand {
    gap: 0.65rem;
    min-width: 0;
  }

  .header__icon {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    flex-shrink: 0;
  }

  .header h1 {
    font-size: 1.2rem;
  }

  .header__subtitle {
    font-size: 0.72rem;
  }

  .header__stats {
    gap: 0.75rem;
    margin-left: 0;
  }

  .header__actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .header__auth-label {
    max-width: 88px;
    font-size: 0.68rem;
  }

  .header__auth .btn--sm {
    min-height: 34px;
    padding: 0.35rem 0.55rem;
    font-size: 0.72rem;
  }

  .stat__value {
    font-size: 1.15rem;
  }

  .stat__label {
    font-size: 0.62rem;
  }

  .mobile-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem calc(0.4rem + var(--safe-bottom));
    border-top: 1px solid var(--border);
    background: var(--surface);
    order: 3;
    flex-shrink: 0;
    z-index: 20;
  }

  .mobile-tabs__btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 44px;
    padding: 0.35rem 0.5rem;
    border: none;
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
  }

  .mobile-tabs__btn.is-active {
    background: var(--accent-soft);
    color: var(--accent-dark);
  }

  .mobile-tabs__icon {
    font-size: 1rem;
    line-height: 1;
  }

  .layout {
    grid-template-columns: 1fr;
    flex: 1;
    min-height: 0;
    order: 2;
  }

  .panel {
    padding: 0.85rem;
  }

  .panel--editor,
  .panel--hall {
    border-right: none;
    border-bottom: none;
    height: calc(var(--app-height) - var(--header-h) - var(--tabs-h));
    max-height: calc(var(--app-height) - var(--header-h) - var(--tabs-h));
    min-height: 0;
  }

  .layout[data-mobile-tab="editor"] .panel--hall,
  .layout[data-mobile-tab="hall"] .panel--editor {
    display: none;
  }

  .panel__section {
    padding: 0.9rem;
  }

  .panel__section--setup {
    padding: 0;
    overflow: hidden;
  }

  .setup-toggle {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
    border: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
  }

  .setup-toggle__chevron {
    color: var(--text-muted);
    transition: transform 0.2s;
  }

  .setup-toggle[aria-expanded="true"] .setup-toggle__chevron {
    transform: rotate(180deg);
  }

  .panel__section--setup:not(.is-open) .setup-form {
    display: none;
  }

  .panel__section--setup .setup-form {
    padding: 0 0.9rem 0.9rem;
  }

  .panel__section--setup h2,
  .setup-title {
    display: none;
  }

  .panel__section-head {
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
  }

  .panel--hall .panel__section-head > div:first-child {
    flex: 1;
    min-width: 0;
  }

  .hall-toolbar {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .hall-toolbar__label {
    font-size: 0.58rem;
  }

  .hall-toolbar__zoom {
    display: inline-flex;
  }

  .hall-toolbar__size {
    display: inline-flex;
  }

  .hall-toolbar__layout {
    display: inline-flex;
  }

  .hall-toolbar__layout[aria-pressed="true"] {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-dark);
  }

  .hall__quick-list {
    display: flex;
  }

  .hall:not(.hall--layout-mode) .hall-seat {
    display: none;
  }

  .hall:not(.hall--layout-mode) .hall-table {
    cursor: pointer;
    touch-action: manipulation;
  }

  .hall.hall--layout-mode .hall-table {
    cursor: grab;
    touch-action: none;
  }

  .hall-table {
    width: calc(112px * var(--table-scale));
    height: calc(112px * var(--table-scale));
    transform: translate(-50%, -50%);
  }

  .hall-table--dragging {
    transform: translate(-50%, -50%);
  }

  .hall-table__surface {
    width: calc(76px * var(--table-scale));
    height: calc(76px * var(--table-scale));
    pointer-events: auto;
  }

  .hall-table__label {
    font-size: 0.82rem;
  }

  .hall-table__count {
    font-size: 0.62rem;
  }

  .hall.hall--layout-mode .hall-table {
    width: calc(168px * var(--table-scale));
    height: calc(168px * var(--table-scale));
  }

  .hall.hall--layout-mode .hall-table__surface {
    width: calc(88px * var(--table-scale));
    height: calc(88px * var(--table-scale));
  }

  .hall.hall--layout-mode .hall-seat {
    display: block;
  }

  .hall.hall--layout-mode .hall-seat__name {
    font-size: 0.58rem;
    max-width: 56px;
  }

  .hall.hall--layout-mode .hall-seat {
    width: 56px;
  }

  .panel__hint {
    display: none;
  }

  #hall-hint {
    display: block;
    font-size: 0.72rem;
  }

  .btn {
    min-height: 44px;
  }

  .btn--sm {
    min-height: 36px;
  }

  .btn--icon {
    width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .hall__stage {
    padding: 0.65rem 1rem;
    font-size: 0.95rem;
  }

  .modal {
    align-items: flex-end;
    padding: 0;
  }

  .modal__dialog {
    width: 100%;
    max-height: min(92vh, var(--app-height));
    border-radius: 18px 18px 0 0;
    padding-bottom: var(--safe-bottom);
  }

  .modal__footer {
    justify-content: stretch;
  }
}

@media (max-width: 420px) {
  .header__subtitle {
    display: none;
  }

  .table-card__name {
    font-size: 0.9rem;
  }
}
