:root {
  --accent: #7dd3f7;
  --accent-hover: #6bc4e8;
  --accent-soft: #eef6fb;
  --btn-muted: #f0f0f0;
  --brand-blue: #4a9fd4;
  --text: #111;
  --muted: #666;
  --border: #ebebeb;
  --surface: #fff;
  --radius: 10px;
  --card-radius: 10px;
  --reel-ratio: 9 / 16;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: "DM Sans", system-ui, sans-serif; color: var(--text); background: #fff; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: 0 1rem;
}

.topbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem 0 0.75rem;
  background: var(--surface);
}
.topbar__profile {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
.topbar__avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.topbar__info { min-width: 0; }
.topbar__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}
.topbar__brokerage {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  color: var(--brand-blue);
  font-weight: 500;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.topbar__btn {
  min-height: 44px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
}
.topbar__btn--contact,
.topbar__btn--links {
  flex: 1;
  padding: 0.65rem 0.5rem;
}
.topbar__btn--contact {
  order: 1;
  background: var(--accent);
  color: #111;
}
.topbar__btn--contact:hover { background: var(--accent-hover); }
.topbar__btn--links {
  order: 2;
  background: var(--accent-soft);
  color: #111;
}
.topbar__btn--links:hover { background: #e3f0f8; }
.topbar__btn--search {
  order: 3;
  flex: 0 0 44px;
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--btn-muted);
  color: #888;
}
.topbar__btn--search:hover { background: #e5e5e5; color: #666; }

.topbar__search { width: 100%; }
.topbar__search input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font: inherit;
  font-size: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.feed { padding: 0.5rem 0 2rem; }
.feed__hint {
  text-align: center;
  font-weight: 700;
  margin: 0 0 1rem;
  font-size: 0.92rem;
  line-height: 1.35;
}
.feed__empty { text-align: center; color: var(--muted); padding: 2rem 0; }
.feed__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.post-card {
  position: relative;
  border: none;
  padding: 0;
  border-radius: var(--card-radius);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #eee;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.post-card::before {
  content: "";
  position: absolute;
  inset: 0 0 55% 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 100%);
  z-index: 1;
  pointer-events: none;
}
.post-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.post-card__badge {
  position: absolute;
  top: 0.45rem;
  left: 0.35rem;
  right: 0.35rem;
  z-index: 2;
  color: #fff;
  font-size: clamp(0.5rem, 2.4vw, 0.72rem);
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  text-transform: lowercase;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

.property-page { padding-bottom: 2rem; }
.property-page__back {
  margin: 0.75rem 0;
  font-weight: 600;
  padding: 0.5rem 0;
  min-height: 44px;
}
.property-page__hero { background: #eee; border-radius: var(--card-radius); overflow: hidden; }
.property-page__cover { width: 100%; max-height: 400px; object-fit: cover; }
.property-page__body { padding: 1.25rem 0; }
.property-page__location {
  margin: 0 0 0.25rem;
  color: var(--brand-blue);
  font-weight: 600;
  text-transform: lowercase;
}
.property-page__price { margin: 0 0 1rem; font-size: 1.75rem; font-weight: 700; }
.property-page__stats {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 1.5rem;
}
.property-page__stats strong { display: block; font-size: 1.2rem; color: var(--text); }
.property-page__stats li { font-size: 0.85rem; color: var(--muted); }

.btn--primary {
  background: var(--accent);
  color: #111;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  width: 100%;
}
.btn--primary:hover { background: var(--accent-hover); }
.btn--full { width: 100%; }

.modal {
  border: none;
  padding: 0;
  width: min(440px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  border-radius: 16px;
  overflow: hidden;
}
.contact-form {
  margin: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 2rem);
}
.contact-form__body {
  padding: 1rem 1.25rem 0.5rem;
  overflow-y: auto;
}
.modal::backdrop { background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(4px); }
.contact-form__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.contact-form__header h2 { margin: 0; font-size: 1.25rem; font-weight: 700; }
.contact-form__close { font-size: 1.5rem; width: 40px; height: 40px; line-height: 1; color: var(--muted); }
.contact-form__footer {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.field { margin-bottom: 0.875rem; border: none; padding: 0; margin-inline: 0; min-width: 0; }
.field label,
.field__label,
.field legend {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  padding: 0;
}
.field legend { float: left; width: 100%; }
.field legend + * { clear: both; }
.required { color: #e53935; }
.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field textarea,
.phone-field__code,
.phone-field__number {
  width: 100%;
  padding: 0.65rem 0.75rem;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  background: #fff;
}
.field textarea { resize: vertical; min-height: 5rem; }
.phone-field { display: flex; gap: 0.5rem; }
.phone-field__code {
  width: auto;
  flex: 0 0 6.5rem;
  padding-right: 0.35rem;
  cursor: pointer;
}
.phone-field__number { flex: 1; min-width: 0; }
.timeline-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
}
.timeline-option {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.timeline-option input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--brand-blue);
}
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--brand-blue);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.segmented label {
  display: block;
  text-align: center;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--brand-blue);
  cursor: pointer;
  margin: 0;
  transition: background 0.15s, color 0.15s;
}
.segmented input:checked + label {
  background: var(--accent);
  color: #111;
}
.btn--contact-submit {
  background: var(--accent);
  color: #111;
  font-weight: 700;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
}
.btn--contact-submit:hover { background: var(--accent-hover); color: #111; }
.contact-form__ok { color: green; font-weight: 600; text-align: center; margin: 1rem 0; }

.modal--links {
  width: min(380px, calc(100vw - 2rem));
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(165deg, #f8fcff 0%, #fff 45%, #fff5fb 100%);
}
#cName{
  width: 100%;
  padding: 0.65rem 0.75rem;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 16px;
  background: #fff;
}
.links-panel { padding: 0; }
.links-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 1.25rem 0.75rem;
  border-bottom: none;
}
.links-panel__header h2 { margin: 0; font-size: 1.15rem; font-weight: 700; }

.links-panel__hero {
  text-align: center;
  padding: 0 1.25rem 1.25rem;
}
.links-panel__avatar {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 0.65rem;
  border: 3px solid #fff;
  box-shadow: 0 8px 24px rgba(74, 159, 212, 0.25);
}
.links-panel__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}
.links-panel__tagline {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.links-panel__grid {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0 1.25rem 1.35rem;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  text-decoration: none;
  color: #111;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}
.link-card__icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.link-card__icon svg {
  width: 22px;
  height: 22px;
}
.link-card__logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}
.link-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.link-card__body strong {
  font-size: 0.95rem;
  font-weight: 700;
}
.link-card__body small {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}
.link-card__go {
  flex-shrink: 0;
  font-size: 1.1rem;
  opacity: 0.45;
  font-weight: 700;
}

.link-card--phone .link-card__icon {
  background: linear-gradient(135deg, #7dd3f7, #4a9fd4);
  color: #fff;
}
.link-card--instagram .link-card__icon {
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
  color: #fff;
}
.link-card--tiktok .link-card__icon {
  background: linear-gradient(135deg, #111, #25f4ee 45%, #fe2c55 100%);
  color: #fff;
}
.link-card--youtube .link-card__icon {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.link-card--instagram:hover { border-color: rgba(221, 42, 123, 0.25); }
.link-card--tiktok:hover { border-color: rgba(254, 44, 85, 0.25); }
.link-card--youtube:hover { border-color: rgba(255, 0, 0, 0.25); }
.link-card--phone:hover { border-color: rgba(74, 159, 212, 0.35); }

@media (min-width: 900px) {
  .app {
    max-width: 1100px;
    padding: 0 2rem;
  }

  .topbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.5rem;
    padding: 1.5rem 0 1rem;
  }

  .topbar__avatar {
    width: 110px;
    height: 110px;
  }

  .topbar__name { font-size: 1.2rem; }

  .topbar__brokerage {
    color: var(--muted);
    font-size: 0.85rem;
  }

  .topbar__actions {
    width: auto;
    gap: 10px;
  }

  .topbar__btn--contact,
  .topbar__btn--links {
    flex: 0 0 auto;
    order: unset;
    padding: 0.7rem 1.35rem;
    min-width: 7.5rem;
  }

  .topbar__btn--links {
    background: var(--btn-muted);
  }

  .topbar__btn--links:hover { background: #e5e5e5; }

  .topbar__btn--search {
    order: unset;
  }

  .topbar__search {
    flex: 1 1 100%;
  }

  .feed {
    padding: 0.75rem 0 2.5rem;
  }

  .feed__hint {
    margin-bottom: 1.5rem;
    font-size: 1rem;
  }

  .feed__grid {
    gap: 18px;
    max-width: 900px;
    margin: 0 auto;
  }

  .post-card {
    aspect-ratio: var(--reel-ratio);
    border-radius: 16px;
  }

  .post-card__badge {
    top: 0.65rem;
    font-size: 0.72rem;
    letter-spacing: 0.02em;
  }
}
