/* ==========================================================================
   MiiRealty — Minimal, Clean, Organized, Modern Canadian Real Estate UI
   Color Palette: Architectural Earth (Alabaster, Travertine, Terracotta, Sage, Espresso)
   ========================================================================== */

:root {
  --bg-primary: #F6F3EC;
  --bg-secondary: #EDE8DD;
  --bg-card: #FAF8F3;
  --bg-dark: #211E1A;
  --bg-dark-elevated: #2C2823;
  --text-primary: #231F1B;
  --text-secondary: #5D544B;
  --text-muted: #84796E;
  --text-on-dark: #F5F1E8;
  --accent-terracotta: #A65638;
  --accent-terracotta-hover: #8C442A;
  --accent-terracotta-soft: rgba(166, 86, 56, 0.11);
  --accent-sage: #47594A;
  --accent-sage-soft: rgba(71, 89, 74, 0.12);
  --accent-ochre: #B6864C;
  --border-earth: #DCD4C6;
  --border-subtle: #E7E1D5;
  --shadow-soft: 0 10px 30px -10px rgba(35, 31, 27, 0.07);
  --shadow-hover: 0 18px 40px -12px rgba(35, 31, 27, 0.13);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --container-max: 1240px;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .serif-heading {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  line-height: 1.18;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}

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

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

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 243, 236, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-earth);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.brand-logo svg {
  width: 40px;
  height: 34px;
  color: var(--accent-terracotta);
}

.brand-sub {
  font-family: 'Inter', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  display: block;
  margin-top: -4px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
}

.nav-links a {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 0;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--accent-terracotta);
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-earth);
  border-radius: var(--radius-sm);
  padding: 8px;
  color: var(--text-primary);
  cursor: pointer;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

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

.btn-primary:hover {
  background-color: var(--accent-terracotta-hover);
  transform: translateY(-1px);
}

.btn-sage {
  background-color: var(--accent-sage);
  color: #FFFFFF;
}

.btn-sage:hover {
  background-color: #39483B;
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border-earth);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--text-primary);
  background-color: var(--bg-secondary);
}

.btn-dark {
  background-color: var(--bg-dark);
  color: var(--text-on-dark);
}

.btn-dark:hover {
  background-color: #35302A;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.83rem;
}

/* ==========================================================================
   Sections & Typography
   ========================================================================== */
.section {
  padding: 88px 0;
}

.section-alt {
  background-color: var(--bg-secondary);
  border-top: 1px solid var(--border-earth);
  border-bottom: 1px solid var(--border-earth);
}

.section-dark {
  background-color: var(--bg-dark);
  color: var(--text-on-dark);
}

.section-dark h2,
.section-dark h3,
.section-dark h4 {
  color: var(--text-on-dark);
}

.section-header {
  max-width: 720px;
  margin-bottom: 48px;
}

.section-header.centered {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-header h1 {
  font-size: clamp(2.5rem, 4.5vw, 3.8rem);
  margin-bottom: 18px;
}

.section-header h2 {
  font-size: clamp(2rem, 3.3vw, 2.85rem);
  margin-bottom: 14px;
}

.section-header p {
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.section-dark .section-header p {
  color: #C7BFB3;
}

.section-header-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 44px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  padding: 64px 0 84px;
  border-bottom: 1px solid var(--border-earth);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.hero-content h1 {
  font-size: clamp(2.75rem, 4.8vw, 4.1rem);
  margin-bottom: 20px;
  color: var(--text-primary);
}

.hero-content p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 560px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 44px;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding-top: 28px;
  border-top: 1px solid var(--border-earth);
}

.metric-item strong {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.1;
}

.metric-item span {
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.hero-visual {
  position: relative;
}

.hero-image-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-earth);
  box-shadow: var(--shadow-soft);
  aspect-ratio: 4 / 3.4;
  background-color: var(--bg-secondary);
}

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

.hero-ledger-card {
  position: absolute;
  bottom: -24px;
  left: -24px;
  background: var(--bg-card);
  border: 1px solid var(--border-earth);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  box-shadow: var(--shadow-hover);
  max-width: 340px;
}

.hero-ledger-card h3 {
  font-size: 1.25rem;
  margin-bottom: 6px;
}

.hero-ledger-card p {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.ledger-figures {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
}

.ledger-figures div strong {
  display: block;
  color: var(--accent-terracotta);
  font-size: 0.96rem;
}

/* ==========================================================================
   Page Banner (Interior Pages)
   ========================================================================== */
.page-banner {
  padding: 64px 0 52px;
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-earth);
}

.page-banner h1 {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  margin-bottom: 14px;
}

.page-banner p {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 680px;
}

/* ==========================================================================
   Filter Bar & Search Controls
   ========================================================================== */
.filter-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-earth);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-soft);
}

.filter-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 16px;
  align-items: end;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-control {
  width: 100%;
  padding: 11px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-earth);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-terracotta);
  background-color: #FFFFFF;
}

textarea.form-control {
  resize: vertical;
  min-height: 110px;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.tab-btn {
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-earth);
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover,
.tab-btn.active {
  background: var(--text-primary);
  color: var(--bg-card);
  border-color: var(--text-primary);
}

/* ==========================================================================
   Property Cards & Grid
   ========================================================================== */
.properties-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 28px;
}

.property-card {
  background: var(--bg-card);
  border: 1px solid var(--border-earth);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.property-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.property-media {
  position: relative;
  aspect-ratio: 16 / 10.5;
  overflow: hidden;
  background-color: var(--bg-secondary);
}

.property-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.property-card:hover .property-media img {
  transform: scale(1.04);
}

.property-tag-bar {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.listing-tag {
  padding: 5px 11px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  background: rgba(33, 30, 26, 0.86);
  color: #FAF8F3;
  backdrop-filter: blur(6px);
}

.listing-tag.tag-flip {
  background: var(--accent-terracotta);
  color: #FFFFFF;
}

.listing-tag.tag-opportunity {
  background: var(--accent-sage);
  color: #FFFFFF;
}

.property-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.property-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.property-price {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.property-mls {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-family: monospace;
}

.property-title {
  font-size: 1.32rem;
  margin-bottom: 6px;
}

.property-location {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.property-location svg {
  width: 15px;
  height: 15px;
  color: var(--accent-terracotta);
  flex-shrink: 0;
}

.flip-breakdown-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--accent-terracotta);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 16px;
  font-size: 0.81rem;
}

.flip-breakdown-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.flip-breakdown-row strong {
  color: var(--text-primary);
}

.flip-contractor-credit {
  font-size: 0.77rem;
  color: var(--accent-sage);
  font-weight: 600;
  margin-top: 4px;
}

.property-specs {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 14px;
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.84rem;
  color: var(--text-secondary);
}

.property-specs span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.property-specs svg {
  width: 15px;
  height: 15px;
  color: var(--text-muted);
}

.property-card-footer {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.property-card-footer .btn {
  flex: 1;
}

/* ==========================================================================
   Flip & Switch Ecosystem Cards & Steps
   ========================================================================== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-earth);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  transition: var(--transition);
}

.section-dark .step-card {
  background: var(--bg-dark-elevated);
  border-color: #3D3730;
}

.step-icon {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--accent-terracotta-soft);
  color: var(--accent-terracotta);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.step-icon svg {
  width: 22px;
  height: 22px;
}

.step-card h3 {
  font-size: 1.45rem;
  margin-bottom: 10px;
}

.step-card p {
  font-size: 0.93rem;
  color: var(--text-secondary);
}

.section-dark .step-card p {
  color: #C2B9AC;
}

/* ==========================================================================
   Trade Partner / Contractor Syndicate Cards
   ========================================================================== */
.contractors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.contractor-card {
  background: var(--bg-card);
  border: 1px solid var(--border-earth);
  border-radius: var(--radius-md);
  padding: 24px;
}

.contractor-card h3 {
  font-size: 1.28rem;
  margin-bottom: 4px;
}

.contractor-trade {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--accent-terracotta);
  margin-bottom: 12px;
}

.contractor-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.contractor-meta {
  display: flex;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.contractor-meta strong {
  color: var(--accent-sage);
}

/* ==========================================================================
   Selling & Flip Calculator Split Layout
   ========================================================================== */
.split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
  align-items: start;
}

.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-earth);
  border-radius: var(--radius-md);
  padding: 36px;
  box-shadow: var(--shadow-soft);
}

.card-panel h2,
.card-panel h3 {
  margin-bottom: 12px;
}

.calculator-results {
  background: var(--bg-secondary);
  border: 1px solid var(--border-earth);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 24px;
}

.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-earth);
  font-size: 0.93rem;
}

.calc-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.calc-row.highlight strong {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.65rem;
  color: var(--accent-terracotta);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   About & Contact Grids
   ========================================================================== */
.values-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.office-card {
  background: var(--bg-card);
  border: 1px solid var(--border-earth);
  border-radius: var(--radius-md);
  padding: 28px;
}

.office-card h3 {
  font-size: 1.4rem;
  margin-bottom: 8px;
}

.office-detail {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 10px;
}

.office-detail svg {
  width: 17px;
  height: 17px;
  color: var(--accent-terracotta);
  flex-shrink: 0;
  margin-top: 3px;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-earth);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  text-align: left;
  padding: 18px 22px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.faq-question svg {
  width: 18px;
  height: 18px;
  color: var(--accent-terracotta);
  transition: transform 0.25s ease;
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  display: none;
  padding: 0 22px 18px;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Table Ledger (Recent Submissions / Database Synced Feed)
   ========================================================================== */
.data-table-wrap {
  overflow-x: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-earth);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-table th,
.data-table td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
}

.data-table th {
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.05em;
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background-color: var(--bg-dark);
  color: var(--text-on-dark);
  padding: 72px 0 36px;
  border-top: 1px solid #35302A;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid #35302A;
}

.footer-brand p {
  color: #B9B0A4;
  font-size: 0.9rem;
  margin-top: 14px;
  max-width: 340px;
}

.footer-col h4 {
  color: var(--text-on-dark);
  font-size: 1.15rem;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: #B9B0A4;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: #FFFFFF;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  font-size: 0.83rem;
  color: #8E8579;
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   Glassmorphic Custom Modal & Toast Notification (Rule #3 Compliant)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(28, 24, 20, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.active {
  display: flex;
}

.modal-dialog {
  background: rgba(250, 248, 243, 0.98);
  border: 1px solid var(--border-earth);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(20, 17, 14, 0.34);
  padding: 32px;
  position: relative;
}

.property-card {
  cursor: pointer;
}

.modal-gallery-main {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-earth);
  background: var(--bg-secondary);
  height: 380px;
}

.modal-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

.modal-gallery-caption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  background: rgba(33, 30, 26, 0.84);
  backdrop-filter: blur(6px);
  color: #FAF8F3;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
}

.modal-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(33, 30, 26, 0.75);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-gallery-nav:hover {
  background: var(--accent-terracotta);
}

.modal-gallery-nav.prev {
  left: 14px;
}

.modal-gallery-nav.next {
  right: 14px;
}

.modal-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.modal-thumb-btn {
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  padding: 0;
  background: var(--bg-secondary);
  cursor: pointer;
  height: 68px;
  opacity: 0.72;
  transition: var(--transition);
}

.modal-thumb-btn:hover,
.modal-thumb-btn.active {
  border-color: var(--accent-terracotta);
  opacity: 1;
}

.modal-thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-specs-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 18px 0;
}

.modal-spec-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.modal-spec-item span {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.modal-spec-item strong {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.modal-business-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-earth);
  border-radius: var(--radius-md);
  padding: 20px;
  margin-top: 18px;
}

.modal-business-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  margin-top: 12px;
}

.modal-feature-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.modal-feature-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-feature-list svg {
  width: 15px;
  height: 15px;
  color: var(--accent-terracotta);
  flex-shrink: 0;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 30;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-earth);
  background: rgba(250, 248, 243, 0.96);
  color: var(--text-primary);
  box-shadow: 0 4px 14px rgba(20, 17, 14, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--accent-terracotta);
  border-color: var(--accent-terracotta);
  color: #FFFFFF;
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
}

.custom-toast {
  background: rgba(33, 30, 26, 0.95);
  backdrop-filter: blur(12px);
  color: #FAF8F3;
  border: 1px solid #4A4239;
  border-left: 4px solid var(--accent-terracotta);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
}

.custom-toast svg {
  width: 20px;
  height: 20px;
  color: var(--accent-terracotta);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ==========================================================================
   Responsive Design (Tablet: <= 1024px, Mobile: <= 768px, Small Phone: <= 480px)
   ========================================================================== */
@media (max-width: 1024px) {
  .nav-links {
    gap: 20px;
  }
  .nav-actions .btn-outline {
    display: none;
  }
  .hero-grid,
  .split-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }
  .hero-ledger-card {
    position: static;
    margin-top: 16px;
    max-width: 100%;
  }
  .filter-grid {
    grid-template-columns: 1fr 1fr;
  }
  .steps-grid,
  .values-grid {
    grid-template-columns: 1fr 1fr;
  }
  .properties-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 18px;
  }
  .section {
    padding: 56px 0;
  }
  .hero {
    padding: 40px 0 56px;
  }
  .page-banner {
    padding: 44px 0 36px;
  }
  .nav-wrapper {
    height: 70px;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-earth);
    box-shadow: var(--shadow-hover);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 24px;
    gap: 14px;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links li,
  .nav-links a {
    width: 100%;
  }
  .nav-links a {
    padding: 8px 0;
    font-size: 1rem;
  }
  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
  }
  .filter-panel,
  .card-panel,
  .step-card,
  .office-card {
    padding: 22px 18px;
  }
  .modal-backdrop {
    padding: 12px;
  }
  .modal-dialog {
    padding: 24px 18px;
    max-height: 92vh;
  }
  .modal-gallery-main {
    height: 240px;
  }
  .modal-gallery-thumbs {
    grid-template-columns: repeat(5, minmax(56px, 1fr));
    overflow-x: auto;
  }
  .modal-specs-grid {
    grid-template-columns: 1fr 1fr;
  }
  .modal-business-grid,
  .modal-feature-list {
    grid-template-columns: 1fr;
  }
  .filter-grid,
  .steps-grid,
  .values-grid,
  .form-grid-2,
  .footer-grid,
  .hero-metrics,
  .properties-grid {
    grid-template-columns: 1fr;
  }
  .category-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .flip-breakdown-row,
  .calc-row,
  .property-specs {
    flex-wrap: wrap;
    gap: 8px;
  }
  .toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
}

@media (max-width: 480px) {
  .brand-logo {
    font-size: 1.45rem;
    gap: 8px;
  }
  .brand-logo svg {
    width: 28px;
    height: 28px;
  }
  .nav-actions .btn-primary {
    padding: 8px 12px;
    font-size: 0.78rem;
  }
  .hero-actions {
    flex-direction: column;
  }
  .hero-actions .btn,
  .property-card-footer {
    width: 100%;
  }
  .property-card-footer {
    flex-direction: column;
  }
  .ledger-figures {
    flex-direction: column;
    gap: 8px;
  }
}

