/* Terravista Go rewrite — faithful port of the original Tailwind styling */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --background: #fdfcf8;
  --foreground: #1a1a1a;
  --primary: #1A3C34;
  --primary-foreground: #ffffff;
  --secondary: #D4AF37;
  --secondary-foreground: #ffffff;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --card: #ffffff;
  --border: #e4e4e7;
  --radius: 2rem;
}

html { scroll-behavior: smooth; }

body {
  background: var(--background);
  color: var(--foreground);
  font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 { font-family: "Outfit", ui-sans-serif, system-ui, sans-serif; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container { max-width: 80rem; margin: 0 auto; padding-left: 1.5rem; padding-right: 1.5rem; }

.accent { color: var(--secondary); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.5rem; border-radius: 9999px; font-weight: 500;
  transition: all 0.3s; transform: translateZ(0);
}
.btn:active { transform: scale(0.95); }
.btn-sm { height: 2.25rem; padding: 0 1rem; font-size: 0.875rem; }
.btn-md { height: 2.75rem; padding: 0 1.5rem; font-size: 1rem; }
.btn-lg { height: 3.5rem; padding: 0 2rem; font-size: 1.125rem; }
.btn-primary { background: var(--primary); color: var(--primary-foreground); box-shadow: 0 10px 15px -3px rgba(26,60,52,.2); }
.btn-primary:hover { background: rgba(26,60,52,.9); }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); box-shadow: 0 10px 15px -3px rgba(212,175,55,.2); font-weight: 700; }
.btn-secondary:hover { background: rgba(212,175,55,.9); }
.btn-outline { border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: rgba(26,60,52,.05); }
.btn-glass { background: rgba(255,255,255,.2); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.3); color: #fff; }
.btn-glass:hover { background: rgba(255,255,255,.3); }
.btn-block { width: 100%; }

/* ---- Navbar ---- */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 1rem 1.5rem 1rem 1.5rem; transition: all 0.3s;
}
.navbar.scrolled {
  background: rgba(255,255,255,.8); backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0,0,0,.1); padding-top: 0.5rem; padding-bottom: 0.5rem;
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.brand { font-family: "Outfit", sans-serif; font-size: 1.5rem; font-weight: 800; letter-spacing: -0.03em; color: #fff; transition: color .3s; }
.navbar.scrolled .brand { color: var(--primary); }
.navbar.scrolled .nav-links a { color: rgba(26,60,52,.8); }
.nav-links { display: none; gap: 2rem; }
.nav-links a { font-size: .875rem; font-weight: 500; color: rgba(255,255,255,.9); transition: color .3s; }
.nav-links a:hover { color: var(--secondary); }
@media (min-width: 768px) { .nav-links { display: flex; } }

/* ---- Hero ---- */
.hero { position: relative; height: 100vh; width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: 0; will-change: transform; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.3); }
.hero-content { position: relative; z-index: 10; color: #fff; text-align: center; }
.hero-badge { display: inline-block; padding: .5rem 1rem; border-radius: 9999px; background: rgba(0,0,0,.4); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.2); font-size: .75rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 2rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,.1); }
.hero-content h1 { font-size: 3rem; font-weight: 800; letter-spacing: -0.04em; margin-bottom: 2rem; line-height: 1.05; background: linear-gradient(to bottom, #fff, rgba(255,255,255,.8)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-content p { font-size: 1.125rem; color: rgba(255,255,255,.9); max-width: 42rem; margin: 0 auto 3rem; font-weight: 300; line-height: 1.7; }
.hero-actions { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem; }
.hero-actions .btn-secondary { color: #0f172a; }
@media (min-width: 640px) { .hero-actions { flex-direction: row; } .hero-content h1 { font-size: 4rem; } }
@media (min-width: 1024px) { .hero-content h1 { font-size: 6rem; } }
.scroll-indicator { position: absolute; bottom: 3rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .5rem; opacity: 0; animation: fadeIn 1.5s 2s forwards; }
.scroll-indicator span { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.6); }
.scroll-line { width: 1px; height: 6rem; background: linear-gradient(to bottom, rgba(255,255,255,.5), transparent); }
@keyframes fadeIn { to { opacity: 1; } }

/* ---- Sections ---- */
.section { padding: 8rem 0; }
.section-primary { background: var(--primary); color: #fff; position: relative; overflow: hidden; }
.section-muted { background: rgba(244,244,245,.3); }
.noise { position: absolute; inset: 0; background: url('/patterns/noise.webp') repeat; opacity: .1; }
.section-head { text-align: center; margin-bottom: 5rem; }
.eyebrow { display: block; color: var(--primary); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: .875rem; margin-bottom: .75rem; }
.section-head h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .section-head h2 { font-size: 3.75rem; } }
.section-head p { color: var(--muted-foreground); font-size: 1.125rem; max-width: 42rem; margin: 0 auto; }
.service-head { max-width: 42rem; margin-bottom: 5rem; }
.service-head h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1.5rem; }
@media (min-width: 768px) { .service-head h2 { font-size: 3.75rem; } }
.service-head p { color: rgba(255,255,255,.8); font-size: 1.125rem; }

/* ---- Apartment cards ---- */
.apartment-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
@media (min-width: 768px) { .apartment-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .apartment-grid { grid-template-columns: repeat(4, 1fr); } }
.apt-card {
  position: relative; border-radius: var(--radius); overflow: hidden; background: #fff;
  box-shadow: 0 10px 15px -3px rgba(0,0,0,.1); transition: all .5s; cursor: pointer;
  display: flex; flex-direction: column; height: 100%; opacity: 0; transform: translateY(30px);
}
.apt-card.reveal { opacity: 1; transform: translateY(0); transition: opacity .7s, transform .7s, box-shadow .5s; }
.apt-card:hover { box-shadow: 0 20px 30px -5px rgba(26,60,52,.1); transform: translate(-2px,-8px) !important; }
.apt-img { position: relative; height: 18rem; overflow: hidden; background: #f3f4f6; }
.apt-img img { width: 100%; height: 100%; object-fit: cover; transition: opacity 1.5s; }
.apt-img .shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.8), transparent); opacity: .6; transition: opacity .5s; z-index: 10; }
.apt-card:hover .apt-img .shade { opacity: .4; }
.apt-badge { position: absolute; top: 1rem; right: 1rem; z-index: 20; background: rgba(22,163,74,.9); backdrop-filter: blur(12px); color: #fff; padding: .5rem .75rem; border-radius: .75rem; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; text-align: center; border: 1px solid rgba(255,255,255,.2); }
.apt-badge small { font-size: 10px; background: rgba(255,255,255,.2); border-radius: .25rem; padding: .125rem .5rem; display: inline-block; }
.apt-price { position: absolute; bottom: 1.25rem; left: 1.25rem; color: #fff; z-index: 20; background: rgba(255,255,255,.2); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.2); padding: .375rem 1rem; border-radius: 9999px; font-size: .875rem; font-weight: 800; box-shadow: 0 10px 15px -3px rgba(0,0,0,.1); }
.apt-body { padding: 2rem; }
.apt-title { font-size: 1.25rem; font-weight: 800; margin-bottom: .5rem; transition: color .3s; }
.apt-card:hover .apt-title { color: var(--primary); }
.apt-loc { display: flex; align-items: center; color: var(--muted-foreground); font-size: .875rem; font-weight: 500; gap: .5rem; }
.apt-meta { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 0; border-top: 1px solid rgba(228,228,231,.5); margin-top: 1.25rem; }
.apt-meta span { display: flex; align-items: center; gap: .375rem; font-size: .875rem; color: rgba(26,26,26,.8); font-weight: 500; }
.apt-meta strong { color: var(--primary); }
.apt-view { margin-top: .5rem; }

/* ---- Bento grid ---- */
.bento-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; max-width: 80rem; margin: 0 auto; }
@media (min-width: 768px) { .bento-grid { grid-template-columns: repeat(3,1fr); grid-auto-rows: 18rem; } }
.bento-item {
  position: relative; border-radius: 1.5rem; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  padding: 1rem; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); backdrop-filter: blur(12px); box-shadow: 0 0 0 0 rgba(0,0,0,0); transition: box-shadow .2s; opacity: 0; transform: translateY(20px);
}
.bento-item.reveal { opacity: 1; transform: translateY(0); transition: opacity .6s, transform .6s, box-shadow .2s; }
.bento-item:hover { box-shadow: 0 20px 25px -5px rgba(0,0,0,.1); }
.bento-wide { grid-column: span 1; }
@media (min-width: 768px) { .bento-wide { grid-column: span 2; } }
.bento-img { position: relative; flex: 1; min-height: 6rem; border-radius: .75rem; overflow: hidden; }
.bento-img img { width: 100%; height: 100%; object-fit: cover; opacity: .8; transition: transform .5s; }
.bento-item:hover .bento-img img { transform: scale(1.1); }
.bento-shade { position: absolute; inset: 0; background: rgba(0,0,0,.2); }
.bento-content { padding-top: 1rem; display: flex; flex-direction: column; }
.bento-icon { font-size: 2rem; color: var(--secondary); }
.bento-content h3 { font-size: 1.25rem; color: #fff; margin: .5rem 0 .5rem 0; font-weight: 700; }
.bento-content p { color: rgba(255,255,255,.6); font-size: .875rem; }

/* ---- Booking ---- */
.booking-layout { display: flex; flex-direction: column; gap: 3rem; align-items: center; }
@media (min-width: 768px) { .booking-layout { flex-direction: row; } }
.booking-info, .booking-form-wrap { flex: 1; width: 100%; }
.booking-info h2 { font-size: 2.5rem; font-weight: 800; margin-bottom: 1.5rem; color: var(--primary); }
.booking-info > p { font-size: 1.125rem; color: var(--muted-foreground); margin-bottom: 2rem; }
.info-card { background: #fff; padding: 1.5rem; border-radius: 1rem; box-shadow: 0 1px 2px rgba(0,0,0,.05); border: 1px solid rgba(228,228,231,.4); display: flex; gap: 1.25rem; align-items: flex-start; margin-bottom: 1rem; }
.info-card:hover { box-shadow: 0 4px 6px rgba(0,0,0,.1); }
.info-icon { width: 3rem; height: 3rem; border-radius: 9999px; background: rgba(26,60,52,.1); display: flex; align-items: center; justify-content: center; font-size: 1.25rem; flex-shrink: 0; }
.info-card h3 { font-weight: 800; font-size: 1.125rem; margin-bottom: .25rem; }
.info-phone { font-weight: 500; font-size: 1.25rem; display: block; margin-bottom: .5rem; }
.info-phone:hover { color: var(--primary); }
.info-text { font-weight: 500; font-size: 1.125rem; color: var(--foreground); }
.info-link { color: var(--primary); font-weight: 600; font-size: .875rem; margin-top: .5rem; display: inline-block; }
.info-link:hover { text-decoration: underline; }
.info-strong { font-weight: 600; color: var(--foreground); font-size: .875rem; }
.muted-sm { font-size: .875rem; color: var(--muted-foreground); }
.acct { font-family: ui-monospace, monospace; font-size: 1.25rem; font-weight: 800; color: var(--primary); letter-spacing: .05em; }
.info-badges { display: flex; gap: .75rem; margin-top: .25rem; }
.badge { display: inline-flex; align-items: center; gap: .375rem; padding: .375rem .75rem; border-radius: 9999px; font-size: .875rem; font-weight: 500; }
.badge-green { background: #dcfce7; color: #15803d; } .badge-green:hover { background: #bbf7d0; }
.badge-blue { background: #dbeafe; color: #1d4ed8; } .badge-blue:hover { background: #bfdbfe; }
.map-wrap { border-radius: .75rem; overflow: hidden; height: 12rem; background: #f1f5f9; margin-bottom: 1rem; }
.booking-form { background: #fff; padding: 2rem; border-radius: 1.5rem; box-shadow: 0 20px 25px -5px rgba(0,0,0,.1); border: 1px solid rgba(228,228,231,.5); display: flex; flex-direction: column; gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.field { display: flex; flex-direction: column; gap: .5rem; }
.field label { font-size: .875rem; font-weight: 500; }
.field input, .field select { width: 100%; padding: .75rem 1rem; border-radius: .5rem; border: 1px solid var(--border); outline: none; transition: all .2s; font-family: inherit; font-size: 1rem; background: #fff; }
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(26,60,52,.2); }
.form-status { font-size: .9rem; text-align: center; margin-top: .5rem; }
.form-status.error { color: #dc2626; }
.form-status.success { color: #15803d; }

/* ---- Modal ---- */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.8); backdrop-filter: blur(12px); z-index: 50; animation: fadeIn .3s; }
.modal { position: fixed; inset: 0; z-index: 51; display: flex; align-items: center; justify-content: center; padding: 1rem; pointer-events: none; }
.modal-card {
  background: rgba(255,255,255,.95); backdrop-filter: blur(24px); width: 100%; max-width: 64rem;
  max-height: 90vh; overflow-y: auto; border-radius: 1.5rem; box-shadow: 0 25px 50px -12px rgba(0,0,0,.25);
  pointer-events: auto; display: flex; flex-direction: column; animation: modalin .3s;
}
@keyframes modalin { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-hero { position: relative; height: 18rem; width: 100%; flex-shrink: 0; }
@media (min-width: 768px) { .modal-hero { height: 500px; } }
.modal-hero img { width: 100%; height: 100%; object-fit: cover; }
.modal-close { position: absolute; top: 1.5rem; right: 1.5rem; background: rgba(0,0,0,.2); color: #fff; padding: .5rem; border-radius: 9999px; transition: all .2s; backdrop-filter: blur(12px); z-index: 20; font-size: 1.25rem; line-height: 1; }
.modal-close:hover { background: rgba(0,0,0,.4); }
.modal-gallery-btn { position: absolute; bottom: 1.5rem; right: 1.5rem; background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(12px); padding: .75rem 1.5rem; border-radius: 9999px; font-weight: 500; z-index: 20; transition: all .2s; }
.modal-gallery-btn:hover { transform: scale(1.05); }
.modal-hero .title-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.9), rgba(0,0,0,.2), transparent); }
.modal-hero .title-text { position: absolute; bottom: 0; left: 0; right: 0; padding: 2rem 3rem; color: #fff; z-index: 10; }
.modal-hero .title-text h2 { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: .75rem; }
.modal-hero .title-text p { font-size: 1.25rem; font-weight: 300; display: flex; align-items: center; gap: .5rem; }
.exclusive { background: rgba(26,60,52,.8); padding: .25rem .75rem; border-radius: .375rem; font-size: .875rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.modal-body { padding: 2rem 3rem; display: grid; grid-template-columns: 1fr; gap: 3rem; }
@media (min-width: 768px) { .modal-body { grid-template-columns: 1fr 350px; } }
.modal-body h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: 1rem; }
.modal-body .exp { color: var(--muted-foreground); line-height: 1.7; font-size: 1.125rem; }
.amenities { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-top: 2.5rem; }
.amenity { display: flex; align-items: center; gap: 1rem; color: rgba(26,26,26,.8); padding: .75rem; border-radius: .75rem; }
.amenity:hover { background: #f8fafc; }
.amenity .ic { background: rgba(26,60,52,.1); padding: .75rem; border-radius: 9999px; color: var(--primary); flex-shrink: 0; }
.amenity:hover .ic { background: var(--primary); color: #fff; }
.amenity span { font-weight: 500; }
.sidebar { background: #f8fafc; padding: 2rem; border-radius: 1.5rem; border: 1px solid #f1f5f9; height: fit-content; }
.sidebar .from { font-size: .875rem; color: var(--muted-foreground); font-weight: 500; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .25rem; }
.sidebar .price { font-size: 2.25rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; margin-bottom: 2rem; }
.sidebar .row { display: flex; justify-content: space-between; padding: .75rem 0; border-bottom: 1px solid #e2e8f0; }
.sidebar .row span { color: var(--muted-foreground); }
.sidebar .row strong { font-size: 1.125rem; }
.sidebar .reserve { width: 100%; margin-top: 1.5rem; }
.sidebar .instant { font-size: .75rem; text-align: center; color: var(--muted-foreground); margin-top: 1rem; }

/* ---- Gallery overlay ---- */
.gallery { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; animation: fadeIn .3s; }
.gallery-head { position: absolute; top: 0; left: 0; right: 0; padding: 1.5rem; display: flex; justify-content: space-between; align-items: center; z-index: 10; background: linear-gradient(to bottom, rgba(0,0,0,.8), transparent); }
.gallery-head h3 { color: #fff; font-weight: 500; }
.gallery-head h3 span { color: rgba(255,255,255,.5); font-size: .875rem; margin-left: .5rem; }
.gallery-close { color: rgba(255,255,255,.8); font-size: 2rem; padding: .5rem; border-radius: 9999px; line-height: 1; }
.gallery-close:hover { background: rgba(255,255,255,.1); color: #fff; }
.gallery-stage { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 4rem 1rem; }
.gallery-main { position: relative; width: 100%; max-width: 80rem; height: 100%; max-height: 80vh; border-radius: .5rem; overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; animation: galin .4s; }
@keyframes galin { from { opacity: 0; transform: translateX(100px) scale(.95); } to { opacity: 1; transform: translateX(0) scale(1); } }
.gallery-arrow { position: absolute; top: 50%; transform: translateY(-50%); color: rgba(255,255,255,.7); font-size: 2.5rem; background: rgba(0,0,0,.2); padding: .75rem; border-radius: 9999px; z-index: 10; transition: all .2s; }
.gallery-arrow:hover { background: rgba(0,0,0,.5); color: #fff; }
.gallery-arrow.prev { left: 1rem; } .gallery-arrow.next { right: 1rem; }
@media (min-width: 768px) { .gallery-arrow.prev { left: 2rem; } .gallery-arrow.next { right: 2rem; } }
.gallery-thumbs { position: absolute; bottom: 0; left: 0; right: 0; height: 6rem; background: rgba(0,0,0,.9); backdrop-filter: blur(12px); border-top: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; gap: .5rem; overflow-x: auto; padding: 1rem; }
.gallery-thumb { width: 6rem; height: 4rem; flex-shrink: 0; border-radius: .375rem; overflow: hidden; opacity: .4; transition: all .3s; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { opacity: 1; outline: 2px solid var(--secondary); transform: scale(1.1); z-index: 10; }
.gallery-thumb:hover { opacity: 1; }

/* ---- Footer ---- */
.footer { background: var(--primary); color: #fff; padding: 5rem 0 2.5rem; border-top: 1px solid rgba(255,255,255,.1); }
.footer-grid { display: grid; grid-template-columns: 1fr; gap: 3rem; margin-bottom: 4rem; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(4,1fr); } }
.footer-brand { display: block; margin-bottom: 1.5rem; }
.footer-grid p { color: rgba(255,255,255,.6); font-size: .875rem; line-height: 1.6; }
.footer-grid h4 { font-size: 1.125rem; font-weight: 800; margin-bottom: 1.5rem; color: var(--secondary); }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 1rem; font-size: .875rem; color: rgba(255,255,255,.7); }
.footer-grid ul a:hover { color: #fff; }
.social { display: flex; gap: 1rem; }
.social a { width: 2.5rem; height: 2.5rem; border-radius: 9999px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; transition: all .3s; }
.social a:hover { background: var(--secondary); color: var(--primary); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 2rem; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 1rem; }
@media (min-width: 768px) { .footer-bottom { flex-direction: row; } }
.footer-bottom p { color: rgba(255,255,255,.6); font-size: .75rem; }
.footer-bottom div { display: flex; gap: 1.5rem; }
.footer-bottom a { font-size: .75rem; color: rgba(255,255,255,.6); }
.footer-bottom a:hover { color: #fff; }

/* ---- Chat widget ---- */
.chat-root { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 55; display: flex; flex-direction: column; align-items: flex-end; pointer-events: none; }
.chat-window { width: 350px; max-width: calc(100vw - 40px); height: 500px; max-height: 70vh; margin-bottom: 1rem; background: rgba(255,255,255,.95); backdrop-filter: blur(24px); border: 1px solid rgba(255,255,255,.2); box-shadow: 0 25px 50px -12px rgba(0,0,0,.25); border-radius: 1rem; display: none; flex-direction: column; overflow: hidden; pointer-events: auto; animation: chatpop .3s; }
.chat-window.open { display: flex; }
@keyframes chatpop { from { opacity: 0; transform: scale(.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.chat-head { background: var(--primary); padding: 1rem; display: flex; align-items: center; justify-content: space-between; color: #fff; flex-shrink: 0; }
.chat-head .who { display: flex; align-items: center; gap: .75rem; }
.chat-avatar { width: 2.5rem; height: 2.5rem; border-radius: 9999px; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.2); }
.chat-head h3 { font-size: .875rem; font-weight: 800; }
.online { font-size: .75rem; color: rgba(255,255,255,.7); display: flex; align-items: center; gap: .375rem; }
.online .dot { width: .375rem; height: .375rem; border-radius: 9999px; background: #4ade80; animation: pulse 1.5s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.chat-close-btn { padding: .5rem; border-radius: 9999px; }
.chat-close-btn:hover { background: rgba(255,255,255,.1); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; background: #f8fafc; }
.msg { display: flex; width: 100%; }
.msg.user { justify-content: flex-end; }
.msg.assistant { justify-content: flex-start; }
.msg .bubble { max-width: 80%; padding: .75rem; border-radius: 1rem; font-size: .875rem; line-height: 1.6; box-shadow: 0 1px 2px rgba(0,0,0,.05); white-space: pre-wrap; }
.msg.user .bubble { background: var(--primary); color: #fff; border-bottom-right-radius: 0; }
.msg.assistant .bubble { background: #fff; color: #334155; border: 1px solid #f1f5f9; border-bottom-left-radius: 0; }
.typing { display: flex; gap: .25rem; }
.typing span { width: .375rem; height: .375rem; background: #94a3b8; border-radius: 9999px; animation: bounce 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }
.chat-input { padding: 1rem; background: #fff; border-top: 1px solid #f1f5f9; flex-shrink: 0; }
.chat-input form { display: flex; align-items: center; gap: .5rem; }
.chat-input input { flex: 1; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 9999px; padding: .5rem 1rem; font-size: .875rem; outline: none; transition: all .2s; font-family: inherit; }
.chat-input input:focus { box-shadow: 0 0 0 2px rgba(26,60,52,.2); }
.send-btn { width: 2.5rem; height: 2.5rem; border-radius: 9999px; background: var(--primary); color: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.send-btn:hover { background: rgba(26,60,52,.9); }
.chat-toggle { width: 3.5rem; height: 3.5rem; border-radius: 9999px; background: var(--primary); color: var(--secondary); box-shadow: 0 20px 25px -5px rgba(0,0,0,.25); display: flex; align-items: center; justify-content: center; font-size: 1.5rem; border: 1px solid rgba(255,255,255,.1); transition: all .2s; pointer-events: auto; }
.chat-toggle:hover { transform: scale(1.05); }

/* ---- Toast ---- */
#toast-root { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast { padding: .75rem 1.25rem; border-radius: .75rem; font-weight: 600; font-size: .875rem; box-shadow: 0 10px 15px -3px rgba(0,0,0,.2); animation: fadeIn .3s; pointer-events: auto; }
.toast.success { background: #22c55e; color: #fff; }
.toast.error { background: #ef4444; color: #fff; }

/* scrollbar hide for chat / modal */
.chat-msgs::-webkit-scrollbar, .modal-card::-webkit-scrollbar, .gallery-thumbs::-webkit-scrollbar { display: none; }
.chat-msgs, .modal-card, .gallery-thumbs { scrollbar-width: none; }

/* prevent body scroll when modal open */
body.no-scroll { overflow: hidden; }