:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #0f766e;
  --primary-hover: #0d625b;
  --primary-soft: #ccfbf1;
  --accent: #d97706;
  --accent-soft: #fef3c7;
  --blue: #0284c7;
  --blue-soft: #e0f2fe;
  --danger: #dc2626;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.device-wrapper {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

.device-wrapper.android-mode {
  background: #1e293b;
  padding: 16px;
}

.device-wrapper.android-mode .app-shell {
  width: 412px;
  max-width: 100%;
  height: 100%;
  border-radius: 30px;
  border: 8px solid #0f172a;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.app-shell {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Header */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid #eef2f6;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.brand-title {
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.account-chip:hover { border-color: var(--primary); }

.avatar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: 0.15s ease;
}
.btn-sm { padding: 6px 11px; font-size: 12.5px; }
.btn-xs { padding: 4px 8px; font-size: 12px; border-radius: 6px; }
.btn-full { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: var(--surface-soft); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: #e2e8f0; }
.btn-nav {
  background: #f8fafc;
  color: #334155;
  border: 1px solid #eef2f6;
  border-radius: 9px;
  font-weight: 500;
}
.btn-nav:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #cbd5e1;
}

.badge {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 11px;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: 10px 20px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.filter-group label {
  font-size: 10.5px;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.start-point-wrap {
  flex: 1 1 260px;
  min-width: 220px;
}
.school-picker-wrap {
  flex: 1 1 260px;
  min-width: 220px;
}
.filter-group.compact {
  flex: 0 1 165px;
}

input[type="text"], input[type="email"], input[type="tel"], input[type="time"], input[type="number"], select {
  width: 100%;
  height: 38px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid #e2e8f0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13.5px;
  background: #fff;
  color: var(--text);
}
.input-with-icon {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
.input-with-icon .input-icon {
  position: absolute;
  left: 10px;
  color: #64748b;
  pointer-events: none;
}
.input-with-icon input {
  padding-left: 30px;
  background: #f1f5f9;
  border-color: #e2e8f0;
}
.input-with-icon input:focus {
  background: #fff;
}
input:focus, select:focus {
  outline: 2px solid rgba(15, 118, 110, 0.22);
  border-color: var(--primary);
}

.school-combobox {
  position: relative;
  display: flex;
  gap: 6px;
}
.clear-btn {
  white-space: nowrap;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 9px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color: var(--primary);
}
.clear-btn:hover { background: #f0fdfa; border-color: #99f6e4; }

.dropdown-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 40;
}
.dropdown-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.dropdown-item:hover { background: #f0fdfa; }
.dropdown-item strong { font-size: 13px; }
.dropdown-item small { font-size: 11px; color: var(--muted); }

.privacy-pill {
  padding: 8px 12px;
  border-radius: 8px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  font-size: 12px;
  color: #115e59;
  white-space: nowrap;
}

/* Mobile Tabs */
.mobile-tabs {
  display: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 6px 10px;
  gap: 6px;
}
.tab-btn {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  padding: 7px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Main Split Grid */
.main-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 410px 1fr;
  gap: 0;
}

.list-pane {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pane-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.pane-header h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}
.pane-sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.count-pill {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.matches-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.match-card {
  border: 1px solid #eef2f6;
  border-radius: 14px;
  padding: 14px 16px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  transition: 0.15s ease;
  cursor: pointer;
}
.match-card:hover, .match-card.selected {
  border-color: #99f6e4;
  box-shadow: 0 6px 18px rgba(15, 118, 110, 0.10);
}

.match-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.match-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 9999px;
  background: #f1e4dc;
  color: #8c5a44;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}
.match-nick {
  font-weight: 700;
  font-size: 15px;
  color: #0f172a;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.verified-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #15803d;
  font-weight: 500;
}
.distance-badge {
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 600;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.match-area {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.match-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 10px 0 8px;
}
.role-tag {
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 7px;
}
.role-driver { background: #ccfbf1; color: #0f766e; }
.role-rotating { background: #fef3c7; color: #b45309; }
.role-rider { background: #ede9fe; color: #5b21b6; }

.dir-tag {
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 7px;
  background: #e2e8f0;
  color: #334155;
}
.child-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 7px;
  background: #ffedd5;
  color: #9a3412;
}
.time-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 7px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}

.match-note {
  font-size: 13px;
  color: #334155;
  margin: 6px 0 12px;
  line-height: 1.45;
}

.match-actions {
  display: flex;
  gap: 10px;
}
.btn-dm-modern {
  border-radius: 9px !important;
  font-weight: 500 !important;
  padding: 7px 14px !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-map-modern {
  border-radius: 9px !important;
  font-weight: 500 !important;
  padding: 7px 14px !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f766e !important;
  background: #fff !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-map-modern:hover {
  border-color: #0f766e !important;
  background: #f0fdfa !important;
}

/* Map Pane */
.map-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #e6eef5;
}

.map-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #eef2f6;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
  z-index: 10;
  flex-wrap: wrap;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #334155;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot.home { background: #0284c7; }
.dot.school { background: #d97706; }
.dot.driver { background: #0f766e; }
.dot.rider { background: #4f46e5; }

.map-controls {
  display: flex;
  gap: 6px;
}

.map-viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
  cursor: grab;
  user-select: none;
  background: #dcebf5;
}
.map-viewport:active { cursor: grabbing; }

.map-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.engine-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  white-space: nowrap;
}

.leaflet-div-icon.sg-pin-icon {
  background: transparent;
  border: none;
}

.pin-card {
  position: absolute;
  bottom: 16px;
  left: 16px;
  width: 330px;
  max-width: calc(100% - 32px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.22);
  border: 1px solid var(--border);
  padding: 14px;
  z-index: 1000;
}

.modal-card.modal-sm {
  width: min(460px, calc(100vw - 24px));
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.12s ease;
}
.map-pin:hover {
  transform: translate(-50%, -105%) scale(1.04);
  z-index: 25 !important;
}

.pin-pill {
  background: #fff;
  border: 1.5px solid var(--primary);
  color: var(--text);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.16);
  display: flex;
  align-items: center;
  gap: 5px;
}
.pin-pill .pin-dist {
  color: #0369a1;
  font-weight: 700;
}
.pin-stem {
  width: 3px;
  height: 8px;
  background: var(--primary);
}
.pin-anchor {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
}

.map-pin.home .pin-pill {
  background: #0284c7;
  color: #fff;
  border-color: #fff;
}
.map-pin.home .pin-stem, .map-pin.home .pin-anchor { background: #0284c7; }

.map-pin.school .pin-pill {
  background: #d97706;
  color: #fff;
  border-color: #fff;
}
.map-pin.school .pin-stem, .map-pin.school .pin-anchor { background: #d97706; }

.map-pin.rider .pin-pill { border-color: #4f46e5; }
.map-pin.rider .pin-stem, .map-pin.rider .pin-anchor { background: #4f46e5; }

.map-pin.selected .pin-pill {
  background: #0f766e;
  color: #fff;
  border-color: #fff;
}
.map-pin.selected .pin-pill .pin-dist { color: #ccfbf1; }

.pin-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding-right: 22px;
}
.pin-card-nick { font-weight: 700; font-size: 15px; }
.pin-card-area { font-size: 12px; color: var(--muted); }
.pin-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pin-card-note { font-size: 12.5px; color: #334155; margin: 4px 0 8px; }
.pin-card-privacy {
  font-size: 11px;
  color: #0f766e;
  background: #f0fdfa;
  padding: 6px 8px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.map-footer-note {
  padding: 6px 14px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--muted);
}

/* Account Menu */
.account-menu {
  position: fixed;
  top: 56px;
  right: 16px;
  width: 280px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px;
  z-index: 60;
}
.menu-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.menu-current-info {
  font-size: 12.5px;
  background: var(--surface-soft);
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 8px;
  line-height: 1.45;
}
.menu-actions { display: flex; flex-direction: column; gap: 6px; }
.menu-divider { height: 1px; background: var(--border); margin: 10px 0; }
.account-switch-list {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.switch-item {
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 9px;
  cursor: pointer;
  font-size: 12px;
}
.switch-item:hover { border-color: var(--primary); background: #f0fdfa; }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 2000;
}
.modal-card {
  width: min(680px, calc(100vw - 24px));
  max-width: 100%;
  max-height: calc(100dvh - 24px);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.modal-header h3 { margin: 0; font-size: 17px; }
.modal-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-form-shell {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.modal-scroll-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}
.modal-footer-sticky {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid #eef2f6;
  background: #fff;
  flex-shrink: 0;
}
.btn-ghost-clean {
  background: transparent;
  border: none;
  color: #64748b;
  font-weight: 500;
  border-radius: 9px;
}
.btn-ghost-clean:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.close-x {
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.close-x:hover { color: var(--text); }

.form-section {
  border-radius: 12px;
  padding: 14px;
  border: 1px solid #e2e8f0;
}
.private-box { background: #f8fafc; border-color: #e2e8f0; }
.public-box { background: #f0fdfa; border-color: #ccfbf1; }

.section-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 12px;
  color: #1e293b;
}
.section-badge.public { color: #0f766e; }
.section-icon {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.private-icon { background: #e2e8f0; color: #475569; }
.public-icon { background: #ccfbf1; color: #0f766e; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 11px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full-span { grid-column: 1 / -1; }
.field label { font-size: 12px; font-weight: 600; color: #334155; }
.field-hint { font-size: 11px; color: #64748b; }
.field-hint-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.error-banner {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 12.5px;
}

/* Direct Messaging Modal */
.dm-modal {
  width: min(820px, calc(100vw - 24px));
  max-width: 100%;
  height: 82vh;
  max-height: calc(100dvh - 24px);
  background: #fff;
  border-radius: 16px;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
  min-width: 0;
}
.dm-main { min-width: 0; }
.dm-main-head { flex-wrap: wrap; gap: 8px; }
.dm-main-head > div:first-child { min-width: 0; flex: 1 1 160px; }
.dm-partner-name, .dm-partner-meta { overflow-wrap: anywhere; }
.dm-sidebar {
  border-right: 1px solid var(--border);
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.dm-sidebar-head {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dm-sidebar-head h3 { margin: 0; font-size: 15px; }
.dm-sidebar-head small { color: var(--muted); font-size: 11.5px; }
.dm-thread-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.thread-item {
  padding: 10px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
}
.thread-item.active {
  border-color: var(--primary);
  background: #f0fdfa;
}
.thread-item-top {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
}
.thread-item-school {
  font-size: 11px;
  color: var(--primary);
  margin-top: 2px;
}
.thread-item-preview {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.dm-main-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.dm-partner-name { font-weight: 700; font-size: 15px; }
.dm-partner-meta { font-size: 12px; color: var(--muted); }
.dm-head-actions { display: flex; align-items: center; gap: 8px; }

.dm-privacy-notice {
  background: #f0fdfa;
  color: #115e59;
  font-size: 11.5px;
  padding: 6px 14px;
  border-bottom: 1px solid #ccfbf1;
}

.dm-messages-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafc;
}

.msg-bubble {
  max-width: 78%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.4;
}
.msg-bubble.mine {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-bubble.theirs {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.msg-meta {
  font-size: 10.5px;
  opacity: 0.75;
  margin-top: 4px;
}

.dm-quick-chips {
  padding: 8px 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  border-top: 1px solid var(--border);
  background: #fff;
}
.chip-btn {
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  cursor: pointer;
}
.chip-btn:hover { border-color: var(--primary); color: var(--primary); }

.pii-warning {
  background: #fffbeb;
  color: #92400e;
  border-top: 1px solid #fde68a;
  font-size: 11.5px;
  padding: 6px 12px;
}

.dm-compose {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: #fff;
}

.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 28px 16px;
}

.hidden { display: none !important; }
.mobile-only { display: none; }

/* Responsive & Android Mode */
@media (max-width: 900px) {
  .main-grid { grid-template-columns: 1fr; }
  .mobile-tabs { display: flex; }
  .list-pane, .map-pane { display: none; height: 100%; }
  .list-pane.active-mobile-pane, .map-pane.active-mobile-pane { display: flex; }
  .form-grid { grid-template-columns: 1fr; }
  .dm-modal { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 24px); }
  .dm-sidebar.mobile-hidden { display: none; }
  .mobile-only { display: inline-block; }
  .modal-backdrop { padding: 12px; }
  .modal-header { padding: 12px 14px; }
  .modal-scroll-body, .modal-body { padding: 12px 14px; }
  .modal-footer-sticky { padding: 10px 14px; }
}

body.android-modal-scope .modal-backdrop { padding: 12px; }
body.android-modal-scope .modal-card,
body.android-modal-scope .modal-card.modal-sm,
body.android-modal-scope .dm-modal {
  width: min(380px, calc(100vw - 24px));
  max-height: calc(100dvh - 48px);
}
body.android-modal-scope .form-grid { grid-template-columns: 1fr; }
body.android-modal-scope .dm-modal { grid-template-columns: minmax(0, 1fr); }
body.android-modal-scope .dm-sidebar.mobile-hidden { display: none; }
body.android-modal-scope .mobile-only { display: inline-block; }

.device-wrapper.android-mode .main-grid { grid-template-columns: 1fr; }
.device-wrapper.android-mode .mobile-tabs { display: flex; }
.device-wrapper.android-mode .list-pane,
.device-wrapper.android-mode .map-pane { display: none; height: 100%; }
.device-wrapper.android-mode .list-pane.active-mobile-pane,
.device-wrapper.android-mode .map-pane.active-mobile-pane { display: flex; }
.device-wrapper.android-mode .privacy-pill { display: none; }
.device-wrapper.android-mode .topbar { padding: 8px 12px; }
.device-wrapper.android-mode .brand-sub { display: none; }
.device-wrapper.android-mode .pin-card {
  bottom: 8px;
  left: 8px;
  right: 8px;
  width: auto;
  max-width: none;
  padding: 10px 12px;
  max-height: calc(100% - 16px);
  overflow-y: auto;
}
.device-wrapper.android-mode .pin-card-nick { font-size: 13px; }
.device-wrapper.android-mode .pin-card-area { font-size: 11px; }
.device-wrapper.android-mode .pin-card-meta { gap: 4px; margin: 5px 0; }
.device-wrapper.android-mode .pin-card-meta .role-tag,
.device-wrapper.android-mode .pin-card-meta .time-tag { font-size: 10.5px; padding: 2px 6px; }
.device-wrapper.android-mode .pin-card-note { font-size: 11px; margin: 2px 0 6px; }
.device-wrapper.android-mode .pin-card-privacy { font-size: 10px; padding: 4px 6px; margin-bottom: 6px; }
.device-wrapper.android-mode #btn-pc-dm { padding: 7px 10px; font-size: 12px; }
