/* ============================================================
   ALLSEAD — Global Design System
   "Old money, warm, exclusive, mobile-first."
   Palette: INSEAD Green, Cream, Charcoal, Pearl
   Fonts: Cormorant Garamond (display) + DM Sans (body)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ──────────────────────────────────────────────────────────
   CSS Custom Properties
────────────────────────────────────────────────────────── */
:root {
  /* Brand Colors */
  --green-900: #062A1A;
  --green-800: #0A3D26;
  --green-700: #0F5132;
  --green-600: #157347;
  --green-500: #198754;
  --green-400: #28A06A;
  --green-300: #6DBF99;
  --green-200: #B8DFCD;
  --green-100: #E2F1EB;
  --green-50:  #F1F9F5;

  /* Cream / Beige Palette */
  --cream-900: #3A3028;
  --cream-700: #7A6E5E;
  --cream-500: #BDB29F;
  --cream-300: #E8DED0;
  --cream-200: #F2EDE4;
  --cream-100: #F8F4EE;
  --cream-50:  #FDFAF6;

  /* Neutrals */
  --charcoal: #1A1A1A;
  --ink:      #2C2C2C;
  --slate:    #4A4A5A;
  --mist:     #8A8A9A;
  --silver:   #C8C8D8;
  --pearl:    #F0F0F5;
  --white:    #FFFFFF;

  /* Accent */
  --gold:     #B8962E;
  --gold-light: #D4B86A;

  /* Semantic */
  --bg:       var(--cream-50);
  --surface:  var(--white);
  --border:   rgba(0,0,0,0.08);
  --border-strong: rgba(0,0,0,0.15);
  --text-primary: var(--ink);
  --text-secondary: var(--slate);
  --text-muted: var(--mist);
  --brand:    var(--green-700);
  --brand-hover: var(--green-600);

  /* Liquid Glass */
  --glass-bg: rgba(255,255,255,0.72);
  --glass-bg-strong: rgba(255,255,255,0.88);
  --glass-border: rgba(255,255,255,0.45);
  --glass-shadow: 0 8px 32px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --glass-shadow-hover: 0 16px 48px rgba(0,0,0,0.12), 0 2px 4px rgba(0,0,0,0.06);

  /* Typography */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-2xl: 40px;
  --radius-full: 9999px;

  /* Transitions */
  --ease-gentle: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1);
  --transition-fast: 150ms var(--ease-gentle);
  --transition-base: 250ms var(--ease-gentle);
  --transition-slow: 400ms var(--ease-gentle);

  /* Nav height */
  --nav-h: 64px;
  --mobile-nav-h: 52px;

  /* Section-specific tints */
  --market-tint: rgba(15,81,50,0.04);
  --housing-tint: rgba(184,150,46,0.05);
  --social-tint: rgba(10,61,38,0.03);
  --playbook-tint: rgba(242,237,228,0.8);
}

/* ──────────────────────────────────────────────────────────
   Reset & Base
────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { display: block; max-width: 100%; }
input, textarea, select { font-family: inherit; }

/* ──────────────────────────────────────────────────────────
   Typography Scale
────────────────────────────────────────────────────────── */
.text-display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
h1 { font-family: var(--font-display); font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 400; line-height: 1.15; }
h2 { font-family: var(--font-display); font-size: clamp(1.5rem, 3.5vw, 2.5rem); font-weight: 400; line-height: 1.2; }
h3 { font-family: var(--font-display); font-size: clamp(1.25rem, 2.5vw, 1.875rem); font-weight: 400; line-height: 1.25; }
h4 { font-family: var(--font-body); font-size: 1rem; font-weight: 600; line-height: 1.4; letter-spacing: 0.01em; }
h5 { font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; line-height: 1.4; letter-spacing: 0.02em; text-transform: uppercase; }

.label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ──────────────────────────────────────────────────────────
   Layout Containers
────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}
.page-padded {
  padding-top: calc(var(--nav-h) + var(--space-8));
  padding-bottom: var(--space-16);
}

/* ──────────────────────────────────────────────────────────
   Page Header (compact section header — Market, Housing, Social)
────────────────────────────────────────────────────────── */
.page-header {
  position: relative;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: calc(var(--nav-h) + var(--space-5)) var(--space-5) var(--space-4);
  overflow: hidden;
}
.page-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}
.page-header-left { min-width: 0; }
.page-header-eyebrow {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 4px;
}
.page-header-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.1;
}
.page-header-sub {
  font-size: .875rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.page-header-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: .04;
  pointer-events: none;
}

/* ──────────────────────────────────────────────────────────
   Navigation
────────────────────────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  padding: 0 var(--space-6);
  max-width: 1440px;
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.nav-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.nav-brand-text {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--brand);
  letter-spacing: -0.01em;
  line-height: 1;
}

.nav-tagline {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
  letter-spacing: 0.02em;
  display: none;
}

@media (min-width: 600px) { .nav-tagline { display: block; } }

/* ── Alpha Testing badge ─────────────────────────── */
.nav-alpha-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(99, 102, 241, .1);
  border: 1px solid rgba(99, 102, 241, .22);
  color: #6366F1;
  margin-left: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  user-select: none;
}
.nav-alpha-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #6366F1;
  animation: alphapulse 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes alphapulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(99,102,241,.45); }
  50%       { opacity: .7; box-shadow: 0 0 0 4px rgba(99,102,241,0); }
}
@media (max-width: 380px) { .nav-alpha-badge { display: none; } }

.nav-links {
  display: none;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
}

@media (min-width: 768px) { .nav-links { display: flex; } }

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--brand);
  background: var(--green-50);
}

.nav-link.active {
  color: var(--brand);
  background: none;
  border-bottom: 2px solid var(--brand);
  border-radius: 0;
  padding-bottom: calc(var(--space-2) - 2px);
}

.nav-link-special {
  background: var(--green-50);
  color: var(--brand);
  border: 1px solid var(--green-200);
  font-weight: 600;
}

.nav-link-special:hover {
  background: var(--green-100);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-left: auto;
}

@media (min-width: 768px) { .nav-actions { margin-left: 0; } }

.nav-campus-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--brand);
  background: var(--green-50);
  border: 1px solid var(--green-200);
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
  display: none;
}

@media (min-width: 640px) { .nav-campus-badge { display: block; } }

/* Mobile menu button */
.nav-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: var(--transition-fast);
}
.nav-menu-btn:hover { background: var(--pearl); }
@media (min-width: 768px) { .nav-menu-btn { display: none; } }

/* Nav avatar */
.nav-avatar-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-avatar-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--brand-light);
  transition: border-color var(--transition-fast);
}
.nav-avatar-link:hover .nav-avatar-img { border-color: var(--brand); }
.nav-avatar-initials {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--white);
  font-size: 0.8125rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--brand-light);
  transition: border-color var(--transition-fast);
}
.nav-avatar-link:hover .nav-avatar-initials { border-color: var(--white); }

/* Mobile drawer */
.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
}

.nav-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.2);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.nav-drawer-panel {
  position: absolute;
  top: 0; right: 0;
  width: min(320px, 85vw);
  height: 100%;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid var(--glass-border);
  transform: translateX(100%);
  transition: transform var(--transition-base);
  padding: calc(var(--nav-h) + var(--space-6)) var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow-y: auto;
}

.nav-drawer.open { pointer-events: all; }
.nav-drawer.open .nav-drawer-backdrop { opacity: 1; }
.nav-drawer.open .nav-drawer-panel { transform: translateX(0); }

.nav-drawer-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 1rem;
  transition: var(--transition-fast);
}
.nav-drawer-link:hover, .nav-drawer-link.active {
  background: var(--green-50);
  color: var(--brand);
}
.nav-drawer-link svg { width: 18px; height: 18px; flex-shrink: 0; }

.nav-drawer-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-2) 0;
}

/* ──────────────────────────────────────────────────────────
   Glass Card System
────────────────────────────────────────────────────────── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
}

.glass-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(28px) saturate(2);
  -webkit-backdrop-filter: blur(28px) saturate(2);
  border: 1px solid rgba(255,255,255,0.6);
  box-shadow: var(--glass-shadow);
  border-radius: var(--radius-lg);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
  overflow: hidden;
  transition: box-shadow var(--transition-base), transform var(--transition-base);
}

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

.card-body { padding: var(--space-5); }
.card-body-lg { padding: var(--space-6) var(--space-8); }

/* ──────────────────────────────────────────────────────────
   Buttons
────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: none;
  transition: var(--transition-fast);
  white-space: nowrap;
  line-height: 1;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background var(--transition-fast);
}

.btn:hover::before { background: rgba(255,255,255,0.1); }

.btn-primary {
  background: var(--brand);
  color: var(--white);
  box-shadow: 0 1px 3px rgba(15,81,50,0.3);
}
.btn-primary:hover {
  background: var(--brand-hover);
  box-shadow: 0 4px 12px rgba(15,81,50,0.4);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--cream-100);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--cream-200); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--pearl); color: var(--text-primary); }

.btn-danger {
  background: #DC2626;
  color: var(--white);
}
.btn-danger:hover { background: #B91C1C; }

.btn-sm {
  padding: 0.4375rem 0.875rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1.0625rem;
  border-radius: var(--radius-md);
}

.btn-xl {
  padding: 1.125rem 2.25rem;
  font-size: 1.125rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}
.btn-icon.btn-sm { width: 28px; height: 28px; }

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* Loading spinner in btn */
.btn-loading { position: relative; }
.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ──────────────────────────────────────────────────────────
   Form Elements
────────────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: var(--space-2); }
.form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.form-required { color: #DC2626; margin-left: 2px; }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15,81,50,0.12);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--mist); }

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

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z' fill='%238A8A9A'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 20px;
  padding-right: 2.5rem;
}

.form-error {
  font-size: 0.8125rem;
  color: #DC2626;
  display: none;
}
.form-error.visible { display: block; }

.form-input.invalid { border-color: #DC2626; }
.form-input.invalid:focus { box-shadow: 0 0 0 3px rgba(220,38,38,0.12); }

/* Character counter */
.char-counter {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
}
.char-counter.near-limit { color: #F59E0B; }
.char-counter.at-limit { color: #DC2626; }

/* Combobox / search dropdown */
.combobox-wrapper { position: relative; }
.combobox-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow-hover);
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
  display: none;
}
.combobox-dropdown.open { display: block; }
.combobox-option {
  padding: 0.625rem 1rem;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.combobox-option:hover, .combobox-option.highlighted {
  background: var(--green-50);
  color: var(--brand);
}
.combobox-group-label {
  padding: 0.5rem 1rem 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ──────────────────────────────────────────────────────────
   Alert / Toast System
────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  border: 1px solid;
}
.alert-success { background: var(--green-50); border-color: var(--green-200); color: var(--green-800); }
.alert-error { background: #FEF2F2; border-color: #FCA5A5; color: #B91C1C; }
.alert-info { background: #EFF6FF; border-color: #BAE0FD; color: #1D4ED8; }
.alert-warning { background: #FFFBEB; border-color: #FDE68A; color: #92400E; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: var(--white);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  pointer-events: all;
  transform: translateY(8px);
  opacity: 0;
  transition: transform var(--transition-base), opacity var(--transition-base);
  max-width: 320px;
}
.toast.visible { transform: translateY(0); opacity: 1; }
.toast.success { background: var(--green-700); }
.toast.error { background: #DC2626; }

/* ──────────────────────────────────────────────────────────
   Badge / Tag System
────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.badge-green { background: var(--green-100); color: var(--green-700); }
.badge-gold { background: rgba(184,150,46,0.12); color: var(--gold); }
.badge-gray { background: var(--pearl); color: var(--slate); }
.badge-red { background: #FEF2F2; color: #B91C1C; }
.badge-orange { background: #FFF7ED; color: #C2410C; }
.badge-blue { background: #EFF6FF; color: #1D4ED8; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--pearl);
  color: var(--slate);
  border: 1px solid var(--border);
}

/* ──────────────────────────────────────────────────────────
   Hero / Campus Background System
────────────────────────────────────────────────────────── */
.campus-hero {
  position: relative;
  overflow: hidden;
  background: var(--green-900);
}

.campus-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.55;
  transition: opacity 1s ease;
}

.campus-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(6,42,26,0.3) 0%,
    rgba(6,42,26,0.6) 60%,
    rgba(6,42,26,0.85) 100%
  );
}

/* ──────────────────────────────────────────────────────────
   Quote Block (Playbook Campus Quotes)
────────────────────────────────────────────────────────── */
.quote-block {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-8);
  background: var(--green-900);
  color: var(--cream-200);
}

.quote-block-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  transition: opacity 1s ease;
}

.quote-block-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(6,42,26,0.75) 0%, rgba(6,42,26,0.55) 100%);
}

.quote-block-content {
  position: relative;
  z-index: 1;
}

.quote-text {
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 3vw, 2rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.45;
  color: var(--cream-100);
  margin-bottom: var(--space-4);
}

.quote-text::before {
  content: '\201C';
  font-size: 1.2em;
  color: var(--green-300);
  margin-right: 0.1em;
}

.quote-attribution {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--green-300);
  letter-spacing: 0.04em;
}

/* Quote animation */
@keyframes quoteSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.quote-animate { animation: quoteSlideIn 0.8s var(--ease-out) both; }

/* ──────────────────────────────────────────────────────────
   Listing Cards (Market / Housing)
────────────────────────────────────────────────────────── */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}

@media (min-width: 768px) {
  .listing-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

.listing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  cursor: pointer;
}
.listing-card:hover {
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-3px);
}

.listing-card-photo {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--cream-200);
  position: relative;
}

.listing-card-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease-gentle);
}
.listing-card:hover .listing-card-photo img { transform: scale(1.03); }

.listing-card-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
  color: var(--mist);
  background: linear-gradient(135deg, var(--cream-200), var(--cream-300));
}

.listing-card-badges {
  position: absolute;
  top: var(--space-3);
  left: var(--space-3);
  display: flex;
  gap: var(--space-2);
}

.listing-card-body {
  padding: var(--space-4);
}

.listing-card-price {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 500;
  color: var(--brand);
  margin-bottom: var(--space-1);
}

.listing-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
  line-height: 1.3;
}

.listing-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.listing-card-meta-item {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* ──────────────────────────────────────────────────────────
   Social Post Cards
────────────────────────────────────────────────────────── */
.post-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  transition: box-shadow var(--transition-fast);
}
.post-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.06); }

.post-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.post-avatar {
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  background: var(--green-100);
  border: 2px solid var(--green-200);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.125rem;
  color: var(--brand);
  font-weight: 600;
}

.post-avatar img { width: 100%; height: 100%; object-fit: cover; }

.post-author-name {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
}
.post-author-meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.post-content {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  white-space: pre-wrap;
  word-break: break-word;
}

.post-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.post-action-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}
.post-action-btn:hover { color: var(--brand); background: var(--green-50); }
.post-action-btn.active { color: var(--brand); }

/* ──────────────────────────────────────────────────────────
   Playbook Section Cards
────────────────────────────────────────────────────────── */
.playbook-section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: box-shadow var(--transition-base), transform var(--transition-base), border-color var(--transition-base);
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.playbook-section-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 4px;
  height: 100%;
  background: var(--brand);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform var(--transition-base);
  border-radius: 0 4px 4px 0;
}

.playbook-section-card:hover {
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
  border-color: var(--green-200);
}
.playbook-section-card:hover::before { transform: scaleY(1); }

.playbook-section-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  background: var(--green-50);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.playbook-section-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 400;
  color: var(--text-primary);
}

.playbook-section-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Playbook entry */
.playbook-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.playbook-entry + .playbook-entry { margin-top: var(--space-3); }

/* ──────────────────────────────────────────────────────────
   Hero Tiles (Home Page)
────────────────────────────────────────────────────────── */
.section-tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 640px) {
  .section-tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .section-tiles { grid-template-columns: repeat(4, 1fr); }
}

.section-tile {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--green-900);
  aspect-ratio: 4/5;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-decoration: none;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

@media (min-width: 1024px) {
  .section-tile:first-child { grid-row: span 1; aspect-ratio: auto; min-height: 380px; }
}

.section-tile:hover { transform: scale(1.02); box-shadow: 0 20px 60px rgba(0,0,0,0.2); }

.section-tile-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s var(--ease-gentle), opacity 0.3s;
  opacity: 0.7;
}
.section-tile:hover .section-tile-bg { transform: scale(1.05); opacity: 0.85; }

.section-tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(6,42,26,0.85) 0%, rgba(6,42,26,0.2) 60%, transparent 100%);
}

.section-tile-content {
  position: relative;
  z-index: 1;
  padding: var(--space-5);
  color: var(--white);
}

.section-tile-icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-2);
  opacity: 0.9;
}

.section-tile-name {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 400;
  line-height: 1.15;
  margin-bottom: var(--space-1);
}

.section-tile-desc {
  font-size: 0.8125rem;
  opacity: 0.75;
  line-height: 1.5;
}

/* ──────────────────────────────────────────────────────────
   Filters Bar
────────────────────────────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-6);
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  white-space: nowrap;
}
.filter-pill:hover { border-color: var(--brand); color: var(--brand); background: var(--green-50); }
.filter-pill.active { background: var(--brand); color: var(--white); border-color: var(--brand); }

/* ──────────────────────────────────────────────────────────
   Salamander Chat UI
────────────────────────────────────────────────────────── */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - var(--nav-h) - var(--space-8));
  max-height: 820px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  background: linear-gradient(to right, var(--green-50), transparent);
  flex-shrink: 0;
}

.chat-avatar {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  background: var(--green-100);
  border: 2px solid var(--green-300);
  overflow: hidden;
  flex-shrink: 0;
}

.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  scroll-behavior: smooth;
}

.chat-message {
  display: flex;
  gap: var(--space-3);
  max-width: 85%;
  animation: messageIn 0.3s var(--ease-out) both;
}

@keyframes messageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.chat-message.assistant .chat-bubble {
  background: var(--cream-100);
  border: 1px solid var(--cream-300);
  color: var(--text-primary);
  border-bottom-left-radius: var(--radius-sm);
}

.chat-message.user .chat-bubble {
  background: var(--brand);
  color: var(--white);
  border-bottom-right-radius: var(--radius-sm);
}

.chat-input-area {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  background: var(--cream-100);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-5);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.chat-input-row:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15,81,50,0.1);
}

.chat-input-field {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.9375rem;
  font-family: var(--font-body);
  color: var(--text-primary);
  resize: none;
  max-height: 120px;
  padding: 0.375rem 0;
}
.chat-input-field::placeholder { color: var(--mist); }

.chat-send-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: var(--brand);
  color: var(--white);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-fast);
}
.chat-send-btn:hover { background: var(--brand-hover); }
.chat-send-btn:disabled { opacity: 0.4; }

/* Token indicator */
.token-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-2);
}
.token-bar-track {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.token-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: var(--radius-full);
  transition: width 0.5s var(--ease-out);
}
.token-bar-fill.warning { background: #F59E0B; }
.token-bar-fill.critical { background: #DC2626; }

/* ──────────────────────────────────────────────────────────
   Modal / Dialog
────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(6,42,26,0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base);
}

@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  overflow-y: auto;
  box-shadow: 0 -4px 60px rgba(0,0,0,0.15);
  transform: translateY(16px);
  transition: transform var(--transition-base);
}

@media (min-width: 640px) {
  .modal { border-radius: var(--radius-xl); transform: scale(0.97); box-shadow: 0 24px 80px rgba(0,0,0,0.2); }
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

@media (min-width: 640px) {
  .modal-overlay.open .modal { transform: scale(1); }
}

@media (max-width: 639px) {
  .modal-overlay {
    padding: 0;
    padding-top: env(safe-area-inset-top, 20px);
  }
  .modal {
    max-height: calc(100dvh - env(keyboard-inset-height, 0px) - 60px);
  }
}

.modal-drag-handle {
  width: 40px; height: 4px;
  background: var(--silver);
  border-radius: var(--radius-full);
  margin: var(--space-3) auto;
}

@media (min-width: 640px) { .modal-drag-handle { display: none; } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 400;
}

.modal-body { padding: var(--space-6); }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-6);
  border-top: 1px solid var(--border);
  background: var(--cream-50);
}

/* ──────────────────────────────────────────────────────────
   Admin War Room / Situation Room
────────────────────────────────────────────────────────── */
.admin-header {
  background: var(--green-900);
  color: var(--white);
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 0;
}

.admin-grid {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: calc(100dvh - var(--nav-h));
}

@media (max-width: 768px) {
  .admin-grid { grid-template-columns: 1fr; }
}

.admin-sidebar {
  background: var(--ink);
  padding: var(--space-6) var(--space-4);
  border-right: 1px solid rgba(255,255,255,0.06);
  min-height: calc(100dvh - var(--nav-h));
}

@media (max-width: 768px) {
  .admin-sidebar { display: none; }
}

.admin-sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  transition: var(--transition-fast);
  margin-bottom: var(--space-1);
}
.admin-sidebar-link:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.admin-sidebar-link.active { background: var(--green-800); color: var(--white); }

.admin-content {
  padding: var(--space-8);
  overflow-y: auto;
}

@media (max-width: 768px) {
  .admin-content { padding: var(--space-5); }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
}

.stat-value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--brand);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-label { font-size: 0.8125rem; color: var(--text-muted); font-weight: 500; }

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

.data-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--cream-50);
}

.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--cream-50); }

/* ──────────────────────────────────────────────────────────
   Cookie Banner
────────────────────────────────────────────────────────── */
.cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 180;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.08);
  padding: var(--space-4) var(--space-6);
  transform: translateY(100%);
  transition: transform 0.5s var(--ease-out);
}
.cookie-banner.visible { transform: translateY(0); }

.cookie-banner-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding: var(--space-2) 0;
}

.cookie-banner-content {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  flex: 1;
  min-width: 260px;
}

.cookie-banner-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.cookie-banner-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.cookie-banner-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.cookie-banner-actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
  align-items: center;
}

/* ──────────────────────────────────────────────────────────
   Footer
────────────────────────────────────────────────────────── */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.65);
  padding: var(--space-10) 0 var(--space-6);
  margin-top: var(--space-16);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: var(--space-6);
}

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

.footer-brand-name {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--white);
  margin-bottom: var(--space-2);
}

.footer-tagline {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
  margin-bottom: var(--space-5);
}

.footer-col-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: var(--space-4);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
}

.footer-link {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  transition: color var(--transition-fast);
}
.footer-link:hover { color: var(--white); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.footer-legal {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.35);
  line-height: 1.6;
}

.footer-legal strong { color: rgba(255,255,255,0.55); }

/* ──────────────────────────────────────────────────────────
   Veil Section (Social)
────────────────────────────────────────────────────────── */
.veil-card {
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-10);
  color: var(--cream-100);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.veil-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(21,115,71,0.3), transparent 60%),
              radial-gradient(circle at 70% 60%, rgba(184,150,46,0.15), transparent 60%);
  animation: veilPulse 8s ease-in-out infinite;
}

@keyframes veilPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

.veil-content { position: relative; z-index: 1; }

/* ──────────────────────────────────────────────────────────
   Onboarding Steps
────────────────────────────────────────────────────────── */
.onboarding-progress {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-8);
}

.onboarding-step {
  flex: 1;
  height: 3px;
  background: var(--cream-300);
  border-radius: var(--radius-full);
  transition: background var(--transition-slow);
}
.onboarding-step + .onboarding-step { margin-left: var(--space-2); }
.onboarding-step.done { background: var(--brand); }
.onboarding-step.active { background: var(--green-400); }

/* ──────────────────────────────────────────────────────────
   Animations
────────────────────────────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}

.animate-fadeIn { animation: fadeIn 0.5s var(--ease-out) both; }
.animate-slideUp { animation: slideUp 0.5s var(--ease-out) both; }
.animate-slideIn { animation: slideIn 0.4s var(--ease-out) both; }

/* Stagger children */
.stagger-children > * { animation: slideUp 0.5s var(--ease-out) both; }
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }

/* Skeleton loading */
.skeleton {
  background: linear-gradient(90deg, var(--cream-200) 25%, var(--cream-100) 50%, var(--cream-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ──────────────────────────────────────────────────────────
   Utilities
────────────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }
.gap-6 { gap: var(--space-6); }
.w-full { width: 100%; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }

@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.hidden { display: none !important; }
.invisible { visibility: hidden; }

.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-6) 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--text-muted);
}

.empty-state-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-xl);
  background: var(--cream-200);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  color: var(--mist);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Turnstile wrapper */
.turnstile-wrapper {
  display: flex;
  justify-content: center;
  margin: var(--space-4) 0;
}

/* ──────────────────────────────────────────────────────────
   Auth Page
────────────────────────────────────────────────────────── */
.auth-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 1fr;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

@media (min-width: 900px) {
  .auth-page { grid-template-columns: 1fr 1fr; }
}

.auth-hero {
  position: relative;
  background: var(--green-900);
  display: none;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-12);
  min-height: 100dvh;
  overflow: hidden;
}

@media (min-width: 900px) { .auth-hero { display: flex; } }

.auth-hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.4;
}

.auth-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top right, rgba(6,42,26,0.9), rgba(6,42,26,0.5));
}

.auth-hero-content { position: relative; z-index: 1; color: var(--white); }

.auth-hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4vw, 3.5rem);
  font-weight: 300;
  line-height: 1.15;
  margin-bottom: var(--space-6);
  color: var(--cream-100);
}

.auth-hero-features {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.auth-hero-feature {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.7);
}

.auth-hero-feature-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green-400);
  flex-shrink: 0;
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-6);
  min-height: 100dvh;
  background: var(--cream-50);
}

@media (min-width: 900px) {
  .auth-panel { min-height: 100dvh; }
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 40px rgba(0,0,0,0.08);
  padding: var(--space-8);
  animation: slideUp 0.5s var(--ease-out) both;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-8);
}

.auth-logo-img {
  width: 40px; height: 40px;
  border-radius: 50%;
  overflow: hidden;
}

.auth-logo-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.auth-logo-name {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 600;
  color: var(--brand);
}

/* ──────────────────────────────────────────────────────────
   Profile / My Space
────────────────────────────────────────────────────────── */
.profile-header-card {
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  color: var(--white);
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-6);
}

.profile-avatar-lg {
  width: 80px; height: 80px;
  border-radius: var(--radius-full);
  border: 3px solid rgba(255,255,255,0.3);
  overflow: hidden;
  background: var(--green-700);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--white);
  font-weight: 400;
  cursor: pointer;
  transition: border-color var(--transition-fast);
  margin-bottom: var(--space-4);
}
.profile-avatar-lg:hover { border-color: rgba(255,255,255,0.6); }
.profile-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }

.profile-name {
  font-family: var(--font-display);
  font-size: 1.875rem;
  font-weight: 400;
  margin-bottom: var(--space-1);
}

.profile-promo-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  border: 1px solid rgba(255,255,255,0.2);
  margin-top: var(--space-2);
}

/* ──────────────────────────────────────────────────────────
   Responsive overrides
────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .card-body-lg { padding: var(--space-5); }
  .modal-body { padding: var(--space-5); }
  .modal-header { padding: var(--space-4) var(--space-5); }
  .modal-footer { padding: var(--space-4) var(--space-5); }
  .listing-grid { grid-template-columns: 1fr; }
  .filters-bar { flex-direction: column; align-items: stretch; }
  .section-header { align-items: flex-start; flex-direction: column; }
  .chat-container { height: calc(100dvh - var(--nav-h) - var(--space-4)); border-radius: 0; border: none; }
}

/* Print */
@media print {
  .nav, .cookie-banner, .footer, .chat-input-area { display: none; }
  body { background: white; color: black; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ================================================================
   ROUND 5 ADDITIONS — Housing · Social · Me · Fixes
   ================================================================ */

/* ── listing-card-img aliases (used in housing.html) ── */
.listing-card-img-wrap {
  aspect-ratio: 16/10; overflow: hidden;
  background: var(--cream-200); position: relative;
}
.listing-card-img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s var(--ease-gentle);
}
.listing-card:hover .listing-card-img { transform: scale(1.03); }
.listing-card-img-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; font-size: 2rem; color: var(--mist);
  background: linear-gradient(135deg, var(--cream-200), var(--cream-300));
}

/* ── Housing type badge variants ── */
.listing-type-badge {
  display: inline-flex; align-items: center;
  padding: .2rem .65rem; border-radius: var(--radius-full);
  font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.type-takeover { background: var(--green-100); color: var(--green-700); }
.type-flatmate { background: rgba(184,150,46,.12); color: #7A5C1E; }

/* ── Status ribbon on housing card photo ── */
.status-ribbon {
  position: absolute; top: var(--space-2); right: var(--space-2);
  padding: .2rem .6rem; border-radius: var(--radius-full);
  font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.ribbon-filled { background: var(--mist); color: var(--white); }
.ribbon-reserved { background: var(--gold); color: var(--white); }

/* ── Housing hero campus bg ── */
.housing-hero::before, .social-hero::before {
  content: ''; position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: .18; background-image: var(--campus-bg, none);
}

/* ── Leaving-soon mini cards ── */
.leaving-mini-card {
  flex-shrink: 0; width: 200px; background: var(--surface);
  border: 1px solid rgba(249,115,22,.25); border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4); cursor: pointer;
  transition: box-shadow .15s, transform .15s;
}
.leaving-mini-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); transform: translateY(-2px); }
.leaving-mini-price { font-family: var(--font-display); font-size: 1.125rem; font-weight: 500; color: var(--brand); }
.leaving-mini-title { font-size: .8125rem; font-weight: 600; color: var(--text-primary); margin: .15rem 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leaving-mini-meta { font-size: .75rem; color: #C2410C; font-weight: 500; }
@keyframes lpulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── Legacy property banner ── */
.legacy-banner {
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-800) 100%);
  border-radius: var(--radius-xl); padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-5); display: flex; align-items: center;
  justify-content: space-between; gap: var(--space-4); flex-wrap: wrap;
}
.legacy-pill {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: .375rem .875rem; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15); border-radius: var(--radius-full);
  font-size: .8125rem; color: rgba(255,255,255,.8); cursor: pointer; transition: all .15s; white-space: nowrap;
}
.legacy-pill:hover { background: rgba(255,255,255,.18); color: var(--white); }

/* ── Social: Post campus chip ── */
.post-campus-chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: 1px 8px; background: var(--green-50); border: 1px solid var(--green-200);
  border-radius: 999px; font-size: .7rem; font-weight: 600; color: var(--brand); letter-spacing: .03em;
}
.post-card-pinned { border-left: 3px solid var(--gold); }

/* ── Veil card (sidebar) ── */
.veil-card-elevated {
  background: linear-gradient(135deg, var(--green-900) 0%, #0a3520 50%, #071c10 100%);
  border-radius: var(--radius-xl); padding: var(--space-7) var(--space-6);
  color: var(--cream-100); position: relative; overflow: hidden;
  display: block; text-decoration: none;
}
.veil-card-elevated::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 40% at 20% 30%, rgba(109,191,153,.18), transparent),
              radial-gradient(ellipse 50% 60% at 80% 70%, rgba(184,150,46,.12), transparent);
  animation: veilShift 8s ease-in-out infinite alternate;
}
@keyframes veilShift { from { opacity:.6; transform:scale(1) } to { opacity:1; transform:scale(1.04) } }
.veil-content { position: relative; z-index: 1; }
.veil-badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: .25rem .875rem; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  font-size: .75rem; font-weight: 600; color: rgba(255,255,255,.7);
  letter-spacing: .04em; text-transform: uppercase; margin-bottom: var(--space-4);
}
.veil-badge-dot { width: 6px; height: 6px; background: var(--green-300); border-radius: 50%; animation: pdot 2s infinite; }
@keyframes pdot { 0%,100%{opacity:1;box-shadow:0 0 0 0 rgba(25,135,84,.5)} 50%{opacity:.6;box-shadow:0 0 0 5px rgba(25,135,84,0)} }
.veil-title { font-family: var(--font-display); font-size: 1.75rem; font-weight: 300; margin-bottom: var(--space-2); letter-spacing: -.01em; }
.veil-desc { font-size: .9rem; color: rgba(255,255,255,.6); line-height: 1.65; margin-bottom: var(--space-5); }
.veil-enter-btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: .625rem 1.5rem; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius-full);
  color: rgba(255,255,255,.88); font-size: .875rem; font-weight: 600;
  backdrop-filter: blur(8px); transition: all .2s;
}
.veil-enter-btn:hover { background: rgba(255,255,255,.2); color: var(--white); }

/* ── Pulse ── */
.pulse-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .75rem; font-weight: 700; color: var(--green-500); letter-spacing: .05em; text-transform: uppercase;
}
.pulse-live::before { content:''; width:7px; height:7px; background:var(--green-500); border-radius:50%; animation:pdot 2s infinite; }
.pulse-chip {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-2) var(--space-3); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  font-size: .8125rem; color: var(--text-secondary); white-space: nowrap;
  flex-shrink: 0; transition: border-color .15s;
}
.pulse-chip:hover { border-color: var(--brand); background: var(--green-50); }
.pulse-chip-time { font-size: .7rem; color: var(--text-muted); }

/* ── Event tiles ── */
.event-tile {
  display: flex; align-items: flex-start; gap: var(--space-4);
  padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); transition: background .12s;
}
.event-tile:last-of-type { border-bottom: none; }
.event-tile:hover { background: var(--cream-50); }
.event-date-block {
  flex-shrink: 0; width: 44px; text-align: center;
  padding: var(--space-2) 0; background: var(--green-50);
  border-radius: var(--radius-md); border: 1px solid var(--green-200);
}
.event-date-day { font-family: var(--font-display); font-size: 1.375rem; font-weight: 500; color: var(--brand); line-height: 1; }
.event-date-month { font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-top: 2px; }
.event-tile-body { flex: 1; min-width: 0; }
.event-tile-title { font-weight: 600; font-size: .9375rem; color: var(--text-primary); margin-bottom: .2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-tile-time { font-size: .8125rem; color: var(--text-muted); margin-bottom: .2rem; }
.event-tile-meta { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.event-campus-pill {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: 1px 7px; background: var(--green-100); color: var(--brand);
  border-radius: 999px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.events-add-btn {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-3) var(--space-5); width: 100%; background: none;
  border: none; border-top: 1px solid var(--border); color: var(--brand);
  font-size: .875rem; font-weight: 500; cursor: pointer; transition: background .12s; font-family: inherit;
}
.events-add-btn:hover { background: var(--green-50); }

/* ── Me page: profile card banner ── */
.profile-stat-chip {
  display: flex; align-items: center; gap: var(--space-1);
  padding: .25rem .75rem; background: var(--green-50);
  border: 1px solid var(--green-200); border-radius: var(--radius-full);
  font-size: .8rem; color: var(--brand); font-weight: 500;
}

/* ── Thread messages in housing contact modal ── */
.thread-msgs {
  max-height: 200px; overflow-y: auto; display: flex; flex-direction: column;
  gap: var(--space-3); padding: var(--space-3); background: var(--cream-50);
  border-radius: var(--radius-md); margin-bottom: var(--space-3);
}
.tmsg { display: flex; gap: var(--space-2); align-items: flex-start; }
.tmsg.mine { flex-direction: row-reverse; }
.tmsg-bubble {
  max-width: 80%; padding: var(--space-2) var(--space-3);
  font-size: .875rem; line-height: 1.5; border-radius: var(--radius-md);
}
.tmsg.theirs .tmsg-bubble { background: var(--surface); border: 1px solid var(--border); color: var(--text-primary); }
.tmsg.mine .tmsg-bubble { background: var(--brand); color: white; }
.tmsg-time { font-size: .7rem; color: var(--text-muted); margin-top: 3px; white-space: nowrap; }

/* ── Social post inline thread ── */
.post-thread {
  display: none; padding: 0 var(--space-5) var(--space-3);
  border-top: 1px solid var(--border); margin-top: var(--space-2);
}
.post-thread.open { display: block; }
.comment-item {
  display: flex; gap: var(--space-2); padding: var(--space-2) 0;
  border-bottom: 1px solid rgba(0,0,0,.04);
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
  width: 26px; height: 26px; min-width: 26px; border-radius: 50%;
  background: var(--green-100); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: .6875rem; font-weight: 600; overflow: hidden;
}
.comment-avatar img { width: 100%; height: 100%; object-fit: cover; }
.comment-author { font-size: .8125rem; font-weight: 600; color: var(--text-primary); }
.comment-time { font-size: .7rem; color: var(--text-muted); margin-left: 6px; }
.comment-text { font-size: .875rem; color: var(--text-secondary); line-height: 1.5; margin-top: 2px; word-break: break-word; }
.thread-compose { display: flex; gap: var(--space-2); align-items: center; padding-top: var(--space-2); }
.reply-input {
  flex: 1; background: var(--cream-50); border: 1px solid var(--border);
  border-radius: 999px; padding: .4rem .875rem; font-size: .875rem;
  color: var(--text-primary); outline: none; font-family: inherit; transition: border-color .15s;
}
.reply-input:focus { border-color: var(--brand); background: var(--surface); }
.reply-btn {
  background: var(--brand); color: white; border: none; border-radius: 999px;
  padding: .4rem .875rem; font-size: .8125rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background .15s;
}
.reply-btn:hover { background: var(--brand-hover); }
.reply-btn:disabled { opacity: .45; cursor: not-allowed; }

/* ── Responsive round 5 ── */
@media (max-width: 640px) {
  .veil-card-elevated { padding: var(--space-5) var(--space-4); }
  .veil-title { font-size: 1.375rem; }
  .event-tile { padding: var(--space-3) var(--space-4); gap: var(--space-3); }
  .event-date-block { width: 38px; }
  .event-date-day { font-size: 1.125rem; }
  .legacy-banner { flex-direction: column; gap: var(--space-3); }
  .thread-msgs { max-height: 160px; }
}

/* ═══════════════════════════════════════════════════════════
   MOBILE-FIRST LAYER — Batch 6
   Global bottom nav, safe-area, toolbar stacking
═══════════════════════════════════════════════════════════ */

/* ── Safe-area: nav top ─────────────────────────────────── */
.nav {
  padding-top: env(safe-area-inset-top);
  height: calc(var(--nav-h) + env(safe-area-inset-top));
}
.page-padded {
  padding-top: calc(var(--nav-h) + env(safe-area-inset-top) + var(--space-8));
}

/* ── Global mobile bottom tab bar ───────────────────────── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 95;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (max-width: 767px) {
  .mobile-bottom-nav { display: flex; }
}

.mobile-bottom-nav-inner {
  display: flex;
  width: 100%;
  align-items: stretch;
}

.mob-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 4px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.12s;
  -webkit-tap-highlight-color: transparent;
  min-height: 52px;
}
.mob-tab:active { opacity: 0.65; }
.mob-tab.active { color: var(--brand); }
.mob-tab svg { width: 20px; height: 20px; stroke-width: 1.75; flex-shrink: 0; }
.mob-tab.active svg { stroke-width: 2.25; }
.mob-tab-label { line-height: 1; letter-spacing: 0.01em; }

/* ── Body bottom padding when bottom nav is visible ─────── */
@media (max-width: 767px) {
  body:not(.no-bottom-nav) {
    padding-bottom: calc(52px + env(safe-area-inset-bottom));
  }
}

/* ── listings-grid alias ──────────────────────────────────
   housing.html uses .listings-grid but CSS defines .listing-grid */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-5);
}
@media (max-width: 480px) {
  .listings-grid { grid-template-columns: 1fr; gap: var(--space-4); }
}
@media (min-width: 768px) {
  .listings-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

/* ── Search toolbar — stacks vertically on mobile ────────── */
.search-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}
.search-toolbar .search-input-wrap {
  flex: 1;
  min-width: 0; /* override any inline min-width */
}
@media (max-width: 640px) {
  .search-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-toolbar .form-select,
  .search-toolbar select {
    width: 100%;
  }
  .search-toolbar .btn,
  .search-toolbar button {
    width: 100%;
    justify-content: center;
  }
}

/* ── Market search row ────────────────────────────────────── */
.market-search-row {
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .market-search-row {
    flex-direction: column;
  }
  .market-search-wrapper {
    min-width: 0 !important;
    width: 100%;
  }
  .market-search-row .form-select {
    width: 100%;
  }
  .market-search-row .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Housing hero buttons stack on mobile ────────────────── */
@media (max-width: 480px) {
  .housing-hero-content {
    flex-direction: column;
    align-items: flex-start;
  }
  .housing-hero-content > div:last-child {
    width: 100%;
  }
  .housing-hero-content > div:last-child .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* ── Housing type tabs — scroll horizontally on small screens */
.housing-type-tabs {
  overflow-x: auto;
  flex-wrap: nowrap !important;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.housing-type-tabs::-webkit-scrollbar { display: none; }

/* ── Modal: full bottom-sheet behaviour on mobile ─────────── */
@media (max-width: 640px) {
  .modal {
    max-height: 92dvh;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }
  .modal-body {
    padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom));
  }
  .modal-header {
    padding: var(--space-4) var(--space-4);
  }
  .modal-footer {
    padding: var(--space-4);
    padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  }
}

/* ── Form rows inside modals — single column on mobile ─────── */
@media (max-width: 480px) {
  .form-row-2col,
  .detail-grid {
    grid-template-columns: 1fr !important;
  }
  .listing-detail-meta {
    grid-template-columns: 1fr 1fr;
  }
}

/* ── Card tap target sizes (min 44px touch areas) ─────────── */
@media (max-width: 767px) {
  .btn, button.btn {
    min-height: 44px;
  }
  .category-pill, .housing-type-tab {
    min-height: 40px;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}

/* ── Leaving-soon mini cards: narrower on small screens ────── */
@media (max-width: 480px) {
  .leaving-mini-card { width: 168px; }
}

/* ── Thread messages: taller on mobile for thumb reach ─────── */
@media (max-width: 640px) {
  .thread-msgs { max-height: 200px; }
}

/* ── Market/Housing layout padding ─────────────────────────── */
@media (max-width: 767px) {
  .market-content,
  .housing-layout {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
  .housing-hero {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
  .market-hero-content {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ══════════════════════════════════════════════════════════════
   MOBILE-FIRST IMPROVEMENTS — Global adjustments for <640px
═══════════════════════════════════════════════════════════════ */

/* ── Nav: tighter on mobile ──────────────────────────────────── */
@media (max-width: 639px) {
  .nav-inner {
    padding: 0 var(--space-4);
    gap: var(--space-2);
  }
  .nav-logo-name { display: none; }
  .nav-tagline   { display: none !important; }
  .nav-links     { gap: var(--space-1); }

  /* ── Page padded: reduce top padding on mobile ─────────────── */
  .page-padded {
    padding-top: calc(var(--nav-h) + var(--space-4));
    padding-bottom: var(--space-10);
  }

  /* ── Cards: full bleed with less radius on mobile ──────────── */
  .listing-card {
    border-radius: var(--radius-lg);
  }

  /* ── Modal: full-screen on mobile ──────────────────────────── */
  .modal-box {
    width: 100% !important;
    max-width: 100% !important;
    min-width: unset !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    margin: 0 !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    max-height: 92dvh;
    overflow-y: auto;
  }
  .modal-overlay {
    align-items: flex-end;
  }

  /* ── Tabs: scrollable horizontally ─────────────────────────── */
  .tabs-strip, .campus-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
    padding-bottom: 2px;
  }
  .tabs-strip::-webkit-scrollbar,
  .campus-tabs::-webkit-scrollbar { display: none; }

  /* ── Profile page ───────────────────────────────────────────── */
  .profile-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
  }
  .profile-tabs::-webkit-scrollbar { display: none; }

  /* ── Stat pills on hero sections ──────────────────────────── */
  .housing-stats, .market-stats {
    gap: var(--space-2);
  }
  .stat-pill {
    padding: var(--space-2) var(--space-3);
    font-size: 0.8125rem;
  }

  /* ── Feed / grid: single column ───────────────────────────── */
  .listings-grid {
    grid-template-columns: 1fr;
  }

  /* ── Hero padding ──────────────────────────────────────────── */
  .market-hero, .housing-hero, .s-hero, .pb-hero {
    padding: var(--space-8) var(--space-4) var(--space-6);
  }
  .market-hero h1, .housing-hero h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  /* ── Salamander input area ─────────────────────────────────── */
  .sal-input-row {
    flex-direction: column;
    gap: var(--space-2);
  }
  .sal-send-btn {
    width: 100%;
    justify-content: center;
  }

  /* ── Social compose ────────────────────────────────────────── */
  .compose-footer {
    flex-wrap: wrap;
    gap: var(--space-2);
  }
  .compose-send-wrap {
    margin-left: 0;
    width: 100%;
  }
  .compose-send-wrap .btn {
    width: 100%;
    justify-content: center;
  }

  /* ── Home dashboard tiles ──────────────────────────────────── */
  .home-tiles {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
  }
  .home-tile {
    padding: var(--space-4);
  }

  /* ── Footer: single column ─────────────────────────────────── */
  .footer-top {
    grid-template-columns: 1fr !important;
    gap: var(--space-6);
  }
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
  }
  .footer-bottom p { text-align: center !important; }

  /* ── Playbook section grid ─────────────────────────────────── */
  .playbook-sections-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ── Tablet adjustments (640–899px) ────────────────────────── */
@media (min-width: 640px) and (max-width: 899px) {
  .listings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .home-tiles {
    grid-template-columns: repeat(2, 1fr);
  }
  .modal-box {
    width: min(92vw, 560px);
  }
}


/* ── CAMPUS FLAG EMOJI ─────────────────────────────────────────
   Flags render as two-letter codes on Windows/Chrome desktop.
   We hide them on desktop (≥900 px) and show on mobile/tablet. */
.campus-flag { display: inline; line-height: 1; }
@media (min-width: 900px) { .campus-flag { display: none; } }

/* ── MOBILE RESPONSIVE ─────────────────────────────────────────
   Mobile-first improvements: modals, grids, nav, tabs, forms    */
@media (max-width: 639px) {
  .nav-inner { padding: 0 var(--space-4); gap: var(--space-2); }
  .nav-tagline { display: none !important; }

  /* Bottom-sheet modals */
  .modal-overlay { align-items: flex-end !important; padding: 0 !important; }
  .modal-box {
    width: 100% !important; max-width: 100% !important;
    min-width: unset !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    margin: 0 !important; max-height: 92dvh; overflow-y: auto;
  }

  /* Scrollable tab bars */
  .tabs-strip, .campus-tabs, .profile-tabs, .h-tabs {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; white-space: nowrap;
  }
  .tabs-strip::-webkit-scrollbar,
  .campus-tabs::-webkit-scrollbar,
  .profile-tabs::-webkit-scrollbar,
  .h-tabs::-webkit-scrollbar { display: none; }

  /* Single-column listings */
  .listings-grid, .listing-grid { grid-template-columns: 1fr !important; }

  /* Hero sections */
  .market-hero, .housing-hero, .s-hero, .pb-hero {
    padding: var(--space-8) var(--space-4) var(--space-6);
  }
  .market-hero h1, .housing-hero h1 { font-size: clamp(1.5rem,6vw,2rem); }

  /* Stat pills */
  .housing-stats, .market-stats { gap: var(--space-2); }
  .stat-pill { padding: var(--space-2) var(--space-3); font-size: .8125rem; }

  .page-padded { padding-top: calc(var(--nav-h) + var(--space-4)); }

  /* Social compose */
  .compose-footer { flex-wrap: wrap; gap: var(--space-2); }
  .compose-send-wrap { margin-left: 0 !important; width: 100%; }
  .compose-send-wrap .btn { width: 100%; justify-content: center; }

  /* Home tiles: 2 cols on small screens */
  .home-tiles { grid-template-columns: 1fr 1fr !important; gap: var(--space-3); }
  .home-tile  { padding: var(--space-4); }

  /* Footer */
  .footer-top { grid-template-columns: 1fr !important; gap: var(--space-6); }
  .footer-bottom { flex-direction: column; gap: var(--space-2); text-align: center; }

  /* Playbook */
  .playbook-sections-grid { grid-template-columns: 1fr !important; }
}

@media (min-width: 640px) and (max-width: 899px) {
  .listings-grid { grid-template-columns: repeat(2,1fr); }
  .home-tiles    { grid-template-columns: repeat(2,1fr); }
  .modal-box     { width: min(92vw, 560px); }
}
