:root {
  --green: #1a6b4a;
  --green-dark: #0f4a32;
  --green-light: #e8f5ee;
  --accent: #e85d04;
  --bg: #f8faf9;
  --white: #fff;
  --text: #1a1f1c;
  --muted: #5c6860;
  --border: #d8e4dc;
  --radius: 10px;
  --shadow: 0 4px 20px rgba(26, 107, 74, 0.1);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); line-height: 1.55; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }
.container { width: min(1140px, 94vw); margin: 0 auto; }

.site-header { background: var(--green-dark); color: #fff; padding: 0.75rem 0; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.2rem; color: #fff; }
.brand em { color: #7dcea0; font-style: normal; }
.nav { display: flex; gap: 0.9rem; flex-wrap: wrap; align-items: center; }
.nav a { color: rgba(255,255,255,0.92); font-size: 0.92rem; font-weight: 500; }
.nav-toggle { display: none; background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; }

.btn { display: inline-block; padding: 0.65rem 1.1rem; border-radius: 8px; font-weight: 600; border: none; cursor: pointer; font-size: 0.95rem; text-align: center; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { color: #fff; opacity: 0.92; }
.btn-secondary { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,0.5); }
.btn-outline { background: transparent; color: var(--green); border: 2px solid var(--green); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
.btn-block { display: block; width: 100%; }

.hero { background: linear-gradient(135deg, var(--green-dark), var(--green)); color: #fff; padding: 2.5rem 0 3rem; }
.hero h1 { margin: 0 0 0.75rem; font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.2; }
.hero p { opacity: 0.92; margin-bottom: 1.25rem; }
.hero-search { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; max-width: 520px; }

.section { padding: 2rem 0; }
.section-title { font-size: 1.5rem; margin: 0 0 0.25rem; color: var(--green-dark); }
.section-sub { color: var(--muted); margin: 0 0 1.5rem; }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card { background: var(--white); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow); }
.card-body { padding: 1rem; }
.card-img { aspect-ratio: 16/10; background: var(--green-light); object-fit: cover; width: 100%; display: block; }
.card-img-placeholder { aspect-ratio: 16/10; background: var(--green-light); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.9rem; }
.card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.price { font-size: 1.25rem; font-weight: 800; color: var(--green-dark); }
.meta { color: var(--muted); font-size: 0.88rem; }
.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.72rem; font-weight: 700; background: var(--green-light); color: var(--green-dark); }
.badge-featured { background: var(--accent); color: #fff; }

.form-input, select.form-input, textarea.form-input { width: 100%; padding: 0.7rem 0.85rem; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; margin-bottom: 0.75rem; background: #fff; }
.form-label { display: block; font-weight: 600; margin-bottom: 0.25rem; font-size: 0.9rem; }
.form-row { margin-bottom: 0.25rem; }
.filter-bar { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; align-items: end; }
.filter-bar .form-input { margin-bottom: 0; }

.messages { list-style: none; padding: 0; margin: 0.75rem 0; }
.messages li { padding: 0.75rem 1rem; border-radius: 8px; margin-bottom: 0.4rem; }
.messages .success { background: var(--green-light); color: var(--green-dark); }
.messages .error, .messages .warning { background: #fdecea; color: #b42318; }
.messages .info { background: #eef4ff; color: #1d4ed8; }

.page-hero { background: var(--green-dark); color: #fff; padding: 1.75rem 0; }
.page-hero h1 { margin: 0; font-size: 1.6rem; }
.content-block { background: var(--white); border-radius: var(--radius); padding: 1.25rem; border: 1px solid var(--border); margin: 1.25rem 0; }

.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; }
.detail-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; }
.detail-gallery img { border-radius: 8px; aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.map-embed { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); min-height: 220px; background: var(--green-light); }
.map-embed iframe { width: 100%; height: 220px; border: 0; }

.site-footer { background: var(--green-dark); color: rgba(255,255,255,0.85); padding: 2rem 0 1.5rem; margin-top: 2rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.5rem; }
.site-footer h4 { color: #7dcea0; margin: 0 0 0.75rem; }
.site-footer a { color: rgba(255,255,255,0.85); display: block; margin-bottom: 0.35rem; }
.footer-bottom { text-align: center; padding-top: 1.25rem; border-top: 1px solid rgba(255,255,255,0.15); font-size: 0.88rem; opacity: 0.75; }

/* Dashboard */
.dash-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.dash-sidebar { background: var(--green-dark); color: #fff; padding: 1rem; }
.dash-sidebar a { display: block; padding: 0.5rem 0; color: rgba(255,255,255,0.88); font-size: 0.92rem; }
.dash-sidebar a:hover { color: #7dcea0; }
.dash-sidebar .section-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.6; margin: 1rem 0 0.35rem; }
.dash-main { padding: 1.25rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat-card .num { font-size: 1.75rem; font-weight: 800; color: var(--green-dark); }
.stat-card .lbl { font-size: 0.82rem; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius); overflow: hidden; font-size: 0.9rem; }
th, td { padding: 0.65rem 0.85rem; text-align: left; border-bottom: 1px solid var(--border); }
th { background: var(--green-dark); color: #fff; font-weight: 600; }

.login-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card { width: min(420px, 100%); background: var(--white); padding: 1.5rem; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.login-card h1 { margin: 0 0 0.5rem; font-size: 1.4rem; color: var(--green-dark); }

.msg-thread { max-height: 400px; overflow-y: auto; margin-bottom: 1rem; }
.msg-bubble { padding: 0.65rem 0.9rem; border-radius: 10px; margin-bottom: 0.5rem; max-width: 85%; }
.msg-bubble.mine { background: var(--green-light); margin-left: auto; }
.msg-bubble.theirs { background: #f0f0f0; }
.msg-meta { font-size: 0.75rem; color: var(--muted); }

.hero-badge { display: inline-block; background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.35); padding: 0.25rem 0.75rem; border-radius: 999px; font-size: 0.82rem; font-weight: 700; margin-bottom: 0.75rem; }
.hero-lead { font-size: 1.1rem; opacity: 0.95; }
.guide-hero { padding: 2.5rem 0; }
.guide-hero h1 { font-size: clamp(1.5rem, 4vw, 2.2rem); }

.list-path-card { transition: transform 0.15s, box-shadow 0.15s; }
.list-path-card:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(26, 107, 74, 0.15); }
.list-path-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.link-arrow { color: var(--green); font-weight: 600; font-size: 0.9rem; }

.kind-badge { display: inline-block; background: var(--green-light); color: var(--green-dark); padding: 0.1rem 0.45rem; border-radius: 4px; font-size: 0.75rem; font-weight: 700; margin-right: 0.25rem; }

.benefit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.benefit-card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.benefit-icon { font-size: 1.75rem; margin-bottom: 0.5rem; }
.benefit-card h3 { margin: 0 0 0.5rem; color: var(--green-dark); font-size: 1.05rem; }
.cta-block { background: var(--green-light); border-radius: var(--radius); padding: 1.5rem; text-align: center; }

.rent-table { font-size: 0.88rem; }
.rent-table th { font-size: 0.82rem; }
.rent-stats-row { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; }
.rent-stats-row span { font-size: 0.95rem; }

.faq-list { max-width: 720px; }
.faq-item { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 0.5rem; padding: 0.75rem 1rem; }
.faq-item summary { font-weight: 600; cursor: pointer; color: var(--green-dark); }
.faq-item p { margin: 0.75rem 0 0; color: var(--muted); }

.checkbox-grid ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0.35rem 1rem; }
.checkbox-grid li { margin: 0; }
.checkbox-grid label { display: flex; align-items: center; gap: 0.4rem; font-weight: 500; font-size: 0.92rem; cursor: pointer; }
.checkbox-grid input[type="checkbox"] { width: auto; margin: 0; accent-color: var(--green); }

/* Roommate profiles & matching */
.roommate-card-top { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
.match-badge { background: var(--accent); color: #fff; }
.availability-line { font-size: 0.88rem; font-weight: 600; color: var(--green-dark); margin: 0.35rem 0; display: flex; align-items: center; gap: 0.35rem; }
.avail-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.avail-active { background: #22c55e; }
.completion-bar-wrap { height: 6px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 0.35rem 0; }
.completion-bar { height: 100%; background: linear-gradient(90deg, var(--green), #7dcea0); border-radius: 999px; }
.lifestyle-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0; }
.lifestyle-tag { font-size: 0.75rem; background: var(--green-light); color: var(--green-dark); padding: 0.15rem 0.5rem; border-radius: 4px; }
.match-panel { border-color: var(--green); }
.match-score-bar { height: 10px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 0.75rem 0; }
.match-score-fill { height: 100%; background: linear-gradient(90deg, var(--accent), #f59e0b); border-radius: 999px; }
.match-breakdown { list-style: none; padding: 0; margin: 0.75rem 0 0; font-size: 0.88rem; }
.match-breakdown li { display: grid; grid-template-columns: 100px 40px 1fr; gap: 0.5rem; padding: 0.4rem 0; border-bottom: 1px solid var(--border); }
.match-pts { font-weight: 700; color: var(--green); }
.match-note { color: var(--muted); }
.questionnaire-dl { margin: 0; }
.questionnaire-dl dt { font-weight: 600; margin-top: 0.75rem; display: flex; align-items: center; gap: 0.4rem; }
.questionnaire-dl dd { margin: 0.2rem 0 0 1.5rem; color: var(--text); }
.q-check { display: inline-flex; width: 1.1rem; height: 1.1rem; align-items: center; justify-content: center; border-radius: 50%; font-size: 0.7rem; font-weight: 700; }
.q-yes { background: var(--green-light); color: var(--green-dark); }
.q-no { background: #f0f0f0; color: var(--muted); }
.lifestyle-list { list-style: none; padding: 0; margin: 0; font-size: 0.92rem; }
.lifestyle-list li { padding: 0.3rem 0; border-bottom: 1px solid var(--border); }
.section-progress-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.section-progress-item { background: var(--white); border: 1px solid var(--border); border-radius: 8px; padding: 0.65rem; }
.questionnaire-section h3 { color: var(--green-dark); margin-top: 0; }

@media (max-width: 768px) {
  .nav { display: none; width: 100%; flex-direction: column; align-items: flex-start; }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
  .detail-grid { grid-template-columns: 1fr; }
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; }
  .dash-sidebar a { padding: 0.25rem 0; }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .hero-search { grid-template-columns: 1fr; }
}