@font-face {
  font-family: "RoomsTypeface";
  src: url("./357de16aff545009-s.p.otf") format("opentype");
  font-display: swap;
}

:root {
  --paper: #f8f6f3;
  --dot: rgba(126, 121, 114, 0.2);
  --home: #3e473f;
  --text: #171717;
  --muted: #746f68;
  --surface: rgba(248, 246, 243, 0.92);
  --border: rgba(71, 64, 56, 0.12);
  --shadow: 0 24px 60px rgba(18, 24, 20, 0.08);
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--paper);
  color: var(--text);
  font-family: "Helvetica Neue", Arial, sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.canvas {
  min-height: 100vh;
  width: 100%;
  position: relative;
  background: var(--paper);
}

.site-header {
  position: fixed;
  top: 18px;
  left: 24px;
  right: 24px;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.site-header-copy {
  display: grid;
  gap: 4px;
}

.site-header-actions {
  pointer-events: auto;
}

.site-title {
  margin: 0;
  color: var(--text);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
}

.site-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.tag-carousel {
  position: fixed;
  top: 18px;
  right: 24px;
  left: auto;
  max-width: min(58vw, 760px);
  z-index: 6;
  pointer-events: none;
}

.tag-filter-track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 6px;
  scrollbar-width: none;
  pointer-events: auto;
  justify-content: flex-end;
}

.tag-filter-track::-webkit-scrollbar {
  display: none;
}

.tag-filter-chip {
  flex: 0 0 auto;
  border: 1px solid rgba(71, 64, 56, 0.12);
  border-radius: 999px;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

.tag-filter-chip:hover,
.tag-filter-chip:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(71, 64, 56, 0.22);
  background: rgba(255, 255, 255, 0.92);
}

.tag-filter-chip.is-active {
  background: var(--home);
  border-color: var(--home);
  color: #fff;
}

.viewport {
  position: relative;
  z-index: 0;
  width: 100%;
  min-height: 100vh;
  overflow: hidden;
  cursor: grab;
}

.viewport:active {
  cursor: grabbing;
}

.world {
  position: absolute;
  inset: 0;
}

.dots {
  position: absolute;
  inset: 0;
  background-color: var(--paper);
  background-image: radial-gradient(circle at 50% 50%, var(--dot) 1px, transparent 1.2px);
  background-position: 0 0;
  background-size: 24px 24px;
  transition: opacity 220ms ease;
}

.rooms-layer {
  position: absolute;
  inset: 0;
}

.rooms-layer.is-moving-mode .add-anchor {
  opacity: 0;
  pointer-events: none;
}

.room-node {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.room-node.is-moving {
  z-index: 7;
}

.room-square {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 18px;
  background: var(--home);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition: transform 180ms ease, box-shadow 180ms ease, opacity 180ms ease, filter 180ms ease;
}

.room-image-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(248, 246, 243, 0.8);
  color: rgba(62, 71, 63, 0.78);
  display: grid;
  place-items: center;
  padding: 0;
  opacity: 0;
  transition: opacity 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.room-image-nav.left {
  left: 10px;
  transform: translateY(-50%);
}

.room-image-nav.right {
  right: 10px;
  transform: translateY(-50%);
}

.room-image-nav::before {
  content: "";
  width: 6px;
  height: 6px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
}

.room-image-nav.left::before {
  transform: rotate(-135deg);
  margin-left: 2px;
}

.room-image-nav.right::before {
  transform: rotate(45deg);
  margin-right: 2px;
}

.room-square::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.18));
  opacity: 0;
}

.room-square.has-image::after {
  opacity: 1;
}

.room-square:hover {
  transform: scale(1.018);
  opacity: 0.96;
  box-shadow: 0 16px 30px rgba(37, 44, 38, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  filter: saturate(1.03);
}

.room-square.has-multiple-images:hover .room-image-nav,
.room-image-nav:focus-visible {
  opacity: 1;
}

.room-image-nav:hover,
.room-image-nav:focus-visible {
  background: rgba(248, 246, 243, 0.94);
  color: rgba(23, 23, 23, 0.9);
}

.room-node.is-moving .room-square {
  transform: scale(1);
  opacity: 1;
  box-shadow: 0 22px 42px rgba(37, 44, 38, 0.22), 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  filter: saturate(1.05);
  cursor: grabbing;
}

.room-node.is-moving .room-image-nav,
.rooms-layer.is-moving-mode .room-image-nav {
  opacity: 0;
  pointer-events: none;
}

.rooms-layer.is-moving-mode .room-node:not(.is-moving) .room-square {
  transform: scale(0.95);
  opacity: 1;
}

.room-label {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 1;
  color: #ffffff;
  font-size: 0.8rem;
  font-family: "RoomsTypeface", "Helvetica Neue", Arial, sans-serif;
  letter-spacing: 0.08em;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.add-anchor {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(24, 24, 24, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: #bdbdbd;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(18, 24, 20, 0.05);
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, opacity 220ms ease;
  opacity: 1;
}

.add-anchor.top {
  left: 50%;
  top: -30px;
  transform: translate(-50%, -50%);
}

.add-anchor.right {
  right: -30px;
  top: 50%;
  transform: translate(50%, -50%);
}

.add-anchor.bottom {
  left: 50%;
  bottom: -30px;
  transform: translate(-50%, 50%);
}

.add-anchor.left {
  left: -30px;
  top: 50%;
  transform: translate(-50%, -50%);
}

.add-anchor::before,
.add-anchor::after {
  content: "";
  position: absolute;
  background: currentColor;
  border-radius: 999px;
}

.add-anchor::before {
  width: 2px;
  height: 10px;
}

.add-anchor::after {
  width: 10px;
  height: 2px;
}

.add-anchor:hover {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(24, 24, 24, 0.18);
  color: rgba(23, 23, 23, 0.88);
  opacity: 1;
}

.shared-anchor {
  transform: translate(-50%, -50%);
  opacity: 0;
  pointer-events: none;
}

.shared-anchor.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.drop-placeholder {
  position: absolute;
  transform: translate(-50%, -50%) scale(0.95);
  border: 1px solid rgba(218, 212, 204, 0.82);
  border-radius: 18px;
  background: rgba(236, 232, 226, 0.96);
  pointer-events: none;
  z-index: 2;
  transition: background-color 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.drop-placeholder.is-active {
  transform: translate(-50%, -50%) scale(1);
  background: rgba(242, 239, 234, 0.98);
  border-color: rgba(226, 220, 212, 0.92);
}


.detail-panel {
  position: fixed;
  z-index: 10;
  top: 24px;
  right: 24px;
  bottom: 24px;
  width: min(430px, calc(100vw - 32px));
  padding: 18px 18px 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 18px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(16px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.detail-panel.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.panel-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(24, 24, 24, 0.05);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  justify-self: end;
}

.panel-close span {
  font-size: 1.65rem;
  line-height: 1;
}

.panel-edit {
  min-width: 0;
}

.panel-copy {
  display: grid;
  gap: 10px;
}

.panel-title {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  line-height: 1;
  font-weight: 500;
  font-family: "RoomsTypeface", "Helvetica Neue", Arial, sans-serif;
}

.panel-address {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  text-decoration: none;
  transition: color 160ms ease, opacity 160ms ease;
}

.panel-address:hover {
  color: var(--text);
  opacity: 0.92;
}

.panel-coordinates {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
}

.panel-weather {
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.4;
}

.panel-media {
  border-radius: 20px;
  overflow: auto;
  background: rgba(24, 24, 24, 0.04);
  min-height: 260px;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.panel-media img {
  width: 100%;
  height: auto;
  max-height: 340px;
  object-fit: cover;
  display: block;
  border-radius: 14px;
}

.panel-placeholder {
  width: 100%;
  height: 100%;
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.03em;
}

.panel-icon-button {
  width: 40px;
  height: 40px;
  min-width: 0;
  aspect-ratio: 1 / 1;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.panel-icon-button span {
  display: block;
  font-size: 1.05rem;
  line-height: 1;
}

.add-room-button,
.center-button,
.coordinates-readout {
  position: fixed;
  bottom: 24px;
  z-index: 5;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.center-button {
  left: 24px;
  cursor: pointer;
}

.add-room-button {
  right: 24px;
  padding: 12px 18px;
  min-width: 112px;
  cursor: pointer;
}

.center-button span {
  transform: translateY(-1px);
}

.coordinates-readout {
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  padding: 12px 18px;
  text-align: center;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 11;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at top left, rgba(207, 217, 206, 0.46), transparent 32%),
    radial-gradient(circle at bottom right, rgba(233, 220, 204, 0.54), transparent 28%),
    rgba(248, 246, 243, 0.8);
  backdrop-filter: blur(14px);
}

.auth-gate[hidden] {
  display: none;
}

.auth-card {
  width: min(480px, 100%);
  padding: 28px;
  border: 1px solid rgba(71, 64, 56, 0.1);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 28px 70px rgba(18, 24, 20, 0.12);
  display: grid;
  gap: 18px;
}

.auth-eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.auth-title {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.95;
  font-weight: 500;
  font-family: "RoomsTypeface", "Helvetica Neue", Arial, sans-serif;
}

.auth-copy,
.auth-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
}

.auth-actions-stack {
  justify-content: stretch;
}

.auth-provider-button {
  width: 100%;
}

.auth-logout-button {
  min-width: 0;
  background: rgba(255, 255, 255, 0.82);
}

.room-dialog {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 0;
  box-shadow: var(--shadow);
  background: rgba(255, 255, 255, 0.98);
}

.room-dialog::backdrop {
  background: rgba(17, 17, 17, 0.12);
  backdrop-filter: blur(4px);
}

.room-form {
  padding: 18px;
  display: grid;
  gap: 16px;
}

.form-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.dialog-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(24, 24, 24, 0.05);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.dialog-close span {
  font-size: 1.65rem;
  line-height: 1;
}

.field {
  display: grid;
  gap: 8px;
  font-size: 0.95rem;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  background: rgba(248, 248, 248, 0.95);
}

.field input {
  min-height: 48px;
}

.address-suggestions {
  display: none;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(248, 246, 243, 0.98);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(18, 24, 20, 0.06);
}

.address-suggestions.is-open {
  display: grid;
}

.address-suggestion {
  width: 100%;
  border: 0;
  border-top: 1px solid rgba(71, 64, 56, 0.08);
  background: transparent;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 3px;
}

.address-suggestion:first-child {
  border-top: 0;
}

.address-suggestion:hover,
.address-suggestion:focus-visible {
  background: rgba(240, 236, 231, 0.96);
}

.address-suggestion-label {
  font-size: 0.92rem;
  color: var(--text);
}

.address-suggestion-meta {
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.tag-entry {
  display: flex;
  gap: 10px;
}

.tag-entry input {
  flex: 1;
}

.tag-add {
  min-width: 80px;
}

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

.panel-tags {
  margin-top: 2px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.82rem;
  background: rgba(247, 247, 247, 0.95);
}

.tag-chip-empty {
  color: var(--muted);
  background: transparent;
}

.tag-remove {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.file-tile {
  min-height: 112px;
  border: 1px dashed rgba(24, 24, 24, 0.14);
  border-radius: 18px;
  background: rgba(246, 246, 246, 0.96);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 18px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.file-tile:hover {
  border-color: rgba(24, 24, 24, 0.22);
  background: rgba(242, 242, 242, 0.98);
  color: var(--text);
}

.file-tile.is-filled {
  border-style: solid;
  background: rgba(240, 236, 231, 0.98);
  color: var(--text);
}

.file-tile-label {
  font-size: 0.94rem;
}

.file-tile-name {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  color: var(--muted);
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.danger-button {
  margin-right: auto;
  min-width: 96px;
  border: 1px solid rgba(145, 48, 32, 0.22);
  border-radius: 999px;
  padding: 11px 18px;
  background: rgba(145, 48, 32, 0.08);
  color: #7e2517;
  cursor: pointer;
}

.danger-button:hover,
.danger-button:focus-visible {
  background: rgba(145, 48, 32, 0.12);
  border-color: rgba(145, 48, 32, 0.32);
}

.primary-button,
.secondary-button {
  min-width: 96px;
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
}

.primary-button {
  border: 0;
  background: var(--home);
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

@media (max-width: 640px) {
  .site-header {
    left: 16px;
    right: 16px;
    top: 16px;
  }

  .tag-carousel {
    right: 16px;
    top: 16px;
    max-width: calc(100vw - 32px);
  }

  .center-button {
    left: 16px;
    bottom: 16px;
  }

  .add-room-button {
    right: 16px;
    bottom: 16px;
  }

  .coordinates-readout {
    bottom: 16px;
    min-width: 0;
    width: calc(100vw - 148px);
    max-width: 320px;
  }

  .detail-panel {
    top: auto;
    left: 16px;
    right: 16px;
    bottom: 68px;
    width: auto;
    max-height: 50vh;
  }

  .panel-media,
  .panel-placeholder {
    min-height: 180px;
  }

  .auth-gate {
    padding: 16px;
  }

  .auth-card {
    padding: 22px;
    border-radius: 24px;
  }
}
