:root {
  --ink: #1f2926;
  --muted: #6d7671;
  --paper: #f5f2eb;
  --panel: #fffefa;
  --line: #deddd6;
  --accent: #f05a35;
  --accent-dark: #cf3f1c;
  --green: #204f42;
  --shadow: 0 18px 45px rgba(34, 45, 40, 0.14);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
  font: inherit;
}

.app-shell {
  min-height: 100dvh;
}

.map-panel {
  position: relative;
  min-height: 62dvh;
  overflow: hidden;
  background: #c8d2c9;
}

#map {
  width: 100%;
  height: 62dvh;
  min-height: 440px;
  background: #cdd8cf;
}

.home-marker-wrap {
  background: transparent;
  border: 0;
}

.company-marker-wrap {
  background: transparent;
  border: 0;
}

.company-marker {
  position: relative;
  display: grid;
  width: 118px;
  height: 43px;
  place-items: center;
  padding: 9px 13px;
  border: 2px solid #1f7a68;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 9px 24px rgba(24, 75, 64, 0.3);
  transform: translate(-38px, -17px);
}

.company-marker::after {
  position: absolute;
  bottom: -9px;
  left: 50%;
  width: 14px;
  height: 14px;
  border-right: 2px solid #1f7a68;
  border-bottom: 2px solid #1f7a68;
  background: #fff;
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.company-marker img {
  position: relative;
  z-index: 1;
  display: block;
  width: 91px;
  height: auto;
}

.place-marker-wrap {
  background: transparent;
  border: 0;
}

.university-marker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  min-width: 120px;
  height: 43px;
  padding: 5px 11px 5px 5px;
  border: 2px solid #fff;
  border-radius: 100px;
  color: #fff;
  background: #244f91;
  box-shadow: 0 9px 24px rgba(25, 62, 119, 0.34);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
  transform: translate(-31px, -16px);
}

.university-marker::after {
  position: absolute;
  bottom: -8px;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 9px solid #244f91;
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
  content: "";
  transform: translateX(-50%);
}

.university-marker-logo {
  display: block;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
}

.home-marker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  width: max-content;
  padding: 7px 12px 7px 7px;
  border: 2px solid #fff;
  border-radius: 100px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 20px rgba(142, 48, 22, 0.34);
  font-size: 12px;
  font-weight: 800;
  transform: translate(-9px, -12px);
}

.home-marker::after {
  position: absolute;
  bottom: -8px;
  left: 17px;
  width: 0;
  height: 0;
  border-top: 9px solid var(--accent);
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
  content: "";
}

.home-marker-pin {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  color: var(--accent);
  background: #fff;
  font-size: 11px;
}

.home-marker-dot {
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 4px 10px rgba(142, 48, 22, 0.42);
  transition: transform 150ms ease;
}

.home-marker-dot:hover {
  transform: scale(1.35);
}

.leaflet-popup-content-wrapper {
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.leaflet-popup-content {
  margin: 13px 15px;
  font-family: inherit;
}

.popup-title {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.popup-copy {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.popup-link {
  padding: 6px 8px;
  border-radius: 7px;
  color: #fff !important;
  background: var(--green);
  font-size: 10px;
  font-weight: 800;
  text-decoration: none !important;
}

.details-panel {
  position: relative;
  z-index: 600;
  margin-top: -16px;
  padding: 27px 18px 30px;
  border-radius: 24px 24px 0 0;
  background: var(--paper);
}

.details-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 0 2px 19px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.details-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(27px, 8vw, 38px);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.area-chip {
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--muted);
  background: #eeece5;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.area-chip:hover {
  border-color: #aab8b1;
  color: var(--green);
  background: #fffefa;
}

.property-list {
  display: grid;
  gap: 16px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 22px;
}

.pagination-button {
  display: grid;
  min-width: 38px;
  height: 40px;
  padding: 0 9px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  background: var(--panel);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.pagination-button:hover:not(:disabled) {
  border-color: var(--green);
  color: var(--green);
}

.pagination-button.is-current {
  border-color: var(--green);
  color: #fff;
  background: var(--green);
}

.pagination-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.pagination-ellipsis {
  display: grid;
  width: 18px;
  height: 40px;
  place-items: center;
  color: var(--muted);
}

.property-card {
  overflow: hidden;
  border: 1px solid rgba(222, 221, 214, 0.9);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 12px 35px rgba(42, 49, 45, 0.08);
}

.image-wrap {
  position: relative;
  display: block;
  width: 100%;
  height: 220px;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #d9ddd8;
  cursor: pointer;
}

.property-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 350ms ease;
}

.image-wrap:hover .property-image {
  transform: scale(1.025);
}

.image-badge,
.image-index {
  position: absolute;
  top: 14px;
  padding: 7px 9px;
  border-radius: 100px;
  color: #fff;
  background: rgba(31, 41, 38, 0.78);
  font-size: 10px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.image-badge {
  left: 14px;
  background: var(--accent);
}

.image-index {
  right: 14px;
}

.property-content {
  padding: 20px;
}

.property-meta-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.property-type,
.property-number {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.property-type {
  color: var(--green);
}

.property-price {
  margin: 0 0 8px;
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: -0.05em;
}

.property-location {
  margin: 0 0 11px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}

.property-description {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  word-break: keep-all;
}

.feature-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}

.feature {
  padding: 7px 9px;
  border-radius: 8px;
  color: #4d5853;
  background: #f0eee8;
  font-size: 11px;
  font-weight: 700;
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 17px;
  padding: 12px 13px;
  border-radius: 11px;
  color: var(--muted);
  background: #f5f3ed;
  font-size: 12px;
}

.property-phone {
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.01em;
}

.card-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  margin-top: 12px;
}

.card-actions.no-phone {
  grid-template-columns: minmax(0, 1fr) auto;
}

.primary-action,
.phone-action,
.copy-action {
  min-height: 50px;
  border-radius: 13px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.primary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: var(--green);
  text-decoration: none;
  transition: background 180ms ease, transform 180ms ease;
}

.phone-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 13px;
  border: 1px solid var(--green);
  color: var(--green);
  background: transparent;
  text-decoration: none;
}

.phone-action:hover {
  color: #fff;
  background: var(--green);
}

.primary-action:hover {
  background: #153d33;
}

.primary-action:active,
.phone-action:active,
.copy-action:active {
  transform: scale(0.98);
}

.copy-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 15px;
  border: 1px solid var(--line);
  background: transparent;
}

.copy-action:hover {
  background: #f3f1eb;
}

.note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 22px;
  padding: 0 5px;
  color: #7a817e;
}

.note > span {
  display: grid;
  flex: 0 0 auto;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid #a4aaa7;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-size: 11px;
  font-style: italic;
}

.note p {
  margin: 0;
  font-size: 10px;
  line-height: 1.55;
  word-break: keep-all;
}

.toast {
  position: fixed;
  z-index: 1000;
  bottom: 24px;
  left: 50%;
  padding: 12px 17px;
  border-radius: 100px;
  color: #fff;
  background: rgba(31, 41, 38, 0.94);
  box-shadow: var(--shadow);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 15px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

:focus-visible {
  outline: 3px solid rgba(240, 90, 53, 0.45);
  outline-offset: 3px;
}

@media (min-width: 760px) {
  .app-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(390px, 0.75fr);
    height: 100dvh;
    overflow: hidden;
  }

  .map-panel {
    min-height: 100dvh;
  }

  #map {
    height: 100dvh;
  }

  .details-panel {
    height: 100dvh;
    margin: 0;
    overflow-y: auto;
    padding: 50px 30px 38px;
    border-left: 1px solid var(--line);
    border-radius: 0;
  }

  .details-header {
    margin-bottom: 25px;
  }

  .details-header h2 {
    font-size: 40px;
  }

  .image-wrap {
    height: min(26vh, 260px);
  }
}

@media (min-width: 1180px) {
  .app-shell {
    grid-template-columns: minmax(0, 1.7fr) 470px;
  }

  .details-panel {
    padding-right: 36px;
    padding-left: 36px;
  }
}

@media (max-width: 390px) {
  .card-actions {
    grid-template-columns: 1fr 1fr;
  }

  .primary-action {
    grid-column: 1 / -1;
  }

  .card-actions.no-phone .copy-action {
    grid-column: 1 / -1;
  }

  .copy-label {
    display: inline;
  }

  .phone-action,
  .copy-action {
    justify-content: center;
    padding: 0 10px;
  }

  .image-wrap {
    height: 205px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
