/* Sheet Sync Tables — floor map. Override the --sstm-* properties to theme. */
.sstm {
	--sstm-h: 560px;
	--sstm-accent: #3b1f8f;
	--sstm-empty: #e4e4e7;
	--sstm-taken: #ffffff;
	--sstm-hover: #efeaff;
	--sstm-active: #d8ccff;
	--sstm-label: #1d2327;
	--sstm-code: #6b6b76;
	--sstm-border: rgba(127, 127, 127, 0.28);
	position: relative;
	margin: 1.5em 0;
}

/* ---------- Search ---------- */
.sstm-toolbar { position: relative; max-width: 380px; margin-bottom: 0.75em; z-index: 6; }
.sstm .sstm-search {
	box-sizing: border-box;
	width: 100%;
	padding: 0.6em 0.85em;
	border: 1px solid var(--sstm-border);
	border-radius: 8px;
	font: inherit;
	background: transparent;
	color: inherit;
}
.sstm-results {
	position: absolute;
	left: 0; right: 0; top: 100%;
	margin: 4px 0 0;
	padding: 4px;
	list-style: none;
	background: #fff;
	color: #1d2327;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	max-height: 320px;
	overflow: auto;
}
.sstm-results[hidden] { display: none; }
.sstm-result {
	display: flex;
	justify-content: space-between;
	gap: 1em;
	margin: 0;
	padding: 0.5em 0.65em;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.95em;
}
.sstm-result:hover, .sstm-result.is-cursor { background: var(--sstm-hover); }
.sstm-result-code { color: var(--sstm-code); font-size: 0.85em; white-space: nowrap; }
.sstm-noresult { padding: 0.5em 0.65em; color: var(--sstm-code); font-size: 0.9em; }

/* ---------- Stage ---------- */
.sstm-stage {
	position: relative;
	height: min(var(--sstm-h), 75vh);
	min-height: 280px;
	border: 1px solid var(--sstm-border);
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	cursor: grab;
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
	-webkit-tap-highlight-color: transparent;
}
.sstm-stage.is-dragging { cursor: grabbing; }
.sstm-canvas, .sstm-svg { display: block; width: 100%; height: 100%; }
.sstm-error { padding: 2em; text-align: center; color: #646970; }

/* Booths */
.sstm .is-empty path, .sstm .is-empty rect, .sstm path.is-empty, .sstm rect.is-empty { fill: var(--sstm-empty); }
.sstm .is-taken { cursor: pointer; }
.sstm .is-taken path, .sstm .is-taken rect, .sstm path.is-taken, .sstm rect.is-taken { fill: var(--sstm-taken); transition: fill 0.15s; }
.sstm .is-taken:hover path, .sstm .is-taken:hover rect, .sstm path.is-taken:hover, .sstm rect.is-taken:hover { fill: var(--sstm-hover); }
.sstm .is-active path, .sstm .is-active rect, .sstm path.is-active, .sstm rect.is-active { fill: var(--sstm-active); }

.sstm-labels { pointer-events: none; }
.sstm-label-name { font-family: inherit; font-weight: 700; fill: var(--sstm-label); }
.sstm-label-code { font-family: inherit; fill: var(--sstm-code); }
.sstm .sstm-hit { pointer-events: all; fill: transparent; cursor: pointer; }
.sstm .sstm-hit:hover { fill: var(--sstm-hover); fill-opacity: 0.6; }
.sstm .sstm-hit.is-active { fill: var(--sstm-active); fill-opacity: 0.6; }

/* ---------- Controls (reset theme/page-builder button styles) ---------- */
.sstm-controls { position: absolute; top: 10px; right: 10px; z-index: 3; display: flex; flex-direction: column; gap: 6px; }
.sstm .sstm-controls .sstm-btn,
.sstm .sstm-controls .sstm-btn:hover,
.sstm .sstm-controls .sstm-btn:focus {
	all: unset;
	box-sizing: border-box;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	background: #fff;
	color: #1d2327;
	border: 1px solid rgba(0, 0, 0, 0.12);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
	font: 600 18px/1 system-ui, sans-serif;
	cursor: pointer;
}
.sstm .sstm-controls .sstm-btn:hover { background: #f4f4f6; }
.sstm .sstm-controls .sstm-btn:focus-visible { outline: 2px solid var(--sstm-accent); outline-offset: 2px; }

/* ---------- Card ---------- */
.sstm-card {
	position: absolute;
	z-index: 4;
	top: 10px;
	left: 10px;
	box-sizing: border-box;
	width: min(320px, calc(100% - 72px));
	max-height: calc(100% - 20px);
	overflow: auto;
	padding: 14px 16px 16px;
	background: #fff;
	color: #1d2327;
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
	cursor: auto;
	user-select: text;
}
.sstm-card[hidden] { display: none; }
.sstm .sstm-card .sstm-close,
.sstm .sstm-card .sstm-close:hover,
.sstm .sstm-card .sstm-close:focus {
	all: unset;
	position: absolute;
	top: 8px;
	right: 10px;
	width: 28px;
	height: 28px;
	display: grid;
	place-items: center;
	border-radius: 50%;
	font: 22px/1 system-ui, sans-serif;
	color: #646970;
	cursor: pointer;
}
.sstm .sstm-card .sstm-close:hover { background: #f0f0f1; }
.sstm-card-booth { margin: 0 32px 0.6em 0; font-size: 0.8em; letter-spacing: 0.04em; text-transform: uppercase; color: var(--sstm-code); }
.sstm-ex + .sstm-ex { margin-top: 0.9em; padding-top: 0.9em; border-top: 1px solid #ececef; }
.sstm-logo { display: block; max-width: 160px; max-height: 56px; width: auto; height: auto; margin: 0 0 0.6em; object-fit: contain; }
.sstm .sstm-card .sstm-name { margin: 0; font-size: 1.1em; line-height: 1.25; color: inherit; }
.sstm-also { margin: 0.3em 0 0; font-size: 0.85em; color: var(--sstm-code); }
.sstm .sstm-card .sstm-link {
	display: inline-block;
	margin-top: 0.6em;
	padding: 0.4em 0.85em;
	border-radius: 999px;
	background: var(--sstm-accent);
	color: #fff;
	font-size: 0.9em;
	font-weight: 600;
	text-decoration: none;
}
.sstm .sstm-card .sstm-link::after { content: " \2197"; }
.sstm .sstm-card .sstm-link:hover { filter: brightness(1.15); }

/* Phones: card becomes a bottom sheet. */
@media (max-width: 600px) {
	.sstm-card { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 55%; }
}

/* ---------- Zoom hint ---------- */
.sstm-hint {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: grid;
	place-items: center;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-weight: 600;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s;
}
.sstm-hint.is-on { opacity: 1; }

/* ---------- Fullscreen ---------- */
.sstm.is-fs {
	position: fixed;
	inset: 0;
	z-index: 999999;
	margin: 0;
	padding: 12px;
	background: #fff;
	display: flex;
	flex-direction: column;
}
.sstm.is-fs .sstm-stage { flex: 1; height: auto; touch-action: none; }
html.sstm-noscroll { overflow: hidden; }

/* ---------- Shared helpers ---------- */
.sstm .sst-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.sst-notice { padding: 0.75em 1em; border-left: 4px solid #dba617; background: #fcf9e8; color: #1d2327; font-size: 0.9em; }
