:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-border: #d8dee6;
  --text: #183b63;
  --muted: #64748b;
  --line: #e5e7eb;
  --available: #6b8f58;
  --unavailable: #cbd5e1;
  --accent: #1f4f82;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding-top: 6px;
}

.page-intro {
  padding: 6px 22px 4px;
  margin: 0 10px;
}

.page-intro-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7c8ca0;
}

.page-intro-title {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
  font-weight: 700;
  color: #173f6a;
}

.page-intro-text {
  max-width: 720px;
  margin: 6px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}


.top-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 22px 29px;
  margin: 0 10px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--panel-border);
  overflow-x: auto;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.top-filters::-webkit-scrollbar {
  display: none;
}

.top-filter {
  display: block;
  flex: 0 0 auto;
  min-width: 138px;
}

.top-filter span {
  display: none;
}

.top-filter .toggle span {
  display: block;
}

.top-filter select {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid #cfd8e3;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  outline: none;
}

.top-filter-toggle {
  flex: 0 0 auto;
  min-width: 180px;
}

.top-filter-toggle .toggle {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #cfd8e3;
  background: #fff;
}

.content-layout {
  display: flex;
  min-height: 0;
  min-height: 0;
  flex: 1 1 auto;
}

.map {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, #f9fbfd 0%, #eef3f8 100%);
  overflow: hidden;
}

.map-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 20;
  display: grid;
  gap: 10px;
}

.map-control-button {
  min-width: 48px;
  height: 48px;
  border: 1px solid rgba(31, 79, 130, 0.18);
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.map-control-button:hover {
  transform: translateY(-1px);
  border-color: rgba(31, 79, 130, 0.34);
  background: #ffffff;
}

.map-control-button.is-reset {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.map svg {
  display: block;
  flex: 0 0 auto;
  max-width: none;
  max-height: none;
  transform-origin: center center;
  transition: width 0.18s ease, height 0.18s ease;
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
  image-rendering: -webkit-optimize-contrast;
}

/* .map svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
} */

.sidebar {
  width: 380px;
  flex: 0 0 380px;
  min-height: 0;
  height: 100%;
  padding: 24px 16px 40px 24px;
  overflow-y: auto;
  overflow-x: hidden;
  background: #f8fafc;
  border-left: 1px solid var(--panel-border);
}

.sidebar-header {
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7c8ca0;
}

.sidebar-header h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.05;
  font-weight: 600;
}

.sidebar-subtext {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
}

.toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.unit-list {
  display: grid;
  gap: 14px;
}

.unit-card {
  width: 100%;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 18px;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.unit-card:hover {
  transform: translateY(-1px);
  border-color: #b7c6d8;
}

.unit-card.is-active {
  border-color: var(--accent);
  box-shadow: 0 12px 30px rgba(31, 79, 130, 0.16);
  background: linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
}

.unit-card-top,
.unit-card-middle,
.unit-card-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.unit-card-middle,
.unit-card-bottom {
  margin-top: 14px;
}

.unit-title {
  font-size: 18px;
  font-weight: 700;
  color: #32557f;
}

.unit-meta,
.unit-floor,
.unit-sqft,
.unit-address {
  font-size: 14px;
  color: var(--muted);
}

.availability-label {
  font-size: 14px;
  color: var(--text);
}

.availability-block {
  display: grid;
  gap: 6px;
}

.availability-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.availability-badge.is-available {
  background: rgba(107, 143, 88, 0.14);
  color: #456434;
}

.availability-badge.is-unavailable {
  background: #eef2f7;
  color: #64748b;
}

.unit-rent {
  font-size: 18px;
  font-weight: 700;
  color: #32557f;
}

.unit-card-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.unit-card-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #cfd8e3;
  border-radius: 999px;
  background: #ffffff;
  color: #32557f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.unit-card-cta.is-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(31, 79, 130, 0.16);
}

.unit-card.is-available {
  border-left: 4px solid var(--available);
  background: linear-gradient(180deg, #ffffff 0%, #f7fbf5 100%);
}

.unit-card.is-unavailable {
  border-left: 4px solid #d9e1ea;
}

.map svg [id^="_x3"] {
  transition: fill 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease, opacity 0.2s ease;
  shape-rendering: geometricPrecision;
}

.map-unit-available {
  animation: availablePulse 2.4s ease-in-out infinite;
}

.map-unit-selected {
  animation: selectedPulse 1.3s ease-in-out infinite;
}

@keyframes availablePulse {
  0%,
  100% {
    stroke-width: 2.5;
  }
  50% {
    stroke-width: 3.5;
  }
}

@keyframes selectedPulse {
  0%,
  100% {
    stroke-width: 4;
  }
  50% {
    stroke-width: 5;
  }
}

.empty-state {
  padding: 24px 18px;
  border: 1px solid var(--panel-border);
  background: #fff;
  color: var(--muted);
}

#tooltip {
  position: absolute;
  display: none;
  z-index: 999;
  min-width: 260px;
  max-width: 320px;
  padding: 0;
  border: 1px solid rgba(31, 79, 130, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
  font-size: 13px;
  line-height: 1.45;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

#tooltip strong {
  color: #32557f;
}

.map-hover-card {
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, #f8fbff 100%);
}

.map-hover-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.map-hover-card-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7c8ca0;
}

.map-hover-card-title {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1;
  color: #143f6b;
}

.map-hover-card-subtitle {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

.map-hover-points {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(207, 216, 227, 0.8);
}

.map-hover-point {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #274c73;
}

.map-hover-point-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  flex: 0 0 auto;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.map-tip-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.map-tip-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid #cfd8e3;
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.map-tip-button.is-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.map-tip-button.is-disabled {
  opacity: 0.5;
  pointer-events: none;
}

.booking-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.booking-panel {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 249, 255, 0.98) 100%);
}

.booking-panel-eyebrow {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7c8ca0;
}

.booking-panel-title {
  margin: 0;
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
  color: #173f6a;
}

.booking-panel-subtitle {
  margin: 10px 0 0;
  font-size: 15px;
  color: var(--muted);
}

.booking-panel-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(31, 79, 130, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.booking-panel-close:hover {
  background: #1f4f82;
  border-color: #1f4f82;
  color: #ffffff;
  transform: translateY(-1px);
}

.booking-panel-field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.booking-panel-field label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #7c8ca0;
}

.booking-panel-input-wrap {
  padding: 14px 16px;
  border: 1px solid rgba(31, 79, 130, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.booking-panel-field input {
  width: 100%;
  min-height: auto;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #173f6a;
  font-size: 24px;
  font-weight: 600;
}

.booking-panel-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.booking-panel-actions .map-tip-button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 50px;
  border-radius: 14px;
  font-size: 16px;
}

@media (max-width: 1024px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    padding-top: 8px;
  }

  .page-intro {
    padding: 8px 12px 6px;
    margin: 0 8px;
  }

  .page-intro-title {
    font-size: 28px;
  }

  .page-intro-text {
    font-size: 14px;
  }

  .top-filters {
    padding: 31px 22px 24px;
    margin: 0 8px;
    align-items: center;
  }

  .top-filter {
    min-width: 140px;
  }

  .content-layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-basis: auto;
    height: auto;
    border-left: 0;
    border-top: 1px solid var(--panel-border);
    padding: 20px 16px 24px;
  }

  .map {
    min-height: 60vh;
    padding: 16px;
    overflow: visible;
  }

  .map-controls {
    top: 12px;
    right: 12px;
    gap: 8px;
  }

  .map-control-button {
    min-width: 42px;
    height: 42px;
  }

  .map svg {
    max-height: none;
  }

  #tooltip {
    max-width: calc(100vw - 32px);
  }
}