:root {
  --ink: #172026;
  --muted: #66747f;
  --paper: #f4f7f5;
  --panel: #ffffff;
  --line: #dbe3e0;
  --accent: #176b87;
  --accent-dark: #0f4f68;
  --gold: #f0b35a;
  --sky: #e4f1f4;
  --mint: #dff4e8;
  --danger: #b94b45;
  --shadow: 0 18px 50px rgba(20, 35, 42, .12);
  --shadow-soft: 0 10px 26px rgba(20, 35, 42, .09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(240, 179, 90, .15), transparent 28%),
    linear-gradient(180deg, color-mix(in srgb, var(--paper) 94%, #fff), var(--paper));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body[data-motion="off"] *, body[data-motion="off"] *::before, body[data-motion="off"] *::after {
  animation: none !important;
  transition: none !important;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img { display: block; max-width: 100%; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 56px);
  background: color-mix(in srgb, var(--panel) 86%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  backdrop-filter: blur(18px) saturate(1.18);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 205px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  font-weight: 800;
  box-shadow: var(--shadow-soft);
}

.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: 12px; }

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  color: #34423e;
  font-size: 15px;
}

.nav a { white-space: nowrap; }
.nav a, .primary-btn, .secondary-btn, .filter, .tab, .small-btn, .apartment-card, .day {
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease, color .2s ease;
}
.nav a:hover { color: var(--accent); transform: translateY(-1px); }

.hero {
  position: relative;
  min-height: min(760px, calc(100vh - 70px));
  display: flex;
  align-items: flex-end;
  padding: clamp(26px, 5vw, 70px);
  overflow: hidden;
  color: #fff;
}

.hero img, .hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero img { object-fit: cover; }

.hero-shade {
  background:
    linear-gradient(90deg, rgba(9, 20, 28, .84) 0%, rgba(9, 20, 28, .42) 48%, rgba(9, 20, 28, .08) 100%),
    linear-gradient(0deg, rgba(9, 20, 28, .78), rgba(9, 20, 28, 0) 52%);
}

body[data-hero-tone="soft"] .hero-shade {
  background:
    linear-gradient(90deg, rgba(14, 48, 60, .66) 0%, rgba(14, 48, 60, .3) 58%, rgba(14, 48, 60, .08) 100%),
    linear-gradient(0deg, rgba(14, 48, 60, .55), rgba(14, 48, 60, 0) 52%);
}

body[data-hero-tone="clear"] .hero-shade {
  background:
    linear-gradient(90deg, rgba(10, 20, 24, .58) 0%, rgba(10, 20, 24, .18) 64%, rgba(10, 20, 24, .02) 100%),
    linear-gradient(0deg, rgba(10, 20, 24, .45), rgba(10, 20, 24, 0) 54%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(680px, 100%);
  padding-bottom: 34px;
  animation: rise-in .7s ease both;
}

.eyebrow, .section-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 16px; font-size: clamp(42px, 7vw, 86px); line-height: .95; letter-spacing: 0; }
h2 { margin-bottom: 16px; font-size: clamp(30px, 4vw, 52px); line-height: 1; letter-spacing: 0; }
h3 { margin-bottom: 10px; font-size: 22px; }

.hero-content p:not(.eyebrow) {
  max-width: 610px;
  color: rgba(255, 255, 255, .86);
  font-size: clamp(17px, 2vw, 21px);
}

.hero-actions, .contact-actions, .admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.primary-btn, .secondary-btn, .ghost-btn, .filter, .tab, .icon-btn {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  min-height: 44px;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 78%, #000));
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 28%, transparent);
  font-weight: 750;
}
.primary-btn:hover, .secondary-btn:hover, .filter:hover, .tab:hover, .small-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.primary-btn:disabled {
  cursor: not-allowed;
  background: #9ca9a5;
  box-shadow: none;
}

.secondary-btn, .ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, .74);
  border: 1px solid var(--line);
  font-weight: 700;
}

.hero .secondary-btn { color: #fff; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); }

.full { width: 100%; }

.hero-panel {
  position: absolute;
  right: clamp(18px, 5vw, 70px);
  bottom: 26px;
  z-index: 2;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 470px;
}

.hero-panel span {
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 8px;
  background: rgba(255, 255, 255, .14);
  backdrop-filter: blur(14px) saturate(1.2);
  font-weight: 700;
}

.section {
  padding: clamp(56px, 8vw, 110px) clamp(18px, 4vw, 56px);
}

.about-grid, .booking-layout, .contacts, .agent-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr);
  gap: clamp(24px, 5vw, 70px);
  align-items: start;
}

.section p { color: var(--muted); font-size: 17px; }

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 28px;
}

.facts div, .about-card, .calendar-shell, .booking-form, .amenities-grid div, .admin-dialog, .login-box, .admin-form, .admin-list article, .agent-chat {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.facts div { padding: 18px; box-shadow: none; }
.facts strong { display: block; font-size: 30px; color: var(--accent-dark); }
.facts span { color: var(--muted); }

.about-card { padding: 18px; }
.coords { color: var(--accent-dark) !important; font-weight: 800; }

iframe {
  width: 100%;
  min-height: 340px;
  border: 0;
  border-radius: 8px;
  background: var(--sky);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 26px;
}

.filters, .admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter, .tab {
  padding: 10px 13px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 750;
}

.filter.active, .tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: var(--accent);
}

.apartments-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.apartment-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  animation: rise-in .55s ease both;
}
.apartment-card:hover { transform: translateY(-5px); box-shadow: 0 24px 60px rgba(20, 35, 42, .16); }

.apartment-gallery {
  display: grid;
  grid-template-columns: 1fr 82px;
  grid-template-rows: repeat(3, 1fr);
  gap: 4px;
  height: clamp(230px, 27vw, 320px);
  background: var(--line);
}

.apartment-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.apartment-gallery img:first-child { grid-row: 1 / -1; }
.apartment-gallery img:only-child { grid-column: 1 / -1; }

.apartment-body { padding: 18px; }
.apartment-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.pill { padding: 6px 9px; border-radius: 8px; background: var(--sky); color: var(--accent-dark); font-size: 13px; font-weight: 750; }
.price { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; }
.price strong { font-size: 24px; }

.booking-form { padding: 18px; margin-top: 24px; box-shadow: none; }
label { display: grid; gap: 7px; color: #35423f; font-weight: 750; }

input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid #cfc7bd;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.booking-form > label, .booking-form > .form-note, .booking-form > button { margin-top: 12px; }
.form-note { margin: 12px 0 0; color: var(--muted); font-size: 14px !important; }
.email-check {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.calendar-shell { padding: 18px; }
.calendar-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.icon-btn { width: 44px; padding: 0; background: #fff; border: 1px solid var(--line); font-size: 28px; line-height: 1; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; color: var(--muted); font-size: 14px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.dot.free { background: #fff; border: 1px solid var(--accent); }
.dot.chosen { background: var(--accent); }
.dot.busy { background: #c9c1b6; }

.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.day-name, .day {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 8px;
}

.day-name { color: var(--muted); font-size: 13px; font-weight: 800; }
.day { border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 750; }
.day:hover { border-color: var(--accent); }
.day.empty { visibility: hidden; pointer-events: none; }
.day.busy, .day.past { cursor: not-allowed; color: #8a8178; background: #ded8ce; text-decoration: line-through; }
.day.selected, .day.in-range { color: #fff; background: var(--accent); border-color: var(--accent); text-decoration: none; }
.day.check-out { background: var(--gold); border-color: var(--gold); }

.busy-list { margin-top: 14px; color: var(--muted); font-size: 14px; }

.amenities { background: linear-gradient(135deg, var(--mint), color-mix(in srgb, var(--sky) 78%, #fff)); }
.amenities-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.amenities-grid div { padding: 18px; box-shadow: none; }
.amenities-grid strong, .amenities-grid span { display: block; }
.amenities-grid span { margin-top: 8px; color: var(--muted); }

.contacts {
  align-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-dark) 92%, #000), var(--accent)),
    var(--accent-dark);
  color: #fff;
}
.contacts p { color: rgba(255, 255, 255, .76); }
.contacts .secondary-btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .32); }

.agent-section { background: color-mix(in srgb, var(--panel) 86%, var(--gold)); }
.agent-chat { padding: 16px; box-shadow: none; }
.chat-log {
  display: grid;
  gap: 10px;
  min-height: 230px;
  max-height: 360px;
  overflow: auto;
  padding: 4px;
}
.message {
  max-width: 86%;
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--sky);
  color: var(--ink);
}
.message.user {
  justify-self: end;
  color: #fff;
  background: var(--accent);
}
.panel-note {
  padding: 12px 14px;
  border: 1px dashed color-mix(in srgb, var(--gold) 55%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, var(--gold) 12%, var(--panel));
  color: var(--ink);
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.5;
}
.vars-box {
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--sky) 45%, var(--panel));
  color: var(--ink);
  font-size: 13px;
  margin-bottom: 14px;
  line-height: 1.7;
}
.vars-box code {
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
}
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  color: var(--ink);
  background: color-mix(in srgb, var(--gold) 35%, transparent);
  vertical-align: middle;
}
.admin-scripts, .admin-templates {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}
.script-card, .template-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}
.script-card textarea, .template-card textarea {
  resize: vertical;
}
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.admin-chat {
  padding: 16px;
  box-shadow: none;
  background: var(--panel);
  border-radius: 12px;
  border: 1px solid var(--line);
}
.admin-chat .chat-log {
  min-height: 280px;
  max-height: 460px;
}
.booking-send {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.booking-send select {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  max-width: 280px;
}
.message.thinking {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 12px;
}
.message.thinking .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  opacity: .35;
  animation: thinking-bounce 1.2s infinite ease-in-out;
}
.message.thinking .dot:nth-child(2) { animation-delay: .15s; }
.message.thinking .dot:nth-child(3) { animation-delay: .3s; }
@keyframes thinking-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-5px); opacity: 1; }
}
.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  padding: 20px;
  background: rgba(9, 17, 15, .58);
  overflow: auto;
}
.admin-page { background: #eef3f1; }
.admin-standalone {
  min-height: 100vh;
  padding: clamp(18px, 4vw, 48px);
}
.admin-modal.open { display: block; }
.admin-dialog { width: min(1100px, 100%); margin: 0 auto; padding: 20px; }
.admin-head { display: flex; justify-content: space-between; gap: 16px; align-items: start; margin-bottom: 16px; }
.login-box, .admin-form { padding: 16px; box-shadow: none; }
.login-box { display: grid; gap: 12px; max-width: 470px; }
.hidden { display: none !important; }
.admin-tabs { margin-bottom: 14px; }
.admin-section { display: none; }
.admin-section.active { display: block; }
.admin-form { display: grid; gap: 12px; margin-bottom: 16px; }
.checkline { display: flex; grid-template-columns: none; align-items: center; gap: 8px; }
.checkline input { width: 18px; min-height: 18px; }
.admin-list { display: grid; gap: 10px; }
.admin-list article { padding: 14px; box-shadow: none; }
.admin-item-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.admin-item-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.small-btn { min-height: 36px; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 750; }
.small-btn.danger { color: #fff; background: var(--danger); border-color: var(--danger); }

.photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.photo-strip figure, .hero-preview {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.photo-strip img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-strip button { width: calc(100% - 12px); margin: 6px; }

.hero-preview img {
  width: 100%;
  max-height: 320px;
  object-fit: cover;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 70;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  max-width: min(520px, calc(100vw - 28px));
  padding: 12px 16px;
  border-radius: 8px;
  color: #fff;
  background: var(--accent-dark);
  box-shadow: var(--shadow);
  transition: .2s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes rise-in {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

@media (max-width: 980px) {
  .topbar, .nav { align-items: flex-start; }
  .topbar { flex-direction: column; }
  .nav { width: 100%; overflow-x: auto; padding-bottom: 4px; }
  .hero { min-height: 720px; }
  .hero-panel { left: clamp(18px, 5vw, 70px); right: auto; }
  .about-grid, .booking-layout, .contacts, .agent-section { grid-template-columns: 1fr; }
  .apartments-grid, .amenities-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .apartment-gallery { grid-template-columns: 1fr 70px; height: 270px; }
}

@media (max-width: 640px) {
  .brand { min-width: 0; }
  .nav { gap: 10px; font-size: 14px; }
  .hero { min-height: 680px; align-items: center; }
  .hero-content { padding-bottom: 120px; }
  .hero-panel { bottom: 18px; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .facts, .apartments-grid, .amenities-grid, .form-row { grid-template-columns: 1fr; }
  .apartment-gallery { grid-template-columns: 1fr; grid-template-rows: none; height: auto; }
  .apartment-gallery img { aspect-ratio: 4 / 3; }
  .apartment-gallery img:not(:first-child) { display: none; }
  .chat-form { grid-template-columns: 1fr; }
  .email-check { grid-template-columns: 1fr; }
  .calendar { gap: 4px; }
  .day-name, .day { min-height: 38px; font-size: 14px; }
  .admin-modal { padding: 10px; }
}
