.floor-plan {
  --fp-blue: #283f91;
  --fp-line: #52679a;
  --fp-quiet: #576788;
  --fp-field: #edf0eb;
  --fp-cream: #f8f6e9;
  --fp-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  container: floor-plate / inline-size;
  color: var(--fp-blue);
  min-width: 0;
}

.fp-diagram {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 700 / 326;
  background-color: var(--fp-field);
  background-image: radial-gradient(circle, #536f9842 .65px, transparent .8px);
  background-size: 12px 12px;
  overflow: hidden;
}

.fp-arch { display: block; position: absolute; inset: 0; width: 100%; height: 100%; fill: none; pointer-events: none; }
.fp-compact { display: none; }
.fp-wall { stroke: var(--fp-blue); stroke-width: 5.5; fill: none; stroke-linejoin: miter; }
.fp-wall-core { stroke: #b9c4cf; stroke-width: 2; fill: none; }
.fp-window { stroke: var(--fp-line); stroke-width: 1.15; }
.fp-railing { stroke: var(--fp-line); stroke-width: 1.05; }
.fp-railing path:last-child { opacity: .57; }
.fp-posts { stroke: var(--fp-line); stroke-width: 3.1; }
.fp-planter { stroke: var(--fp-line); stroke-width: .8; fill: #e0e7dd; }
.fp-planter path { fill: #a3b5a4; stroke-width: .7; }
.fp-door { stroke: var(--fp-blue); stroke-width: 1.6; }
.fp-swing { stroke: var(--fp-line); stroke-width: .9; stroke-dasharray: 3 2.6; }
.fp-counter { stroke: var(--fp-line); stroke-width: 1; fill: #e0e6e1; }
.fp-wall-note { stroke: var(--fp-line); stroke-width: 1.1; }
.fp-room-label, .fp-wall-note text {
  fill: var(--fp-blue);
  font: 600 12px var(--fp-mono);
  letter-spacing: 1.1px;
  text-transform: uppercase;
}
.fp-wall-note text { fill: var(--fp-quiet); stroke: none; font-size: 10px; letter-spacing: .9px; }

.fp-position {
  position: absolute;
  left: var(--floor-x);
  top: var(--floor-y);
  display: grid;
  place-items: center;
  width: 15%;
  min-width: 50px;
  min-height: 44px;
  aspect-ratio: 95 / 72;
  transform: translate(-50%, -50%);
  color: var(--fp-blue);
  border: 0;
  border-radius: 4px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}
.fp-position > svg { position: absolute; width: 100%; height: 100%; inset: 0; overflow: visible; pointer-events: none; }
.fp-position > span {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translate(-50%, -52%);
  pointer-events: none;
  font: 700 clamp(13px, 2.65cqw, 24px) / 1 var(--sans, 'DM Sans', sans-serif);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.08em;
  padding-right: .06em;
}
.fp-position.fp-long-name > span { font-size: clamp(11px, 1.85cqw, 15px); letter-spacing: -.04em; }
.fp-seats { fill: var(--fp-field); stroke: var(--fp-line); stroke-width: 1.2; stroke-linejoin: round; }
.fp-chair-back { fill: none; stroke-width: .8; opacity: .8; }
.fp-tabletop { fill: #e1e7e4; stroke: var(--fp-blue); stroke-width: 1.7; transition: fill .16s ease; }
.fp-position[data-status='offline'] { color: #536079; }
.fp-position[data-status='offline'] .fp-tabletop { fill: var(--fp-field); stroke: #68768e; stroke-dasharray: 3 2; }
.fp-position[data-status='offline'] .fp-seats { stroke: #788397; }
.fp-position[data-status='paused'] .fp-tabletop { stroke: var(--fp-blue); stroke-width: 3.2; fill: var(--fp-field); stroke-dasharray: 1 1.5; }
.fp-position[aria-pressed='true'] { color: var(--fp-cream); z-index: 1; }
.fp-position[aria-pressed='true'] .fp-tabletop { fill: var(--fp-blue); stroke: var(--fp-blue); }
.fp-position[aria-pressed='true'] .fp-seats { stroke: var(--fp-blue); fill: #cbd6e0; }
.fp-position[aria-pressed='true'][data-status='offline'] .fp-tabletop, .fp-position[aria-pressed='true'][data-status='paused'] .fp-tabletop { stroke: #f7f4e9; paint-order: stroke fill; stroke-width: 4.3; }
.fp-position:focus-visible, .fp-listed-device:focus-visible { outline: 2px solid var(--fp-blue); outline-offset: 0; }

.fp-key {
  display: flex;
  align-items: center;
  gap: 17px;
  min-height: 37px;
  padding: 8px clamp(13px, 3.5cqw, 27px);
  color: var(--fp-quiet);
  background: var(--fp-field);
  border-top: 1px solid #c1cad1;
  font: 500 11px / 1.25 var(--sans, 'DM Sans', sans-serif);
}
.fp-key > span { display: inline-flex; align-items: center; gap: 5px; }
.fp-key i { display: block; width: 13px; height: 9px; border: 1.25px solid var(--fp-blue); border-radius: 1px; }
.fp-key .fp-legend-selected { background: var(--fp-blue); }
.fp-key .fp-legend-online { background: #e1e7e4; }
.fp-key .fp-legend-offline { border-color: #68768e; border-style: dashed; }
.fp-key .fp-legend-paused { border-style: dotted; border-width: 2px; }
.fp-key .fp-notation { margin-left: auto; font: 500 10px / 1.3 var(--fp-mono); }
.fp-index, .fp-empty { margin: 0; padding: 16px 21px; background: var(--fp-field); }
.fp-index { display: grid; gap: 10px; }
.fp-index h3 { margin: 0; font: 600 16px / 1.3 var(--sans, 'DM Sans', sans-serif); }
.fp-index-room { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.fp-index-room > strong { margin-right: 4px; font-size: 13px; }
.fp-listed-device { display: inline-flex; align-items: center; min-height: 44px; gap: 6px; border: 1px solid var(--fp-line); border-radius: 2px; padding: 5px 9px; background: var(--fp-cream); color: var(--fp-blue); font: 600 13px / 1.2 var(--sans, 'DM Sans', sans-serif); cursor: pointer; }
.fp-listed-device small { font-size: 10px; font-weight: 400; }
.fp-listed-device[aria-pressed='true'] { color: var(--fp-cream); background: var(--fp-blue); }

@media (hover: hover) {
  .fp-position:not([aria-pressed='true']):hover .fp-tabletop { fill: #c5d1de; }
  .fp-listed-device:not([aria-pressed='true']):hover { background: #dce4e8; }
}
@container floor-plate (max-width: 515px) {
  .fp-diagram { aspect-ratio: 360 / 274; }
  .fp-wide { display: none; }
  .fp-compact { display: block; }
  .fp-position { left: var(--small-x); top: var(--small-y); width: 18%; }
  .fp-position > span { font-size: clamp(12px, 3.75cqw, 19px); }
  .fp-position.fp-long-name > span { font-size: clamp(10px, 2.75cqw, 13px); }
  .fp-room-label { font-size: 11px; letter-spacing: .55px; }
  .fp-key { min-height: 34px; padding: 7px 12px; flex-wrap: wrap; gap: 6px 12px; }
  .fp-key .fp-notation { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { .fp-tabletop { transition: none; } }
