* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --primary-light: #ecfdf5;
  --accent: #f59e0b;
  --pink: #ec4899;
  --danger: #ef4444;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --border: #e2e8f0;
  --bg: #f1f5f9;
  --white: #ffffff;
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);

  /* Phone dimensions */
  --device-w: 390px;
  --device-h: 844px;
  --device-radius: 56px;
  --screen-radius: 44px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Helvetica Neue', sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* === Stage (the background outside the phone) === */
.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(1200px 800px at 20% 10%, #1f7a4b 0%, transparent 60%),
              radial-gradient(1000px 700px at 90% 90%, #134e4a 0%, transparent 55%),
              linear-gradient(135deg, #0b1d2a 0%, #0d2b1d 100%);
  padding: 20px;
}

.stage-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255,255,255,0.05) 0 2px, transparent 3px),
    radial-gradient(circle at 80% 70%, rgba(255,255,255,0.04) 0 2px, transparent 3px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.03) 0 1px, transparent 2px);
  background-size: 120px 120px, 180px 180px, 90px 90px;
  pointer-events: none;
  opacity: 0.6;
}

/* === Device shell === */
.device-shell {
  position: relative;
  width: var(--device-w);
  height: var(--device-h);
  max-height: calc(100vh - 100px);
  background: linear-gradient(145deg, #1a1a1a 0%, #0a0a0a 100%);
  border-radius: var(--device-radius);
  padding: 12px;
  box-shadow:
    0 0 0 2px #2a2a2a,
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 10px 30px rgba(0, 0, 0, 0.5),
    inset 0 0 0 6px #000;
  flex-shrink: 0;
}

.device-side-btn {
  position: absolute;
  background: #1a1a1a;
  border-radius: 2px;
}
.device-side-btn.left { left: -3px; width: 4px; }
.device-side-btn.left.top { top: 110px; height: 32px; }
.device-side-btn.left.mid { top: 170px; height: 60px; }
.device-side-btn.right { right: -3px; width: 4px; top: 180px; height: 90px; }

.device-notch {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 32px;
  background: #000;
  border-radius: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}
.notch-camera {
  width: 10px; height: 10px;
  background: #0a0a16;
  border-radius: 50%;
  box-shadow: inset 0 0 2px #2a2a40;
}
.notch-speaker {
  width: 50px; height: 5px;
  background: #0a0a0a;
  border-radius: 3px;
}

.device-screen {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--white);
  border-radius: var(--screen-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* === Status bar === */
.status-bar {
  position: relative;
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 28px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  background: transparent;
  z-index: 50;
  flex-shrink: 0;
}
.status-time { flex: 1; text-align: left; }
.status-notch-space { width: 130px; }
.status-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 12px;
}
.status-icon { font-size: 12px; }
.status-battery {
  position: relative;
  width: 26px; height: 12px;
  border: 1.5px solid var(--text);
  border-radius: 3px;
  padding: 1px;
}
.status-battery::after {
  content: '';
  position: absolute;
  right: -3px; top: 3px;
  width: 2px; height: 4px;
  background: var(--text);
  border-radius: 0 1px 1px 0;
}
.battery-fill {
  display: block;
  width: 80%;
  height: 100%;
  background: var(--text);
  border-radius: 1px;
}

/* === App layout === */
.app {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--white);
  position: relative;
}

/* === Header === */
.app-header {
  padding: 4px 18px 12px;
  background: linear-gradient(180deg, #f0fdf4 0%, var(--white) 100%);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.greet-line {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}
.greet-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.icon-btn {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
.icon-btn:active { transform: scale(0.92); }
.badge-dot {
  position: absolute;
  top: 7px; right: 8px;
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid white;
}

.search-wrap {
  position: relative;
  margin-bottom: 12px;
}
.search-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}
.search-mic {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  background: var(--primary-light);
  border: none;
  width: 32px; height: 32px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
}
.search-box {
  width: 100%;
  padding: 12px 48px 12px 38px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  font-size: 14px;
  background: var(--white);
  color: var(--text);
}
.search-box:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -18px;
  padding: 2px 18px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.chip:active { transform: scale(0.95); }
.chip.active {
  background: var(--text);
  color: white;
  border-color: var(--text);
}

/* === Views === */
.views {
  flex: 1;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  background: var(--white);
}
.view.active { display: flex; }

/* Map view */
.view-map { padding: 0; }
.map-container {
  width: 100%;
  height: 100%;
  background: #d4e3d4;
}

.map-overlay-stats {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 8px;
  z-index: 400;
}
.stat-pill {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  padding: 8px 12px;
  border-radius: 14px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}
.stat-pill.green { background: rgba(22, 163, 74, 0.95); color: white; }
.stat-num { font-size: 17px; font-weight: 800; line-height: 1; }
.stat-label { font-size: 9px; font-weight: 600; opacity: 0.8; text-transform: uppercase; margin-top: 2px; }

.map-controls {
  position: absolute;
  bottom: 220px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 400;
}
.map-btn {
  background: white;
  border: none;
  width: 44px; height: 44px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 18px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
}
.map-btn:active { transform: scale(0.92); }

/* Peek sheet (above tab bar) */
.peek-sheet {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  background: white;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.08);
  padding: 10px 16px 14px;
  z-index: 350;
  max-height: 220px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.peek-handle {
  width: 44px; height: 5px;
  background: #cbd5e1;
  border-radius: 3px;
  margin: 0 auto 8px;
}
.peek-title {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 8px;
}
.peek-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 0 8px;
  scrollbar-width: none;
}
.peek-list::-webkit-scrollbar { display: none; }

.peek-card {
  flex-shrink: 0;
  width: 180px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
}
.peek-card-img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
}
.peek-card-body { padding: 8px 10px 10px; }
.peek-card-name { font-weight: 800; font-size: 13px; }
.peek-card-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

.fab {
  position: absolute;
  bottom: 240px;
  right: 12px;
  display: none; /* hidden — center tab acts as the add button */
}

/* List view + Favs */
.view-list, .view-favs { padding: 14px 0 110px; overflow-y: auto; }
.list-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 18px 12px;
}
.list-toolbar h3 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.sort-select {
  background: var(--bg);
  border: none;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.trees-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 18px;
}

.tree-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s;
  display: flex;
  flex-direction: column;
}
.tree-card:active { transform: scale(0.98); }

.tree-card-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: linear-gradient(135deg, #bbf7d0, #86efac);
  display: flex; align-items: center; justify-content: center;
  font-size: 64px;
  position: relative;
}

.ripe-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.ripe-badge.ripe { background: rgba(239, 68, 68, 0.95); color: white; }
.ripe-badge.ripening { background: rgba(245, 158, 11, 0.95); color: white; }
.ripe-badge.unripe { background: rgba(22, 163, 74, 0.95); color: white; }
.ripe-badge.past { background: rgba(120, 113, 108, 0.95); color: white; }

.fav-toggle {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(255,255,255,0.95);
  border: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.fav-toggle.active { background: var(--pink); color: white; }
.fav-toggle:active { transform: scale(0.85); }

.tree-card-body { padding: 12px 14px 14px; }
.tree-card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.tree-card-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.tree-card-variety {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 2px;
}
.tree-card-rating {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.tree-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}
.meta-dot { width: 3px; height: 3px; background: var(--text-tertiary); border-radius: 50%; }
.tree-card-distance { color: var(--primary); font-weight: 700; }

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-secondary);
  font-size: 14px;
}
.empty-state .empty-emoji { font-size: 56px; display: block; margin-bottom: 12px; }

/* Profile */
.view-profile { padding: 16px 18px 110px; overflow-y: auto; }
.profile-card {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 22px;
  border-radius: 20px;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
}
.avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: white;
  color: var(--primary);
  font-size: 32px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.profile-name { font-size: 18px; font-weight: 800; }
.profile-handle { font-size: 12px; opacity: 0.9; margin-top: 2px; }
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.2);
}
.profile-stats > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.profile-stats b { font-size: 18px; font-weight: 800; }
.profile-stats span { font-size: 10px; opacity: 0.85; }

.profile-actions {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.row-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border: none;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.row-btn:last-child { border-bottom: none; }
.row-btn:active { background: var(--bg); }
.row-btn span { flex: 1; }
.row-btn i { font-style: normal; color: var(--text-tertiary); font-size: 18px; }

.cf-badge {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 12px;
  background: var(--bg);
  border-radius: 12px;
}

/* === Tab bar === */
.tab-bar {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 6px 8px 4px;
  height: 70px;
  flex-shrink: 0;
  z-index: 500;
}
.tab {
  flex: 1;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  cursor: pointer;
  color: var(--text-tertiary);
  font-size: 10px;
  font-weight: 600;
  transition: color 0.15s;
}
.tab.active { color: var(--primary); }
.tab-icon { font-size: 22px; filter: grayscale(0.4); }
.tab.active .tab-icon { filter: grayscale(0); }
.tab-label { letter-spacing: 0.2px; }

.tab-center {
  flex: 0 0 64px;
  position: relative;
}
.tab-center-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  font-size: 28px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(22, 163, 74, 0.45);
  margin-top: -22px;
}
.tab-center:active .tab-center-icon { transform: scale(0.92); }

.home-indicator {
  width: 140px;
  height: 5px;
  background: var(--text);
  border-radius: 3px;
  margin: 4px auto 6px;
  opacity: 0.85;
  flex-shrink: 0;
}

/* === Sheets (bottom-sheet modals) === */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.sheet.active { display: flex; pointer-events: auto; }

.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.sheet-card {
  position: relative;
  background: white;
  width: 100%;
  max-width: 390px;
  max-height: 90vh;
  border-radius: 24px 24px 0 0;
  padding: 14px 22px 28px;
  overflow-y: auto;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-bottom: 0;
}

@media (min-height: 900px) {
  .sheet-card { margin-bottom: 60px; border-radius: 24px; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-grab {
  width: 44px; height: 5px;
  background: #cbd5e1;
  border-radius: 3px;
  margin: 0 auto 14px;
}

.sheet-close {
  position: absolute;
  top: 16px; right: 18px;
  background: var(--bg);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-card h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 16px;
}

.form-group { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
  letter-spacing: 0.2px;
}
.req { color: var(--danger); }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.ripeness-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.ripe-btn {
  background: var(--bg);
  border: 1.5px solid transparent;
  padding: 8px 4px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
}
.ripe-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.photo-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px;
  border: 2px dashed var(--border);
  border-radius: 14px;
  cursor: pointer;
  background: var(--bg);
}
.photo-upload-area input[type="file"] { display: none; }
.upload-hint { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.photo-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: 10px;
  object-fit: cover;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}

.btn {
  flex: 1;
  padding: 13px 18px;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}
.btn-primary:active { transform: scale(0.97); }
.btn-secondary {
  background: var(--bg);
  color: var(--text);
}
.btn-danger {
  background: #fef2f2;
  color: var(--danger);
}

/* Detail sheet */
.detail-sheet { padding: 0; max-height: 92vh; }
.detail-sheet .sheet-grab { margin-top: 10px; }
.detail-sheet .sheet-close { top: 22px; right: 18px; z-index: 5; background: rgba(255,255,255,0.9); }

.detail-hero {
  position: relative;
  height: 220px;
  background: linear-gradient(135deg, #34d399, #16a34a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 96px;
  color: white;
}
.detail-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.detail-hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.55) 100%);
}
.detail-hero-info {
  position: absolute;
  bottom: 14px;
  left: 20px;
  right: 20px;
  color: white;
  z-index: 2;
}
.detail-hero-info h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.detail-hero-info .v {
  font-size: 13px;
  opacity: 0.95;
  font-weight: 600;
}

.detail-body { padding: 18px 22px 28px; }

.detail-quick-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.qbtn {
  flex: 1;
  background: var(--primary-light);
  border: none;
  padding: 10px 6px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-dark);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.qbtn b { font-size: 18px; }
.qbtn:active { transform: scale(0.95); }

.detail-section { margin-bottom: 18px; }
.detail-section h4 {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.detail-section p {
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}

.coords {
  background: var(--bg);
  padding: 12px;
  border-radius: 12px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 12px;
  color: var(--text);
}

.review {
  background: var(--bg);
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 8px;
}
.review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.review-author { font-weight: 700; font-size: 13px; }
.review-stars { font-size: 12px; color: var(--accent); }
.review-text { font-size: 13px; line-height: 1.5; color: var(--text); }
.review-date { font-size: 11px; color: var(--text-tertiary); margin-top: 4px; }

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}
.detail-actions .btn-primary { grid-column: span 2; }

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translate(-50%, 80px);
  background: rgba(15, 23, 42, 0.95);
  color: white;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  z-index: 3000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}
.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* === Caption under phone === */
.device-caption {
  margin-top: 18px;
  text-align: center;
  color: white;
}
.caption-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.caption-sub {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 2px;
}

/* Leaflet tweaks */
.leaflet-control-attribution { font-size: 9px !important; }
.leaflet-popup-content-wrapper { border-radius: 12px; }
.leaflet-popup-content { margin: 10px; font-size: 13px; }
.leaflet-container { font-family: inherit; }

.marker-pin {
  font-size: 30px;
  text-align: center;
  transform: translateY(-4px);
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

/* === Responsive: shrink phone on small screens === */
@media (max-height: 900px) {
  :root {
    --device-w: 340px;
    --device-h: 720px;
  }
}
@media (max-height: 760px) {
  :root {
    --device-w: 300px;
    --device-h: 640px;
    --device-radius: 44px;
    --screen-radius: 34px;
  }
  .status-bar { height: 38px; font-size: 12px; }
  .device-notch { width: 96px; height: 26px; top: 14px; }
  .map-controls { bottom: 200px; }
  .peek-sheet { max-height: 190px; }
}
@media (max-width: 420px) {
  .stage { padding: 0; }
  :root {
    --device-w: 100vw;
    --device-h: 100vh;
    --device-radius: 0;
    --screen-radius: 0;
  }
  .device-shell {
    padding: 0;
    box-shadow: none;
    max-height: 100vh;
  }
  .device-notch, .device-side-btn { display: none; }
  .device-caption { display: none; }
}
