:root {
  --ink: #292730;
  --muted: #64616b;
  --line: #dddce1;
  --accent: #752f44;
  --accent-light: #f6e9ee;
  --paper: #fff;
  --canvas: #f0f1f4;
  --green: #246052;
  --danger: #a22e25;
  font-family: 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
  font-size: 16px;
  background: #fafafb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
button {
  border: 1px solid #96929c;
  background: white;
  border-radius: 6px;
  min-height: 38px;
  padding: 7px 12px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
}
button:hover {
  background: #f0edf1;
}
button:disabled {
  opacity: 0.42;
  cursor: default;
}
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
button.primary:hover {
  background: #5c2335;
}
button.danger {
  color: var(--danger);
}
input,
select,
textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #96929c;
  border-radius: 5px;
  background: white;
  font-size: 0.9rem;
  min-height: 40px;
}
input[type='checkbox'] {
  width: 18px;
  height: 18px;
  min-height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}
input[type='range'] {
  padding: 0;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #752f44;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-family: Georgia, serif;
  font-weight: 400;
  font-size: 1.55rem;
}
h2 {
  font-size: 1.05rem;
}
h3 {
  font-size: 0.95rem;
}
.subtle {
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 4px;
}
.topbar {
  height: 90px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 26px;
  border-bottom: 1px solid var(--line);
  background: white;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}
.brand-mark {
  font-size: 2.4rem;
  color: var(--accent);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
#save-status {
  font-size: 0.8rem;
  color: var(--muted);
  margin-right: 12px;
}
.summary {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 26px;
  border-bottom: 1px solid var(--line);
  background: white;
}
#stats {
  display: flex;
  gap: 24px;
  font-size: 0.875rem;
  flex: 1;
}
#stats b {
  font-size: 1.1rem;
  margin-right: 5px;
  font-variant-numeric: tabular-nums;
}
#plan-name {
  font-family: Georgia, serif;
  font-size: 1.05rem;
}
.workspace {
  display: grid;
  grid-template-columns: 300px minmax(320px, 1fr) 300px;
  height: calc(100dvh - 146px);
  min-height: 480px;
}
.guests-panel,
.inspector {
  background: white;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.guests-panel {
  border-right: 1px solid var(--line);
}
.panel-title {
  padding: 20px 18px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.panel-title h2 span {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.8rem;
}
.small {
  padding: 5px 9px;
  font-size: 0.8rem;
  min-height: 32px;
}
.guest-controls {
  padding: 0 16px 12px;
}
.filter-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.filter-row select {
  font-size: 0.8rem;
  min-width: 0;
}
.filter-row button {
  white-space: nowrap;
  font-weight: 400;
}
.guest-list {
  overflow: auto;
  flex: 1;
  padding: 0 12px 12px;
}
.group {
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
.group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f3f1f4;
  padding: 9px 7px;
  border-radius: 5px;
  cursor: grab;
}
.group-name {
  font-size: 0.8rem;
  font-weight: 600;
  flex: 1;
  line-height: 1.35;
}
.group-name small {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--muted);
}
.group-count {
  font-size: 0.75rem;
  color: var(--muted);
}
.grip {
  color: var(--muted);
  font-size: 1rem;
}
.guest-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 6px;
  min-height: 44px;
  border-radius: 5px;
  cursor: grab;
}
.guest-row:hover {
  background: #f7f4f6;
}
.guest-row.selected {
  background: var(--accent-light);
}
.guest-row .guest-name {
  font-size: 0.875rem;
  flex: 1;
  overflow-wrap: anywhere;
}
.guest-row .guest-name small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}
.guest-row .table-tag {
  font-size: 0.75rem;
  color: var(--muted);
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.guest-row .info-button {
  border: 0;
  padding: 0;
  min-height: 28px;
  width: 26px;
  background: transparent;
  color: var(--muted);
}
.selection-bar {
  padding: 10px 16px;
  background: var(--accent-light);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.selection-bar[hidden] {
  display: none;
}
.unseat-zone {
  margin: 10px 14px 14px;
  padding: 12px;
  text-align: center;
  border: 1px dashed #8e8893;
  border-radius: 6px;
  font-size: 0.875rem;
  cursor: pointer;
}
.unseat-zone span {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 4px;
}
.drop-hover {
  background: #ead7df !important;
  outline: 2px solid var(--accent);
}
.drawing-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--canvas);
}
.canvas-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 8px;
  flex-wrap: wrap;
}
.segmented {
  display: flex;
  border: 1px solid #96929c;
  border-radius: 6px;
  overflow: hidden;
  background: white;
}
.segmented button {
  border: 0;
  border-radius: 0;
  font-size: 0.8rem;
  padding: 8px 12px;
}
.segmented .active {
  background: var(--ink);
  color: white;
}
.toolbar-actions {
  display: flex;
  gap: 7px;
}
.canvas-caption {
  padding: 4px 18px 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}
.canvas-caption #room-size {
  white-space: nowrap;
}
.canvas-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 24px;
  display: flex;
  align-items: flex-start;
}
#canvas-wrap {
  margin: auto;
  flex-shrink: 0;
  width: 100%;
  min-width: 200px;
}
#room-canvas {
  width: 100%;
  display: block;
  overflow: visible;
  background: white;
  box-shadow: 0 4px 18px #24213712;
  touch-action: none;
}
.canvas-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border-top: 1px solid #d3d3d9;
  background: #f8f8fa;
  font-size: 0.75rem;
  color: var(--muted);
}
.canvas-footer > div {
  display: flex;
  align-items: center;
  gap: 7px;
}
.canvas-footer button {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 0.8rem;
}
#zoom-level {
  min-width: 38px;
  text-align: center;
}
.table-node,
.feature-node {
  cursor: pointer;
}
.layout-mode .table-node,
.layout-mode .feature-node {
  cursor: move;
}
.table-node:focus {
  outline: none;
}
.table-node:focus .table-top {
  stroke: var(--accent);
  stroke-width: 0.2;
}
.table-node .table-top {
  fill: #fff;
  stroke: #8c6977;
  stroke-width: 0.09;
}
.table-node.selected .table-top {
  fill: #f6e9ee;
  stroke: #752f44;
  stroke-width: 0.17;
}
.table-node.overfull .table-top {
  fill: #fff0ec;
  stroke: #a22e25;
}
.table-node.drop-target .table-top {
  fill: #ecd2dd;
  stroke: #752f44;
  stroke-width: 0.25;
}
.chair {
  fill: #ebdee4;
  stroke: #a17e8c;
  stroke-width: 0.045;
}
.chair.empty {
  fill: #fff;
  stroke: #a5a0aa;
}
.table-label {
  font-family: Georgia, serif;
  fill: #39242c;
  text-anchor: middle;
  font-weight: 600;
  pointer-events: none;
}
.table-count {
  fill: #65505a;
  text-anchor: middle;
  pointer-events: none;
}
.feature-body {
  fill: #eef0f3;
  stroke: #858793;
  stroke-width: 0.07;
  stroke-dasharray: 0.25 0.15;
}
.feature-node.selected .feature-body {
  stroke: #752f44;
  stroke-width: 0.16;
}
.feature-label {
  fill: #595b67;
  text-anchor: middle;
  font-size: 0.75px;
  pointer-events: none;
}
.inspector {
  border-left: 1px solid var(--line);
  overflow: auto;
}
.inspector-header {
  padding: 21px 18px 16px;
  border-bottom: 1px solid var(--line);
}
.inspector-header .eyebrow {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.inspector-header h2 {
  font-family: Georgia, serif;
  font-size: 1.6rem;
  font-weight: 400;
}
.inspector-header p {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 8px;
}
.inspector-content {
  padding: 16px 18px;
}
.field {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 12px;
}
.field input,
.field select,
.field textarea {
  margin-top: 5px;
  font-weight: 400;
}
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 12px;
}
.inspector-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 10px;
}
.roster {
  list-style: none;
  margin: 0;
  padding: 0;
}
.roster .guest-row {
  padding-left: 0;
}
.seat-number {
  width: 22px;
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--muted);
}
.roster .guest-row {
  border-bottom: 1px solid #efedf0;
}
.roster .unseat-button {
  border: 0;
  color: var(--muted);
  padding: 2px 7px;
  min-height: 32px;
  background: transparent;
}
.empty {
  padding: 20px 8px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}
.table-overview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 8px;
  text-align: left;
}
.table-overview small {
  font-weight: 400;
  color: var(--muted);
}
.warning {
  background: #fff0e9;
  color: #85371d;
  padding: 10px;
  border-radius: 5px;
  font-size: 0.8rem;
  line-height: 1.5;
  margin: 10px 0;
}
.legend {
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 18px;
}
.pill {
  font-size: 0.75rem;
  background: #f0edf1;
  padding: 3px 6px;
  border-radius: 3px;
}
.meal-info {
  font-size: 0.8rem;
  line-height: 1.6;
  margin-top: 12px;
  color: var(--muted);
}
dialog {
  border: 1px solid #c2bcc5;
  border-radius: 10px;
  padding: 24px;
  width: min(510px, calc(100% - 28px));
  max-height: 90dvh;
  box-shadow: 0 20px 80px #0003;
}
dialog::backdrop {
  background: #22182466;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  gap: 20px;
}
.dialog-heading h2 {
  font-family: Georgia, serif;
  font-size: 1.6rem;
  font-weight: 400;
}
.dialog-heading button {
  border: 0;
  font-size: 1.5rem;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}
.dialog-note {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 16px;
}
.export-actions {
  display: grid;
  gap: 10px;
}
.export-actions button {
  text-align: left;
  padding: 13px;
}
.export-actions small {
  display: block;
  font-weight: 400;
  color: var(--muted);
  margin-top: 4px;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #292730;
  color: white;
  padding: 13px 20px;
  border-radius: 6px;
  z-index: 20;
  font-size: 0.875rem;
  max-width: calc(100% - 32px);
  box-shadow: 0 3px 20px #0002;
}
.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;
}
#print-area {
  display: none;
}
.empty-seat {
  padding: 10px 0;
  color: var(--muted);
  font-size: 0.8rem;
  border-bottom: 1px dashed var(--line);
}
[hidden] {
  display: none !important;
}
.toolbar-actions {
  flex-wrap: wrap;
}
.renumber-preview {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 45dvh;
  overflow: auto;
  border-top: 1px solid var(--line);
}
.renumber-preview li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}
.renumber-preview small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}
.renumber-preview strong {
  white-space: nowrap;
}
.renumber-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 8px;
}
.seating-tooltip {
  position: fixed;
  z-index: 15;
  width: max-content;
  max-width: min(320px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow: auto;
  padding: 14px 16px;
  border: 1px solid #96929c;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  box-shadow: 0 5px 22px #29273026;
  font-size: 0.875rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
}
.seating-tooltip strong {
  display: block;
  font-size: 1rem;
}
.seating-tooltip p {
  margin-top: 4px;
}
.seating-tooltip .tooltip-meta {
  color: var(--muted);
  font-size: 0.8rem;
}
.seating-tooltip ol {
  margin: 10px 0 0;
  padding-left: 24px;
}
.seating-tooltip li {
  padding: 2px 0;
}
.seating-tooltip li.over-capacity {
  color: var(--danger);
}
.chair:hover,
.chair:focus-visible {
  stroke: #752f44;
  stroke-width: 0.16;
  outline: none;
}
@media (min-width: 1600px) {
  .workspace {
    grid-template-columns: 330px minmax(400px, 1fr) 330px;
  }
}
@media (max-width: 1150px) {
  .workspace {
    grid-template-columns: 250px minmax(280px, 1fr) 255px;
  }
  .topbar {
    padding: 14px 18px;
  }
  .canvas-toolbar {
    padding: 12px;
  }
  .toolbar-actions button {
    padding: 7px 9px;
  }
  .canvas-caption {
    padding-left: 12px;
    padding-right: 12px;
  }
  .canvas-footer {
    padding: 8px;
  }
  .canvas-footer > span {
    max-width: 160px;
  }
  .guest-controls {
    padding-left: 12px;
    padding-right: 12px;
  }
  #save-status {
    max-width: 140px;
  }
  .brand-mark {
    display: none;
  }
}
@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 260px minmax(300px, 1fr);
    height: auto;
    min-height: calc(100dvh - 146px);
  }
  .guests-panel {
    height: 680px;
  }
  .drawing-panel {
    height: 680px;
  }
  .inspector {
    grid-column: 1/-1;
    max-height: none;
    border-top: 1px solid var(--line);
    border-left: 0;
  }
  .inspector-content {
    max-width: 700px;
  }
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .header-actions #save-status {
    width: 100%;
    text-align: right;
    max-width: none;
  }
  .topbar {
    height: auto;
    min-height: 90px;
  }
  .summary {
    height: auto;
    min-height: 56px;
  }
  #stats {
    gap: 12px;
    flex-wrap: wrap;
  }
  #plan-name {
    display: none;
  }
  .table-overview {
    max-width: 500px;
  }
}
@media (max-width: 600px) {
  .topbar {
    padding: 16px;
    align-items: flex-start;
  }
  .brand h1 {
    font-size: 1.2rem;
  }
  .subtle {
    font-size: 0.75rem;
  }
  .header-actions {
    gap: 5px;
    max-width: 185px;
  }
  .header-actions button {
    font-size: 0.75rem;
    padding: 5px 8px;
    min-height: 36px;
  }
  .header-actions #save-status {
    font-size: 0.7rem;
    margin: 0;
  }
  .summary {
    padding: 10px 16px;
    gap: 10px;
  }
  #stats {
    font-size: 0.75rem;
  }
  #stats b {
    font-size: 0.95rem;
  }
  .summary button {
    font-size: 0.75rem;
    padding: 7px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .drawing-panel {
    order: 0;
    height: 570px;
  }
  .guests-panel {
    order: 1;
    height: 470px;
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  .inspector {
    order: 2;
  }
  .canvas-toolbar {
    gap: 8px;
  }
  .canvas-caption {
    flex-direction: column;
    gap: 2px;
  }
  .canvas-scroll {
    padding: 18px;
  }
  .canvas-footer {
    font-size: 0.7rem;
  }
  .canvas-footer > span {
    max-width: 130px;
  }
  .guest-row {
    min-height: 48px;
  }
  .guest-row .info-button,
  .roster .unseat-button {
    width: 44px;
    min-height: 44px;
  }
  .table-overview {
    min-height: 44px;
  }
  .panel-title button {
    min-height: 44px;
  }
}
@media print {
  @page {
    size: landscape;
    margin: 12mm;
  }
  body > * {
    display: none !important;
  }
  #print-area {
    display: block !important;
  }
  #print-area h1 {
    margin-bottom: 12px;
  }
  #print-area svg {
    width: 100%;
    height: 160mm;
    display: block;
  }
  #print-area .print-lists {
    columns: 3;
    column-gap: 24px;
    break-before: page;
    font-size: 10pt;
  }
  #print-area section {
    break-inside: avoid;
    margin-bottom: 18px;
  }
  #print-area h2 {
    font-size: 13pt;
    margin-bottom: 8px;
  }
  #print-area li {
    margin: 4px 0;
  }
  #print-area p {
    font-size: 10pt;
    color: #555;
  }
}
