/* ============================================================
   ZedHorizone — Bento Pro Dark Theme
   Colors: dark bg, dark cards, green accent, white text
   ============================================================ */
:root {
  --bg:        #0d0d0d;
  --surface:   #1a1a1a;
  --surface2:  #222222;
  --border:    #2a2a2a;
  --text:      #f0f0f0;
  --muted:     #888888;
  --accent:    #27ae60;
  --accent-h:  #219150;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --maxw:      1100px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

body { min-height: 100%; }

img, video, svg, canvas, iframe {
  max-width: 100%;
  height: auto;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(0.85rem, 3vw, 1.25rem);
}

/* ── Skip link ── */
.skip-link {
  position: absolute; left: 8px; top: 8px;
  background: var(--accent); color: #fff;
  padding: 8px 14px; border-radius: 999px;
  z-index: 80; transform: translateY(-120%);
  transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); outline: none; }

/* ── Header ── */
.site-header {
  border-bottom: 1px solid var(--border);
  background: rgba(13,13,13,0.85);
  backdrop-filter: blur(12px);
  position: sticky; top: 0; z-index: 30;
}
.header-inner {
  display: flex; align-items: center; gap: 0.75rem;
  justify-content: space-between; padding: 0.75rem 0;
  flex-wrap: wrap;
}
.brand {
  font-weight: 800; color: var(--accent); text-decoration: none;
  font-size: clamp(1.05rem, 2.5vw, 1.2rem); letter-spacing: -0.5px;
  flex-shrink: 0;
}
.nav {
  display: none;
  align-items: center;
  gap: 0.25rem;
}
.nav a {
  margin: 0 0.35rem; color: var(--muted);
  text-decoration: none; font-size: 0.9rem;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav a:hover { color: var(--text); }
.cta { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.cta .btn { margin-left: 0; white-space: nowrap; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0;
}
.nav-toggle:hover { border-color: #444; }
.nav-toggle[aria-expanded="true"] { border-color: var(--accent); color: var(--accent); }

.mobile-nav {
  display: none;
  width: 100%;
  flex-basis: 100%;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0 0.75rem;
  border-top: 1px solid var(--border);
}
.mobile-nav.open { display: flex; }
.mobile-nav a {
  display: block;
  padding: 0.75rem 0.85rem;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.95rem;
}
.mobile-nav a:hover,
.mobile-nav a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn:hover { background: var(--surface); border-color: #444; }
.btn.primary {
  background: var(--accent); color: #fff;
  border-color: transparent;
}
.btn.primary:hover { background: var(--accent-h); }
.btn.ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}
.btn.ghost:hover { color: var(--text); border-color: #555; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Focus ── */
:focus { outline: 2px solid transparent; }
button:focus, input:focus, select:focus, textarea:focus {
  box-shadow: 0 0 0 3px rgba(39,174,96,0.25);
  border-color: var(--accent);
  outline: none;
}

/* ── Visually hidden ── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── Hero ── */
.hero { padding: clamp(2rem, 6vw, 4rem) 0 clamp(1.5rem, 4vw, 3rem); }
.hero-grid { display: grid; grid-template-columns: 1fr; gap: clamp(1.25rem, 4vw, 2rem); align-items: center; }
.hero-copy { width: 100%; min-width: 0; }
.hero-copy h1 {
  font-size: clamp(1.75rem, 5.5vw, 2.8rem); font-weight: 800;
  line-height: 1.2; margin-bottom: 0.75rem;
  letter-spacing: -0.5px;
}
.lede { color: var(--muted); margin-bottom: 1.5rem; font-size: clamp(0.95rem, 2.5vw, 1.05rem); }

/* ── Search form ── */
.search-form {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.4rem 0.4rem 1rem;
  align-items: center;
  width: 100%;
}
.search-form input,
.search-form select {
  flex: 1 1 140px;
  min-width: 0;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.4rem 0.5rem;
}
.search-form input { flex: 2 1 200px; }
.search-form input::placeholder { color: var(--muted); }
.search-form select option { background: var(--surface2); color: var(--text); }
.search-form #search-clear { padding: 0.4rem 0.9rem; font-size: 0.85rem; }
.search-form .btn.primary {
  border-radius: 999px;
  padding: 0.55rem 1.4rem;
  flex: 1 1 auto;
  min-width: min(100%, 120px);
}

.trust-list {
  display: flex; gap: 0.75rem 1.25rem; padding: 0;
  margin: 1.25rem 0 0; list-style: none;
  flex-wrap: wrap;
}
.trust-list li { color: var(--muted); font-size: 0.9rem; }
.trust-list strong { color: var(--accent); }

.property-illustration { width: 100%; height: auto; border-radius: var(--radius-lg); display: block; }

/* ── Features ── */
.features { padding: clamp(2rem, 5vw, 3rem) 0; }
.features h2 { font-size: clamp(1.25rem, 3.5vw, 1.6rem); font-weight: 700; margin-bottom: 1.5rem; }
.feature-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.feature {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  transition: border-color 0.2s;
}
.feature:hover { border-color: var(--accent); }
.feature h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--text); }
.feature p { color: var(--muted); font-size: 0.9rem; }

/* ── Listings ── */
.listings { padding: clamp(2rem, 5vw, 3rem) 0; }
.listings h2 { font-size: clamp(1.25rem, 3.5vw, 1.6rem); font-weight: 700; margin-bottom: 1.5rem; }
.cards { display: grid; grid-template-columns: 1fr; gap: 1.25rem; }
.card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s, transform 0.2s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card img { width: 100%; height: 160px; object-fit: cover; display: block; }
.card-body { padding: 1rem; }
.card-body h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.3rem; }
.muted { color: var(--muted); font-size: 0.88rem; }
.card-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }

/* ── Contact ── */
.contact { padding: 3rem 0; }
.contact h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.5rem; }
.contact > p { color: var(--muted); margin-bottom: 1.25rem; }
.contact-form { display: grid; gap: 0.75rem; max-width: 480px; }
.contact-form input,
.contact-form textarea {
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: var(--muted); }

/* ── Footer ── */
#contact-section {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text);
}
#contact-section h3 { color: var(--accent); margin-bottom: 0.5rem; }
#contact-section p, #contact-section a { color: var(--muted); font-size: 0.9rem; }
#contact-section a { color: var(--accent); text-decoration: underline; }
#contact-section > div:last-child {
  background: #111;
  color: var(--muted);
  border-top: 1px solid var(--border);
}

/* ── Auth Modal ── */
.modal {
  display: none; position: fixed; inset: 0;
  z-index: 60; align-items: center; justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
}
.modal[aria-hidden="false"] { display: flex; }
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
}
.modal-panel {
  position: relative; z-index: 61;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 520px; width: min(94%, 520px);
  max-height: min(90vh, 900px);
  overflow: auto;
  padding: clamp(1rem, 3vw, 1.5rem);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.modal-close {
  position: absolute; right: 14px; top: 14px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); font-size: 0.9rem;
  width: 28px; height: 28px; border-radius: 999px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--text); }

.auth-panel { max-width: 820px; padding: 0; overflow: hidden; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; min-height: 380px; }
.auth-left {
  background: linear-gradient(160deg, #0f2a1a 0%, #1a3d28 100%);
  border-right: 1px solid var(--border);
  color: var(--text); padding: 2rem;
  display: flex; flex-direction: column; justify-content: center; gap: 1.25rem;
}
.auth-left h2 { font-size: 1.6rem; font-weight: 800; color: var(--accent); }
.auth-left p { color: var(--muted); font-size: 0.9rem; }
.auth-benefits ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.auth-benefits li { color: var(--muted); font-size: 0.9rem; padding-left: 1rem; position: relative; }
.auth-benefits li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); }
.auth-right { padding: 2rem; display: flex; flex-direction: column; justify-content: center; }
.auth-right h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.75rem; }
.auth-actions { display: flex; gap: 0.5rem; margin-bottom: 1rem; }

.status-message {
  padding: 0.6rem 0.9rem; border-radius: var(--radius-sm);
  font-size: 0.88rem; margin-bottom: 0.5rem;
}
.status-message[hidden] { display: none; }
.status-message.info { background: rgba(39,174,96,0.12); color: #7ddfaa; border: 1px solid rgba(39,174,96,0.2); }
.status-message.error { background: rgba(220,38,38,0.12); color: #f87171; border: 1px solid rgba(220,38,38,0.2); }

.auth-form { display: flex; flex-direction: column; gap: 0.65rem; }
.auth-form input,
.auth-form select {
  padding: 0.7rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
}
.auth-form input::placeholder { color: var(--muted); }
.auth-form select option { background: var(--surface2); }

@media (max-width: 700px) {
  .auth-grid { grid-template-columns: 1fr; min-height: 0; }
  .auth-left { display: none; }
  .auth-right { padding: 1.25rem; }
  .auth-panel { width: min(96%, 520px); }
  .search-form {
    border-radius: var(--radius-md);
    padding: 0.75rem;
    flex-direction: column;
    align-items: stretch;
  }
  .search-form input,
  .search-form select,
  .search-form .btn {
    flex: 1 1 auto;
    width: 100%;
  }
  .cta .btn { padding: 0.5rem 0.9rem; font-size: 0.85rem; }
  .card-actions { flex-wrap: wrap; }
  .card-actions .btn { flex: 1 1 auto; }
}

/* ── Responsive breakpoints ── */
@media (min-width: 640px) {
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .mobile-nav,
  .mobile-nav.open { display: none !important; }
  .nav { display: flex; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .header-inner { flex-wrap: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ============================================================
   Dashboard (single source — do not redeclare in HTML)
   ============================================================ */

.dash-header {
  background: rgba(13,13,13,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem clamp(0.75rem, 3vw, 1.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
}
.dash-header .brand {
  font-weight: 800;
  color: var(--accent);
  font-size: clamp(1rem, 3.5vw, 1.1rem);
  text-decoration: none;
}
.dash-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  min-width: 0;
}
.dash-header .user-info {
  display: flex;
  align-items: center;
  gap: 0.4rem 0.65rem;
  font-size: 0.85rem;
  color: var(--muted);
  flex-wrap: wrap;
  min-width: 0;
}
.dash-header .user-info span { font-weight: 600; color: var(--text); }

.dash-wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) clamp(0.75rem, 3vw, 1rem);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
}
.stat-card .label { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.4rem; }
.stat-card .value { font-size: clamp(1.4rem, 5vw, 1.9rem); font-weight: 700; color: var(--text); }
.stat-card .value.green { color: var(--accent); }
.stat-card .value.red   { color: #e74c3c; }
.stat-card .value.amber { color: #f39c12; }

.panel {
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.panel-head {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.panel-head h2 { font-size: 1rem; margin: 0; color: var(--text); }
.panel-body {
  padding: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 0.9rem; }
th {
  text-align: left;
  padding: 0.5rem 0.75rem;
  color: var(--muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--surface2);
  vertical-align: middle;
  color: #d0d0d0;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.badge.green { background: rgba(39,174,96,0.15); color: #7ddfaa; }
.badge.red   { background: rgba(231,76,60,0.15); color: #f87171; }
.badge.amber { background: rgba(243,156,18,0.15); color: #fbbf24; }
.badge.grey  { background: var(--border); color: var(--muted); }

.due-soon  { color: #e74c3c; font-weight: 600; }
.due-ok    { color: var(--accent); }
.due-today { color: #f39c12; font-weight: 700; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.form-group { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; }
.form-group label { font-size: 0.85rem; color: var(--muted); font-weight: 500; }
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  max-width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--surface2);
  color: var(--text);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: #555; }
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(39,174,96,0.2);
}
.form-group textarea { resize: vertical; }

.empty { text-align: center; padding: 2.5rem 1rem; color: #555; font-size: 0.95rem; }

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.btn-sm:hover { border-color: #444; color: var(--text); }
.btn-sm.danger  { border-color: #e74c3c; color: #e74c3c; }
.btn-sm.success { border-color: var(--accent); color: var(--accent); }

#loading-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  font-size: 1rem;
  color: var(--muted);
}

#student-id-display {
  background: var(--surface2);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--muted);
  font-family: monospace;
}

/* Tabs */
.dash-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.dash-tabs::-webkit-scrollbar { display: none; }
.landlord-tab-btn,
.student-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.65rem 1rem;
  cursor: pointer;
  margin-bottom: -1px;
  flex-shrink: 0;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}
.landlord-tab-btn.active,
.student-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
a.student-tab-btn {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
}

/* Student search */
.student-search-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  align-items: stretch;
  margin-bottom: 1.5rem;
  width: 100%;
}
.student-search-bar input,
.student-search-bar select {
  flex: 1 1 140px;
  min-width: 0;
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 0.9rem;
  padding: 0.45rem 0.5rem;
  outline: none;
}
.student-search-bar input { flex: 2 1 180px; color: var(--text); }
.student-search-bar select { color: var(--muted); }
.student-search-bar select option { background: var(--surface2); color: var(--text); }
.student-search-bar .btn {
  flex: 1 1 100%;
  border-radius: 999px;
}

#student-listings {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 1.25rem;
}
#student-load-more-wrap { text-align: center; margin-top: 1.5rem; }

/* Location picker */
.location-picker-wrap { margin-bottom: 0.75rem; }
.location-picker-status { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.5rem; }
.location-picker-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.location-picker-coords { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.location-picker-coords input { background: var(--bg); cursor: default; }

#location-picker-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  align-items: stretch;
  justify-content: center;
  padding: max(0.5rem, env(safe-area-inset-top)) max(0.5rem, env(safe-area-inset-right)) max(0.5rem, env(safe-area-inset-bottom)) max(0.5rem, env(safe-area-inset-left));
}
#location-picker-modal .picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
}
#location-picker-modal .picker-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  width: min(640px, 100%);
  height: min(92dvh, 720px);
  max-height: 92dvh;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
  margin: auto;
}
#location-picker-modal .picker-head {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
#location-picker-modal .picker-head h3 { margin: 0 0 0.25rem; font-size: 1rem; }
#location-picker-modal .picker-head p { margin: 0; font-size: 0.8rem; color: var(--muted); }
#location-picker-map {
  flex: 1 1 auto;
  min-height: 220px;
  width: 100%;
  height: auto;
}
#location-picker-modal .picker-foot {
  padding: 0.85rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.campus-pin { background: none; border: none; font-size: 1.4rem; }

/* Listing detail modal */
.detail-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 60;
  align-items: center;
  justify-content: center;
  padding: max(0.5rem, env(safe-area-inset-top)) 0.5rem max(0.5rem, env(safe-area-inset-bottom));
}
.detail-modal[aria-hidden="false"] { display: flex; }
.detail-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
}
.detail-modal-panel {
  position: relative;
  z-index: 61;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: min(96%, 680px);
  max-height: min(92dvh, 900px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.detail-modal-close {
  position: absolute;
  right: 12px;
  top: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.detail-img-wrap {
  position: relative;
  height: clamp(150px, 28vh, 260px);
  background: #111;
  flex-shrink: 0;
  overflow: hidden;
}
.detail-carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease;
}
.detail-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
}
.detail-nav-btn.prev { left: 10px; }
.detail-nav-btn.next { right: 10px; }
.detail-dots {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
}
.detail-body {
  padding: clamp(1rem, 3vw, 1.5rem);
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.detail-meta-card {
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}
.detail-meta-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}
.detail-meta-value { font-size: 0.9rem; color: var(--text); }
.detail-contact-btn {
  width: 100%;
  padding: 0.75rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.image-preview { margin-top: 0.75rem; }
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 88px), 1fr));
  gap: 0.5rem;
}

/* ── Dashboard mobile portrait ── */
@media (max-width: 700px) {
  .form-row { grid-template-columns: 1fr; }
  .location-picker-coords { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  table { font-size: 0.78rem; min-width: 460px; }
  th, td { padding: 0.4rem; }
  .dash-wrap { padding: 0.85rem 0.75rem 1.5rem; }
  .panel-head { flex-direction: column; align-items: flex-start; }
  .panel-body { padding: 0.9rem; }
  .dash-header {
    flex-direction: column;
    align-items: stretch;
    padding: 0.65rem 0.75rem;
  }
  .dash-nav { width: 100%; justify-content: flex-start; }
  .dash-header .user-info { width: 100%; justify-content: flex-start; }
  .student-search-bar {
    border-radius: var(--radius-md);
    flex-direction: column;
  }
  .student-search-bar input,
  .student-search-bar select,
  .student-search-bar .btn {
    flex: 1 1 auto;
    width: 100%;
  }
  #location-picker-modal .picker-panel {
    width: 100%;
    height: min(94dvh, 100%);
    border-radius: var(--radius-md);
  }
  #location-picker-map { min-height: 240px; }
  .detail-modal-panel { width: 100%; max-height: 94dvh; border-radius: var(--radius-md); }
  #student-listings { grid-template-columns: 1fr; }
}

@media (min-width: 701px) {
  .student-search-bar {
    border-radius: 999px;
    padding: 0.4rem 0.4rem 0.4rem 1rem;
    align-items: center;
  }
  .student-search-bar .btn { flex: 0 0 auto; width: auto; }
}
