/* ============================================================
   CRS Property Services — Design System
   Tokens and components per the CRS design handoff.
   ============================================================ */

:root {
  /* Brand colors */
  --brand-primary: #0a4b25;
  --brand-primary-hover: #073a1d;
  --brand-primary-tint: #e9f2ec;
  --brand-accent: #c6964a;
  --brand-accent-hover: #8c612d;

  /* Extended palette */
  --green-800: #093d1f;
  --green-100: #d9ecdf;
  --gold-400: #d9b166;
  --neutral-950: #11150f;
  --neutral-300: #c6cabe;

  /* Surfaces & text */
  --color-bg: #f7f6f1;
  --color-bg-subtle: #efeee7;
  --color-surface: #ffffff;
  --color-border: #e4e2d8;
  --color-border-strong: #c8c5b6;
  --text-primary: #1d241f;
  --text-secondary: #4c584f;
  --text-muted: #7e877f;

  /* Tone colors (badges, alerts) */
  --tone-success-bg: #e2f2e6; --tone-success-text: #1c6b35;
  --tone-warning-bg: #faf0dc; --tone-warning-text: #8a6413;
  --tone-danger-bg: #fbe7e4;  --tone-danger-text: #b03424;
  --tone-info-bg: #e3edf7;    --tone-info-text: #2b5b8a;
  --tone-neutral-bg: #ecebe4; --tone-neutral-text: #5c6359;

  /* Typography */
  --font-serif-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-script: "Great Vibes", "Playfair Display", cursive;
  --font-sans: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --text-display-2xl: 3.5rem;
  --text-display-md: 2.25rem;
  --text-heading-lg: 1.5rem;
  --text-heading-md: 1.25rem;
  --text-heading-sm: 1.0625rem;
  --text-body-lg: 1.0625rem;
  --text-body-md: 0.9375rem;
  --text-body-sm: 0.84375rem;
  --text-caption: 0.75rem;
  --text-overline: 0.75rem;
  --tracking-wide: 0.06em;
  --tracking-overline: 0.22em;
  --lh-tight: 1.12;
  --lh-normal: 1.55;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 14px;
  --radius-xl: 22px;

  /* Shadows — soft, warm-tinted, low elevation */
  --shadow-sm: 0 1px 2px rgba(60, 50, 30, 0.05);
  --shadow-md: 0 4px 14px rgba(60, 50, 30, 0.07);
  --shadow-lg: 0 10px 30px rgba(60, 50, 30, 0.09);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-body-md);
  line-height: var(--lh-normal);
  background: var(--color-bg);
  color: var(--text-primary);
}

a { color: var(--brand-primary); text-decoration: none; font-weight: 600; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: var(--lh-tight); }

/* ---------- Typography helpers ---------- */
.serif { font-family: var(--font-serif-display); color: var(--text-primary); margin: 0; }
.display-2xl { font-size: var(--text-display-2xl); font-weight: 700; }
.display-md { font-size: var(--text-display-md); font-weight: 700; }
.heading-lg { font-size: var(--text-heading-lg); }
.heading-md { font-size: var(--text-heading-md); }
.heading-sm { font-size: var(--text-heading-sm); }
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.secondary { color: var(--text-secondary); }
.small { font-size: var(--text-body-sm); }
.caption { font-size: var(--text-caption); }
.field-label {
  font-family: var(--font-sans);
  font-size: var(--text-caption);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  font-weight: 600;
}
.overline {
  font-family: var(--font-sans);
  font-size: var(--text-overline);
  letter-spacing: var(--tracking-overline);
  text-transform: uppercase;
  font-weight: 700;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: var(--text-body-sm);
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-primary { background: var(--brand-primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-primary-hover); }

.btn-accent { background: var(--brand-accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: var(--brand-accent-hover); }

.btn-danger { background: #b03424; color: #fff; }
.btn-danger:hover:not(:disabled) { background: #8f2a1d; }

.btn-outline { background: transparent; border-color: var(--color-border-strong); color: var(--text-secondary); }
.btn-outline:hover:not(:disabled) { border-color: var(--text-secondary); color: var(--text-primary); }

.btn-outline-dark { background: transparent; border-color: rgba(255, 255, 255, 0.55); color: #fff; }
.btn-outline-dark:hover:not(:disabled) { border-color: #fff; }

.btn-ghost { background: none; border: none; color: var(--brand-primary); padding: 6px 10px; }
.btn-ghost:hover:not(:disabled) { text-decoration: underline; }

.btn-sm { padding: 6px 14px; font-size: var(--text-caption); }
.btn-lg { padding: 14px 30px; font-size: var(--text-body-md); }

.link-back {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--brand-primary); font-family: var(--font-sans); font-weight: 600;
  font-size: var(--text-body-sm);
}
.link-back:hover { text-decoration: underline; }

/* ---------- Cards & panels ---------- */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
}
.card-flush { padding: 0; }

.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  margin: 24px auto;
  max-width: 940px;
}
.panel.narrow { max-width: 560px; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-caption);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  padding: 4px 10px;
  border-radius: 999px;
}
.badge-success { background: var(--tone-success-bg); color: var(--tone-success-text); }
.badge-warning { background: var(--tone-warning-bg); color: var(--tone-warning-text); }
.badge-danger { background: var(--tone-danger-bg); color: var(--tone-danger-text); }
.badge-info { background: var(--tone-info-bg); color: var(--tone-info-text); }
.badge-neutral { background: var(--tone-neutral-bg); color: var(--tone-neutral-text); }

/* ---------- Forms ---------- */
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: var(--text-body-sm); color: var(--text-primary); }
label.check { display: flex; flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; font-size: var(--text-body-sm); color: var(--text-secondary); }
label.check input { margin-top: 3px; }

input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input:not([type]), textarea, select {
  font-family: var(--font-sans);
  font-size: var(--text-body-md);
  color: var(--text-primary);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--brand-primary);
  outline-offset: 1px;
  border-color: var(--brand-primary);
}
textarea { min-height: 96px; resize: vertical; }

.alert {
  color: var(--tone-danger-text);
  background: var(--tone-danger-bg);
  border: 1px solid #eec7c1;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-weight: 600;
  font-size: var(--text-body-sm);
}
.notice {
  color: var(--tone-success-text);
  background: var(--tone-success-bg);
  border: 1px solid #c4e2cd;
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-weight: 600;
  font-size: var(--text-body-sm);
}
.fine-print { color: var(--text-muted); font-size: var(--text-caption); margin-top: 16px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-family: var(--font-sans); }
table.data th {
  text-align: left;
  font-size: var(--text-caption);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--text-muted);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
}
table.data td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border);
  font-size: var(--text-body-sm);
  color: var(--text-primary);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--color-bg); }

/* ---------- Public site: header / hero / sections / footer ---------- */
/* Public header and hero — responsive interpretation of final header.png. */
.site-header { position: relative; z-index: 20; display: flex; align-items: center; min-height: 100px; padding: 10px 3.7%; gap: 28px; background: #002b1c; }
.site-brand { flex: 0 0 auto; }
.site-header .logo { display: block; width: 110px; height: auto; }
.public-menu { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex: 1; background: #f8f8f7; padding: 14px 24px; border-radius: 12px; }
.site-header nav { display: flex; align-items: center; justify-content: space-between; gap: clamp(16px, 2.3vw, 40px); }
.site-header nav a { position: relative; white-space: nowrap; color: #111; font-size: clamp(12px, 1vw, 16px); font-weight: 500; padding: 10px 0; }
.site-header nav a:hover { text-decoration: none; color: #85601e; }
.site-header nav a[aria-current="page"]::after { content: ""; position: absolute; height: 2px; background: #b58129; bottom: 0; left: -7px; right: -7px; }
.header-actions { display: flex; align-items: center; gap: 20px; }
.header-actions .btn { min-height: 52px; padding: 10px 22px; font-size: clamp(12px, 1vw, 16px); gap: 14px; border-radius: 11px; }
.header-actions .btn svg { width: 27px; height: 27px; }
.header-actions .btn-primary { background: #002b1c; }
.header-actions .btn-primary:hover { background: #14513a; }
.btn-gold-outline { background: #fff; border: 1.5px solid #ab731e; color: #111; }
.btn-gold-outline:hover { background: #fff5de; }
.menu-toggle { display: none; }
a:focus-visible, button:focus-visible { outline: 3px solid #bd852d; outline-offset: 5px; }
.site-header-home { position: absolute; inset: 0 0 auto; padding: 0; min-height: 0; background: transparent; align-items: flex-start; }
.site-header-home .site-brand { position: absolute; top: 17px; left: 3.4%; width: 14.3%; max-width: 220px; }
.site-header-home .logo { width: 100%; }
.site-header-home .public-menu { margin-left: 22%; padding: 14px 3% 14px 2.4%; border-radius: 0 0 0 36px; position: relative; }
.site-header-home .public-menu::before { content: ""; position: absolute; z-index: -1; width: 55px; height: 100%; top: 0; left: -24px; background: #f8f8f7; transform: skewX(30deg); border-radius: 0 0 0 22px; }
.hero2 { position: relative; background: #002819; overflow: hidden; min-height: min(44vw, 760px); }
.hero2-bg { position: absolute; inset: 0; background: url('/assets/hero-house.jpg') right bottom / 70% 100% no-repeat; }
.hero2-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #002719 0%, rgba(0, 33, 21, .98) 23%, rgba(0, 30, 18, .77) 36%, transparent 60%); }
.hero2-content { position: relative; width: 100%; max-width: 1800px; margin: 0 auto; padding: clamp(220px, 14.7vw, 265px) 3.7% 85px; }
.hero2-tagline { position: absolute; top: 105px; right: 3.7%; text-align: right; z-index: 2; }
.hero2-tagline-track { display: block; font-size: clamp(10px, .95vw, 16px); letter-spacing: .25em; text-transform: uppercase; font-weight: 500; color: #fff; }
.script { font-family: var(--font-script); color: #f2cd74; font-size: 2.8rem; line-height: 1.2; display: block; }
.hero2-tagline .script { color: #002b1c; font-size: clamp(30px, 2.8vw, 48px); margin-top: 10px; text-shadow: 0 1px 6px #ffe6bd; }
.hero2-tagline .hero2-tagline-track { color: #002b1c; text-shadow: 0 1px 5px #ffe6bd; }
.hero2 h1 { font-family: Georgia, 'Times New Roman', serif; font-size: clamp(58px, 5.65vw, 100px); line-height: .98; letter-spacing: -.025em; color: #fff; margin: 0 0 14px; }
.hero2-gold { color: #f0cd78; }
.hero2 p { font-size: clamp(19px, 1.8vw, 30px); line-height: 1.25; color: #f7f7f2; max-width: 42%; margin: 0 0 15px; }
.hero2 p + p { font-size: clamp(15px, 1.25vw, 21px); line-height: 1.4; }
.hero2-buttons { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 22px; }
.btn-hero { display: inline-flex; align-items: center; justify-content: center; gap: 18px; border: 1.5px solid #f2cf72; color: #fff; border-radius: 13px; padding: 17px 24px; font-size: clamp(15px, 1.25vw, 21px); background: rgba(0, 29, 17, .8); }
.btn-hero:hover { background: #1b5136; text-decoration: none; }
.btn-hero svg { width: 30px; height: 30px; color: #f2cf72; }
.btn-hero-gold { background: linear-gradient(#ffe397, #ca9b46); color: #12180e; }
.btn-hero-gold svg { color: #12180e; }
.btn-hero-gold:hover { background: #f5d485; }
.hero-features { position: relative; background: linear-gradient(20deg, #002719, #003420); padding: 5px 3.2% 30px; }
.hero-wave { position: absolute; top: -90px; left: 0; width: 100%; height: 91px; pointer-events: none; }
.hero-features-inner { max-width: 1700px; margin: 0 auto; display: flex; align-items: center; gap: 5%; }
.hero-features-grid { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); }
.feature-item { text-align: center; position: relative; padding: 0 18px; }
.feature-item + .feature-item::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 10px; width: 1px; background: #a29971; }
.feature-icon { width: 68px; height: 68px; border: 2px solid #efc764; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; color: #f2cd74; }
.feature-icon svg { width: 36px; height: 36px; }
.feature-item h3 { font-size: clamp(14px, 1.2vw, 20px); color: #fff; margin: 0 0 5px; }
.feature-item p { font-size: clamp(13px, 1vw, 17px); line-height: 1.5; color: #eee; margin: 0 auto; max-width: 245px; }
.hero-features-script { text-align: center; flex: 0 0 19%; }
.hero-features-script .script { font-size: clamp(35px, 3.5vw, 59px); transform: rotate(-9deg); line-height: .9; margin-bottom: 30px; }
.hero-features-script .hero2-tagline-track { font-size: clamp(9px, .9vw, 15px); white-space: nowrap; }

.section { padding: 72px 48px; }
.section-inner { max-width: 1100px; margin: 0 auto; }
.section-subtle { background: var(--color-bg-subtle); }
.section-title {
  font-family: var(--font-serif-display);
  font-size: var(--text-display-md);
  text-align: center;
  margin: 0 0 40px;
  color: var(--text-primary);
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.service-card .icon { color: var(--brand-accent-hover); display: inline-flex; }
.service-card h3 { font-family: var(--font-sans); font-size: var(--text-heading-sm); margin: 14px 0 6px; color: var(--text-primary); }
.service-card p { font-size: var(--text-body-sm); color: var(--text-secondary); margin: 0; }

.step-num {
  font-family: var(--font-mono);
  font-size: var(--text-heading-md);
  color: var(--brand-accent-hover);
  margin-bottom: 10px;
}
.step h3 { font-family: var(--font-sans); font-size: var(--text-heading-sm); margin: 0 0 6px; }
.step p { font-size: var(--text-body-sm); color: var(--text-secondary); margin: 0; }

.rental-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.rental-card h3 { font-family: var(--font-sans); font-size: var(--text-heading-sm); margin: 0 0 4px; }
.rental-card p { margin: 0; font-size: var(--text-body-sm); color: var(--text-secondary); }
.rental-card .rent { font-family: var(--font-mono); color: var(--text-primary); }

.site-footer {
  background: var(--neutral-950);
  color: var(--neutral-300);
  padding: 40px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: var(--text-body-sm);
}
.site-footer a { color: var(--neutral-300); font-weight: 500; }
.site-footer nav { display: flex; gap: 20px; }

/* ---------- Featured listing gallery ---------- */
.featured-hero-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
  box-shadow: var(--shadow-md);
}
.featured-hero-sm { display: block; max-width: 640px; margin: 0 auto; }

/* Photo viewer with prev/next arrows */
.hero-viewer { position: relative; }
.hero-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand-primary);
  font-size: 30px;
  line-height: 1;
  padding: 0 0 4px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.hero-nav:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.hero-nav.prev { left: 14px; }
.hero-nav.next { right: 14px; }
/* Horizontal scrolling photo strip */
.gallery-scroll {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border-strong) transparent;
}
.gallery-scroll::-webkit-scrollbar { height: 8px; }
.gallery-scroll::-webkit-scrollbar-track { background: transparent; }
.gallery-scroll::-webkit-scrollbar-thumb { background: var(--color-border-strong); border-radius: 4px; }
.gallery-scroll a, .gallery-scroll .gallery-thumb { flex: 0 0 auto; display: block; scroll-snap-align: start; }
.gallery-scroll .gallery-thumb {
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius-md);
}
.gallery-scroll img {
  width: 220px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gallery-scroll a:hover img, .gallery-scroll .gallery-thumb:hover img { transform: scale(1.03); box-shadow: var(--shadow-md); }
.gallery-scroll .gallery-thumb.active img { box-shadow: 0 0 0 3px var(--brand-accent); transform: none; }

/* ---------- Owner portal ---------- */
.portal-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.portal-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.portal-brand { display: flex; align-items: center; gap: 36px; }
.portal-brand .logo { height: 52px; width: auto; display: block; }
.portal-tabs { display: flex; gap: 28px; }
.portal-tabs a {
  font-family: var(--font-sans);
  font-size: var(--text-body-md);
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 2px;
  border-bottom: 2px solid transparent;
}
.portal-tabs a:hover { text-decoration: none; color: var(--brand-primary); }
.portal-tabs a.active { color: var(--brand-primary); border-bottom-color: var(--brand-primary); }
.portal-user { display: flex; align-items: center; gap: 14px; font-size: var(--text-body-sm); color: var(--text-secondary); }

.portal-main { max-width: 1200px; margin: 0 auto; padding: 32px; }
.portal-stack { display: flex; flex-direction: column; gap: 24px; }
.page-title { font-family: var(--font-serif-display); font-size: var(--text-display-md); margin: 0; color: var(--text-primary); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-value { font-family: var(--font-mono); font-size: 30px; color: var(--text-primary); margin-top: 8px; }

.split-2 { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }

.filter-bar { display: flex; gap: 14px; align-items: flex-end; }
.filter-bar .grow { flex: 1; }

.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-top: 28px; }
.detail-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
.detail-actions { display: flex; gap: 10px; margin-top: 32px; flex-wrap: wrap; }
.detail-value { font-size: var(--text-body-md); color: var(--text-primary); margin-top: 4px; }

.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border);
}
.payment-row:last-child { border-bottom: none; }
.payment-row .amount { font-family: var(--font-mono); font-size: var(--text-body-sm); }

.activity-feed { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; font-size: var(--text-body-sm); color: var(--text-secondary); }

/* ---------- Messages (two-pane) ---------- */
.message-pane { display: flex; height: 480px; }
.thread-list { width: 280px; border-right: 1px solid var(--color-border); overflow-y: auto; }
.thread-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 18px;
  border: none;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  background: transparent;
  font-family: var(--font-sans);
}
.thread-item:hover { background: var(--color-bg); }
.thread-item.active { background: var(--brand-primary-tint); }
.thread-item .thread-name { font-weight: 700; font-size: var(--text-body-sm); color: var(--text-primary); }
.thread-item .thread-prop { font-size: var(--text-caption); color: var(--text-muted); margin-top: 2px; }
.thread-item .thread-preview {
  font-size: var(--text-caption); color: var(--text-secondary); margin-top: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-accent); display: inline-block; }

.conversation { flex: 1; display: flex; flex-direction: column; padding: 20px; }
.conversation-head { font-weight: 700; color: var(--text-primary); margin-bottom: 14px; }
.conversation-body { flex: 1; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; margin-bottom: 14px; }
.bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: var(--text-body-sm);
  color: var(--text-primary);
}
.bubble.mine { align-self: flex-end; background: var(--brand-primary-tint); }
.bubble.theirs { align-self: flex-start; background: var(--color-bg-subtle); }
.bubble .bubble-meta { display: block; font-size: var(--text-caption); color: var(--text-muted); margin-top: 4px; }
.reply-bar { display: flex; gap: 10px; }
.reply-bar .grow { flex: 1; }

/* ---------- Attachments ---------- */
.attachment-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.attachment-slot {
  border: 1px dashed var(--color-border-strong);
  border-radius: 10px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: var(--text-body-sm);
  color: var(--text-muted);
  background: var(--color-bg);
  overflow: hidden;
  padding: 8px;
}
.attachment-slot img, .attachment-slot video { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.attachment-slot.filled { border-style: solid; padding: 0; background: #000; }
.attachment-slot a { color: var(--brand-primary); font-size: var(--text-caption); }
.video-box { max-width: 380px; margin-top: 16px; }
.video-box video { width: 100%; border-radius: var(--radius-md); background: #000; }

/* ---------- Tenant portal ---------- */
.tenant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

.list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }

/* ---------- Auth pages ---------- */
.auth-wrap { max-width: 420px; margin: 56px auto; }
.auth-wrap .logo { display: block; height: 84px; margin: 0 auto 24px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .grid-3, .grid-4, .stat-grid { grid-template-columns: 1fr 1fr; }
  .split-2, .tenant-grid { grid-template-columns: 1fr; }
  .portal-header-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .portal-brand { flex-direction: column; align-items: flex-start; gap: 12px; }
}
@media (max-width: 1000px) {
  .hero-features-inner { flex-direction: column; gap: 28px; }
  .hero-features-grid { grid-template-columns: 1fr 1fr; width: 100%; }
  .hero-features-script { text-align: center; }
  .feature-item + .feature-item { border-left: none; }
  .hero2-tagline { display: none; }
}
@media (max-width: 640px) {
  .gallery-scroll img { width: 180px; }
  .site-header { flex-direction: column; gap: 12px; padding: 16px 20px 0; }
  .site-header .logo { height: 72px; margin-bottom: -24px; }
  .site-header nav { flex-wrap: wrap; justify-content: center; gap: 16px; }
  .header-actions { flex-wrap: wrap; justify-content: center; }
  .section { padding: 48px 20px; }
  .hero2-content { padding: 64px 24px; }
  .hero2-bg::after { background: rgba(9, 61, 31, 0.88); }
  .hero2 h1 { font-size: 2.2rem; }
  .hero-features { padding: 32px 20px; }
  .grid-3, .grid-4, .stat-grid, .form-grid, .detail-grid, .detail-grid-2, .attachment-grid { grid-template-columns: 1fr; }
  .portal-main { padding: 20px 16px; }
  .message-pane { flex-direction: column; height: auto; }
  .thread-list { width: 100%; border-right: none; border-bottom: 1px solid var(--color-border); max-height: 240px; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}

/* Keep public navigation usable before JS loads and when JS is disabled. */
@media (max-width: 1399px) and (min-width: 1200px) {
  .public-menu { gap: 16px; }
  .site-header nav { gap: 18px; }
  .header-actions { gap: 12px; }
  .header-actions .btn { padding: 10px 13px; gap: 8px; }
  .header-actions .btn svg { width: 22px; height: 22px; }
}
@media (max-width: 1199px) {
  .site-header, .site-header-home { position: relative; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; background: #002b1c; padding: 12px 24px; gap: 12px; }
  .site-header .site-brand { position: static; width: auto; }
  .site-header .logo { width: 105px; height: auto; margin: 0; }
  .menu-toggle:not([hidden]) { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid #e6c375; border-radius: 8px; background: transparent; color: #fff; font: 600 16px var(--font-sans); cursor: pointer; }
  .menu-toggle-icon { font-size: 23px; line-height: 1; }
  .site-header .public-menu { flex: 0 0 100%; margin: 0; padding: 20px; border-radius: 12px; }
  .site-header .public-menu::before { display: none; }
  .menu-ready .public-menu { display: none; }
  .menu-ready.menu-open .public-menu { display: flex; }
  .site-header nav { flex: 1; flex-wrap: wrap; gap: 8px 24px; justify-content: flex-start; padding: 0; }
  .site-header nav a { font-size: 15px; }
  .header-actions { padding: 0; flex-direction: column; gap: 10px; }
  .header-actions .btn { width: 100%; font-size: 14px; }
  .hero2-bg { background-size: auto 100%; }
  .hero2-content { padding: 110px 5% 95px; }
  .hero2 h1 { font-size: clamp(48px, 6.7vw, 76px); }
  .hero2 p { max-width: 55%; }
  .hero2-tagline { display: block; top: 20px; right: 5%; }
  .hero2-tagline .script { font-size: 30px; }
  .hero2-tagline-track { font-size: 10px; }
  .hero-features { padding: 12px 24px 32px; }
  .hero-features-inner { flex-direction: column; gap: 30px; }
  .hero-features-grid { grid-template-columns: repeat(4, 1fr); width: 100%; }
  .feature-item { padding: 0 12px; }
  .hero-features-script .script { font-size: 40px; margin-bottom: 20px; }
}
@media (max-width: 640px) {
  .site-header { padding: 10px 20px; }
  .site-header .logo { width: 124px; }
  .site-header .public-menu, .menu-ready.menu-open .public-menu { flex-direction: column; align-items: stretch; gap: 20px; }
  .site-header nav { flex-direction: column; align-items: stretch; gap: 0; }
  .site-header nav a { padding: 12px 8px; }
  .site-header nav a[aria-current="page"]::after { left: 8px; right: auto; width: 36px; }
  .header-actions { align-items: stretch; }
  .hero2-bg { background-size: auto 100%; background-position: 64% center; }
  .hero2-bg::after { background: linear-gradient(90deg, rgba(0, 30, 18, .95), rgba(0, 30, 18, .73)); }
  .hero2-content { padding: 114px 24px 100px; }
  .hero2-tagline { left: 24px; right: 24px; text-align: left; }
  .hero2-tagline .hero2-tagline-track { color: #fff; text-shadow: none; font-size: 9px; }
  .hero2-tagline .script { font-size: clamp(24px, 6.7vw, 34px); color: #f2cd74; text-shadow: none; }
  .hero2 h1 { font-size: clamp(39px, 10.4vw, 65px); }
  .hero2 p { max-width: 100%; font-size: 20px; line-height: 1.35; }
  .hero2 p + p { font-size: 15px; }
  .hero2-buttons { flex-direction: column; align-items: stretch; gap: 12px; }
  .btn-hero { font-size: 16px; padding: 14px 18px; justify-content: space-between; }
  .hero-features-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 0; }
  .feature-item:nth-child(odd)::before { display: none; }
  .feature-icon { width: 56px; height: 56px; }
  .feature-item h3 { font-size: 15px; }
  .feature-item p { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Match the cleaned logo backing to the surrounding brand field. */
.site-header { background-color: #01301f; }
.site-header-home { background-color: transparent; }
.hero2-bg::after { background: linear-gradient(90deg, #01301f 0%, #01301f 23%, rgba(0, 30, 18, .77) 36%, transparent 60%); }
@media (max-width: 640px) { .hero2-bg::after { background: linear-gradient(90deg, rgba(0, 30, 18, .95), rgba(0, 30, 18, .73)); } }
@media (max-width: 1199px) { .site-header-home { background-color: #01301f; } }
