:root {
  --bg: #0d0f12;
  --bg-soft: #151922;
  --border: #2b3240;
  --text: #eef2f9;
  --muted: #b7c0d4;
  --brand: #55a3ff;
  --accent: #1d2838;
  --overlay: rgba(0, 0, 0, 0.68);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.floating-menu-btn {
  position: fixed;
  top: 20px;
  left: 78px;
  z-index: 35;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.5);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 220ms ease, background-color 200ms ease;
}

.floating-menu-btn:hover {
  transform: translateY(-1px);
  background-color: #222;
}

#menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
  display: block;
  transition: background-color 160ms ease;
}

#menu-toggle:hover span {
  background: #ff3158;
}

.panel {
  position: fixed;
  top: 82px;
  left: 14px;
  width: min(360px, 92vw);
  max-height: calc(100vh - 102px);
  overflow: auto;
  z-index: 25;
  background: rgba(21, 25, 34, 0.95);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.45);
}

.panel.hidden {
  display: none;
}

.panel-section + .panel-section {
  margin-top: 12px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.panel-title {
  font-size: 15px;
  font-weight: 600;
}

.close-panel-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  background: var(--accent);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 120ms ease;
}

.close-panel-btn:hover {
  background: #26344a;
  border-color: var(--brand);
  transform: translateY(-1px);
}

.section-title {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.search-input {
  width: 100%;
  height: 38px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 0 10px;
}

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

.tag-pill {
  border: 1px solid var(--border);
  background: var(--accent);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 140ms ease, border-color 180ms ease, background-color 180ms ease;
}

.tag-pill:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
  background: #273448;
}

.tag-pill.active {
  border-color: var(--brand);
  color: var(--brand);
}

.menu-tree details {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.menu-tree details + details {
  margin-top: 8px;
}

.menu-tree summary {
  list-style: none;
  cursor: pointer;
  padding: 10px;
  background: #1b2230;
  font-weight: 600;
  transition: background-color 180ms ease, color 180ms ease;
}

.menu-tree summary:hover {
  background: #25314a;
  color: #ffffff;
}

.menu-tree summary::-webkit-details-marker {
  display: none;
}

.room-list {
  padding: 8px;
  display: grid;
  gap: 8px;
}

.room-block {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #141a25;
  padding: 8px;
}

.room-header {
  display: flex;
  gap: 8px;
}

.room-button {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #20293a;
  color: var(--text);
  min-height: 34px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 180ms ease, background-color 180ms ease;
}

.room-button:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
  background: #2a3650;
}

.setup-list {
  margin-top: 8px;
  display: grid;
  gap: 6px;
}

.setup-button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #0f141d;
  color: var(--text);
  padding: 8px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 180ms ease, background-color 180ms ease;
}

.setup-button:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
  background: #182233;
}

.menu-leaf-button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #20293a;
  color: var(--text);
  min-height: 38px;
  padding: 8px 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 180ms ease, background-color 180ms ease;
}

.menu-leaf-button:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
  background: #2a3650;
}

.panel-section.hidden {
  display: none;
}

.menu-tree details .setup-list {
  padding: 8px;
}

.setup-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.visit-root {
  width: 100%;
  height: 100%;
}

#matterport-iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.overlay.hidden {
  display: none;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

.overlay-card {
  position: relative;
  margin: 72px auto 24px;
  width: min(1000px, 92vw);
  height: calc(100vh - 96px);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #0d1118;
}

.overlay-header {
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  border-bottom: 1px solid var(--border);
}

.overlay-title {
  font-weight: 600;
}

.close-btn {
  font-size: 16px;
}

.overlay-iframe {
  width: 100%;
  height: calc(100% - 46px);
  border: 0;
}
