/* ============================================
   CUSTOM PROPERTIES
   ============================================ */
:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f5f5f5;
  --color-bg-dark: #1a1a2e;
  --color-text: #2d2d2d;
  --color-text-light: #666666;
  --color-text-on-dark: #f0f0f0;
  --color-accent: #2563eb;
  --color-accent-hover: #1d4ed8;
  --color-border: #e5e5e5;
  --color-card-bg: #ffffff;
  --color-highlight: #059669;

  --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-size-base: 16px;

  --max-width: 1100px;
  --section-pad: 4rem 1.5rem;
  --nav-height: 60px;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 24px rgba(0,0,0,0.12);
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
  font-size: var(--font-size-base);
}

body {
  font-family: var(--font-stack);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3 {
  line-height: 1.2;
  font-weight: 700;
}

h2 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

ul {
  list-style: none;
}

/* ============================================
   UTILITIES
   ============================================ */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.section {
  padding: var(--section-pad);
}

.section-gray {
  background: var(--color-bg-alt);
}

.section-lead {
  font-size: 1.15rem;
  color: var(--color-text-light);
  margin-bottom: 2rem;
  max-width: 700px;
}

.section-note {
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-top: 2rem;
  font-style: italic;
}

.section-cta {
  text-align: center;
  margin-top: 2.5rem;
}

.subsection-title {
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.3rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-block;
  padding: 0.85rem 2rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  cursor: pointer;
  border: none;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
}

.btn-large {
  padding: 1rem 2.5rem;
  font-size: 1.1rem;
}

/* ============================================
   NAV
   ============================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(255,255,255,0.97);
  z-index: 100;
  transition: box-shadow 0.3s;
}

.nav.scrolled {
  box-shadow: var(--shadow);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-text);
}

.nav-brand:hover {
  text-decoration: none;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.3s, opacity 0.3s;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.nav-links {
  display: none;
  position: absolute;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 1rem 0;
  flex-direction: column;
}

.nav-links.open {
  display: flex;
}

.nav-links li a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: var(--color-text);
  font-size: 0.95rem;
}

.nav-links li a:hover {
  background: var(--color-bg-alt);
  text-decoration: none;
}

.nav-cta {
  color: var(--color-accent) !important;
  font-weight: 600;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  margin-top: var(--nav-height);
  position: relative;
  overflow: hidden;
  background: var(--color-bg-dark);
}

.hero-image {
  width: 100%;
  max-height: 500px;
  overflow: hidden;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;

}

.hero-content {
  padding: 2.5rem 1.5rem 3rem;
  text-align: center;
  background: var(--color-bg);
}

.hero h1 {
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
  color: var(--color-text);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--color-text-light);
  margin-bottom: 0.75rem;
}

.hero-price {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.hero-price strong {
  font-size: 1.5rem;
}

/* ============================================
   CARDS (Numbers section)
   ============================================ */
.cards-row {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.card {
  background: var(--color-card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  background: var(--color-accent);
  color: #fff;
  padding: 0.85rem 1.25rem;
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
}

.card-body {
  padding: 1.25rem;
}

.card-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0;
}

.card-stat-label {
  color: var(--color-text-light);
  font-size: 0.95rem;
}

.card-stat-value {
  font-weight: 700;
  font-size: 1.1rem;
}

.card-stat-value.accent {
  color: var(--color-highlight);
  font-size: 1.35rem;
}

.card-stat-highlight {
  border-top: 1px solid var(--color-border);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

.card-divider {
  height: 1px;
  background: var(--color-border);
  margin: 0.5rem 0;
}

/* ============================================
   GALLERY
   ============================================ */
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  aspect-ratio: 3 / 4;
}

.gallery-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.lightbox.active {
  display: flex;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 2.5rem;
  padding: 0.5rem;
  opacity: 0.7;
  transition: opacity 0.2s;
  line-height: 1;
  z-index: 201;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  opacity: 1;
}

.lightbox-close {
  top: 1rem;
  right: 1.5rem;
  font-size: 2.5rem;
}

.lightbox-prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

.lightbox-next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
}

.lightbox-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}

/* ============================================
   SPECS GRID (The Home)
   ============================================ */
.specs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.spec-card {
  background: var(--color-card-bg);
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.spec-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

.spec-card h3 {
  font-size: 1.1rem;
}

.spec-card p {
  font-size: 0.9rem;
  color: var(--color-text-light);
}

/* ============================================
   CALLOUT BOX
   ============================================ */
.callout {
  background: var(--color-card-bg);
  border-left: 4px solid var(--color-accent);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-top: 2rem;
  box-shadow: var(--shadow);
}

.callout h3 {
  margin-bottom: 0.5rem;
}

.callout p,
.callout li {
  font-size: 0.95rem;
  color: var(--color-text-light);
}

.callout ul {
  margin-top: 0.75rem;
}

.callout li {
  padding: 0.4rem 0;
  padding-left: 1.25rem;
  position: relative;
}

.callout li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.85rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-accent);
}

/* ============================================
   BUSINESS SECTION
   ============================================ */
.business-grid {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.business-col ul {
  margin-top: 0.5rem;
}

.business-col li {
  padding: 0.35rem 0;
  padding-left: 1.25rem;
  position: relative;
  font-size: 0.95rem;
  color: var(--color-text-light);
}

.business-col li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--color-highlight);
  font-weight: 700;
}

.proof-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.75rem;
}

.proof-item {
  text-align: center;
  background: var(--color-bg-alt);
  padding: 1rem;
  border-radius: var(--radius);
}

.proof-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-accent);
}

.proof-label {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.2rem;
}

/* ============================================
   LOCATION
   ============================================ */
.location-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.location-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  min-height: 220px;
  display: flex;
  align-items: flex-end;
}

.location-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.location-card:hover img {
  transform: scale(1.05);
}

.location-card-content {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 3rem 1.25rem 1.25rem;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.25) 70%, transparent 100%);
}

.location-card h3 {
  font-size: 1.1rem;
  color: #fff;
}

.location-card p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.85);
}


/* ============================================
   FAQ ACCORDION
   ============================================ */
.faq-list {
  max-width: 800px;
}

.faq-item {
  border-bottom: 1px solid var(--color-border);
}

.faq-item:first-child {
  border-top: 1px solid var(--color-border);
}

.faq-question {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.15rem 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-text);
  text-align: left;
  font-family: var(--font-stack);
  gap: 1rem;
}

.faq-question:hover {
  color: var(--color-accent);
}

.faq-icon {
  font-size: 1.5rem;
  font-weight: 300;
  flex-shrink: 0;
  transition: transform 0.3s;
  line-height: 1;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.faq-answer p {
  padding-bottom: 1.25rem;
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.7;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--color-bg-dark);
  color: var(--color-text-on-dark);
  padding: 4rem 1.5rem;
  text-align: center;
}

.footer h2 {
  color: #fff;
  margin-bottom: 0.75rem;
}

.footer p {
  color: rgba(255,255,255,0.75);
  margin-bottom: 1.5rem;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

.footer-email {
  margin-top: 1.5rem;
  font-size: 0.95rem;
}

.footer-email a {
  color: rgba(255,255,255,0.9);
}

.footer-legal {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  margin-top: 2rem;
}

/* ============================================
   RESPONSIVE — TABLET (768px+)
   ============================================ */
@media (min-width: 768px) {
  h2 {
    font-size: 2.25rem;
  }

  .hero-content {
    padding: 3rem 2rem 3.5rem;
  }

  .hero h1 {
    font-size: 2.25rem;
  }

  .hero-stats {
    gap: 2.5rem;
  }

  .stat-value {
    font-size: 2rem;
  }

  .cards-row {
    flex-direction: row;
  }

  .card {
    flex: 1;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  .specs-grid {
    grid-template-columns: 1fr 1fr;
  }

  .business-grid {
    flex-direction: row;
  }

  .business-col {
    flex: 1;
  }

  .location-features {
    grid-template-columns: 1fr 1fr;
  }

  /* Show nav links inline on tablet+ */
  .nav-toggle {
    display: none;
  }

  .nav-links {
    display: flex;
    position: static;
    box-shadow: none;
    padding: 0;
    flex-direction: row;
    align-items: center;
    gap: 0.25rem;
    background: transparent;
    flex: 1;
    justify-content: flex-end;
  }

  .nav-right {
    margin-left: 0.75rem;
  }

  .nav-links li a {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }

  .nav-links li a:hover {
    background: transparent;
    color: var(--color-accent);
  }
}

/* ============================================
   RESPONSIVE — DESKTOP (1024px+)
   ============================================ */
@media (min-width: 1024px) {
  .hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 520px;
  }

  .hero-image {
    max-height: none;
    height: 100%;
  }

  .hero-image img {
    height: 100%;
  }

  .hero-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    text-align: left;
    padding: 3rem;
  }

  .hero-stats {
    justify-content: flex-start;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .specs-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .location-features {
    grid-template-columns: 1fr 1fr 1fr 1fr;
  }
}

/* ============================================
   NAV RIGHT (theme toggle + hamburger wrapper)
   ============================================ */
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
  background: none;
  border: 1px solid var(--color-border);
  cursor: pointer;
  font-size: 1.15rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--color-text-light);
  transition: color 0.2s, border-color 0.2s;
  line-height: 1;
  flex-shrink: 0;
}

.theme-toggle:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* ============================================
   AIRBNB PROOF SCREENSHOTS
   ============================================ */
.proof-screenshots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.proof-screenshot-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.proof-screenshot-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.proof-screenshot-item img {
  width: 100%;
  height: auto;
  display: block;
}

.proof-screenshot-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  padding: 1.5rem 1rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

@media (min-width: 640px) {
  .proof-screenshots {
    grid-template-columns: 1fr 1fr;
  }
  .proof-screenshot-item:first-child {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .proof-screenshots {
    grid-template-columns: repeat(3, 1fr);
  }
  .proof-screenshot-item:first-child {
    grid-column: 1 / 3;
  }
}

/* ============================================
   SCROLL ANIMATIONS
   ============================================ */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.stagger-in > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.stagger-in.visible > * {
  opacity: 1;
  transform: translateY(0);
}

.stagger-in.visible > *:nth-child(1) { transition-delay: 0s; }
.stagger-in.visible > *:nth-child(2) { transition-delay: 0.08s; }
.stagger-in.visible > *:nth-child(3) { transition-delay: 0.1s; }
.stagger-in.visible > *:nth-child(4) { transition-delay: 0.16s; }
.stagger-in.visible > *:nth-child(5) { transition-delay: 0.22s; }
.stagger-in.visible > *:nth-child(6) { transition-delay: 0.28s; }
.stagger-in.visible > *:nth-child(n+7) { transition-delay: 0.32s; }

@media (prefers-reduced-motion: reduce) {
  .fade-in,
  .stagger-in > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ============================================
   GUEST REVIEWS
   ============================================ */
.reviews-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.review-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.review-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.review-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
}

.review-avatar img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
}

.review-avatar-initial {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #374151;
  display: flex;
  align-items: center;
  justify-content: center;
}

.review-avatar-initial::after {
  content: attr(data-initial);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1;
}

.review-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.review-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-text);
}

.review-location {
  font-size: 0.8rem;
  color: var(--color-text-light);
}

.review-stars {
  color: var(--color-accent);
  font-size: 0.85rem;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.review-text {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.review-date {
  font-size: 0.78rem;
  color: var(--color-text-light);
  opacity: 0.7;
}

.reviews-expanded {
  display: none;
  margin-top: 1rem;
}

.reviews-expanded.open {
  display: block;
}

.reviews-toggle {
  display: block;
  margin: 1.5rem auto 0;
  background: transparent;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  padding: 0.7rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.reviews-toggle:hover {
  background: var(--color-accent);
  color: #fff;
}

@media (min-width: 640px) {
  .reviews-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================================
   FOCUS STYLES
   ============================================ */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================
   DARK MODE
   ============================================ */
[data-theme="dark"] {
  --color-bg: #0f172a;
  --color-bg-alt: #1e293b;
  --color-bg-dark: #020617;
  --color-text: #e2e8f0;
  --color-text-light: #94a3b8;
  --color-accent: #3b82f6;
  --color-accent-hover: #60a5fa;
  --color-border: #334155;
  --color-card-bg: #1e293b;
  --color-highlight: #34d399;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 24px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

[data-theme="dark"] .nav {
  background: rgba(15, 23, 42, 0.97);
}

[data-theme="dark"] .nav-links {
  background: #0f172a;
}

[data-theme="dark"] .hero-image img {
  opacity: 0.8;
}

[data-theme="dark"] .footer {
  border-top: 1px solid var(--color-border);
}

/* ============================================
   CHAT WIDGET
   ============================================ */

/* --- Button wrapper & tooltip --- */
.chat-btn-wrapper {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.chat-btn-wrapper.hidden { display: none; }

.chat-tooltip {
  background: var(--color-card-bg);
  color: var(--color-text);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(12px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  border: 1px solid var(--color-border);
}
.chat-tooltip.visible {
  opacity: 1;
  transform: translateX(0);
}

.chat-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--color-accent);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: background 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}
.chat-btn:hover {
  background: var(--color-accent-hover);
  transform: scale(1.06);
}

/* --- Panel --- */
.chat-panel {
  position: fixed;
  bottom: 5.25rem;
  right: 1.25rem;
  z-index: 901;
  width: 380px;
  max-height: 520px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s ease, max-height 0.25s ease;
}
.chat-panel.open {
  display: flex;
}
.chat-panel.chat-panel-large {
  width: 700px;
  max-height: min(700px, 85vh);
}

/* --- Header --- */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--color-accent);
  color: #fff;
  flex-shrink: 0;
}
.chat-header-title {
  font-size: 0.95rem;
  font-weight: 600;
}
.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.chat-header-resize,
.chat-header-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.chat-header-resize {
  font-size: 1.05rem;
}
.chat-header-close {
  font-size: 1.3rem;
}
.chat-header-resize:hover,
.chat-header-close:hover { opacity: 1; }

/* --- Messages --- */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 0;
}

.chat-msg {
  max-width: 85%;
  padding: 0.55rem 0.8rem;
  border-radius: 0.75rem;
  font-size: 0.88rem;
  line-height: 1.45;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.chat-msg-user {
  align-self: flex-end;
  background: var(--color-accent);
  color: #fff;
  border-bottom-right-radius: 0.2rem;
}
.chat-msg-bot {
  align-self: flex-start;
  background: var(--color-bg-alt);
  color: var(--color-text);
  border-bottom-left-radius: 0.2rem;
  white-space: normal;
}

/* --- Markdown typography in bot messages --- */
.chat-msg-bot p {
  margin: 0 0 0.5em;
}
.chat-msg-bot p:last-child {
  margin-bottom: 0;
}
.chat-msg-bot ul,
.chat-msg-bot ol {
  margin: 0.35em 0;
  padding-left: 1.4em;
  list-style: revert;
}
.chat-msg-bot li {
  margin-bottom: 0.15em;
  padding: 0;
}
.chat-msg-bot li::before {
  content: none;
}
.chat-msg-bot strong {
  font-weight: 700;
}
.chat-msg-bot em {
  font-style: italic;
}
.chat-msg-bot code {
  background: rgba(0, 0, 0, 0.06);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.82em;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}
.chat-msg-bot pre {
  background: rgba(0, 0, 0, 0.06);
  padding: 0.6em 0.75em;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0.4em 0;
  font-size: 0.82em;
}
.chat-msg-bot pre code {
  background: none;
  padding: 0;
}
.chat-msg-bot a {
  color: var(--color-accent);
  text-decoration: underline;
}
.chat-msg-bot blockquote {
  border-left: 3px solid var(--color-border);
  margin: 0.4em 0;
  padding: 0.2em 0.6em;
  color: var(--color-text-light);
}

/* --- Dark mode markdown overrides --- */
[data-theme="dark"] .chat-msg-bot code {
  background: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .chat-msg-bot pre {
  background: rgba(255, 255, 255, 0.08);
}

/* --- Typing indicator --- */
.chat-typing {
  align-self: flex-start;
  padding: 0.55rem 0.8rem;
  font-size: 0.85rem;
  color: var(--color-text-light);
  font-style: italic;
}

/* --- Input area --- */
.chat-input-area {
  display: flex;
  border-top: 1px solid var(--color-border);
  flex-shrink: 0;
}
.chat-input {
  flex: 1;
  padding: 0.65rem 0.8rem;
  border: none;
  outline: none;
  font-size: 0.88rem;
  font-family: var(--font-stack);
  background: var(--color-card-bg);
  color: var(--color-text);
}
.chat-input::placeholder {
  color: var(--color-text-light);
}
.chat-send {
  padding: 0.65rem 1rem;
  border: none;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.chat-send:hover { background: var(--color-accent-hover); }
.chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --- Mobile --- */
@media (max-width: 480px) {
  .chat-panel {
    width: calc(100vw - 1.5rem);
    right: 0.75rem;
    bottom: 4.75rem;
    max-height: calc(100vh - 6rem);
  }
  .chat-panel.chat-panel-large {
    width: calc(100vw - 1.5rem);
    max-height: calc(100vh - 6rem);
  }
  .chat-btn-wrapper {
    bottom: 1rem;
    right: 1rem;
  }
  .chat-btn {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }
  .chat-header-resize {
    display: none;
  }
  .chat-tooltip {
    display: none;
  }
}
