:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2235;
  --bg-card-hover: #1f2a40;
  --bg-input: #0f1520;
  --border: #2a3650;
  --border-focus: #22d3ee;
  --accent: #22d3ee;
  --accent-dim: rgba(34,211,238,0.15);
  --green: #34d399;
  --green-dim: rgba(52,211,153,0.15);
  --amber: #fbbf24;
  --amber-dim: rgba(251,191,36,0.15);
  --red: #f87171;
  --red-dim: rgba(248,113,113,0.15);
  --text: #e8edf5;
  --text-secondary: #a3b3cc;
  --text-muted: #7a8fad;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius: 10px;
  --radius-sm: 6px;
  --accent-hover: #06b6d4;
  --green-hover: #10b981;
  --red-hover: #ef4444;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --focus-ring: 0 0 0 3px var(--accent-dim);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg-primary); color: var(--text); min-height: 100vh; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
.hidden { display: none !important; }

/* Buttons - larger tap targets on mobile */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; transition: all 0.2s; font-family: var(--font);
  min-height: 44px; /* iOS minimum tap target */
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn-primary { background: var(--accent); color: var(--bg-primary); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: transparent; color: var(--accent); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--accent); background: var(--accent-dim); }
.btn-success { background: var(--green); color: var(--bg-primary); }
.btn-success:hover { background: var(--green-hover); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-hover); }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: var(--radius); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Inputs - prevent iOS zoom on focus (16px min) */
input, select, textarea {
  background: var(--bg-input); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; font-size: 16px;
  font-family: var(--font); width: 100%; transition: border-color 0.2s;
  -webkit-appearance: none; appearance: none;
  min-height: 44px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-dim);
}
select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238899b4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
textarea { resize: vertical; min-height: 80px; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Cards */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card-header { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

/* Stat Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; border-left: 4px solid var(--accent); }
.stat-card.green { border-left-color: var(--green); }
.stat-card.amber { border-left-color: var(--amber); }
.stat-card.red { border-left-color: var(--red); }
.stat-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-size: 28px; font-weight: 800; margin-top: 4px; }
.stat-card.green .stat-value { color: var(--green); }
.stat-card.amber .stat-value { color: var(--amber); }
.stat-card.red .stat-value { color: var(--red); }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-pending { background: var(--amber-dim); color: var(--amber); }
.badge-reviewed { background: var(--accent-dim); color: var(--accent); }
.badge-quoted { background: var(--accent-dim); color: var(--accent); }
.badge-accepted { background: var(--green-dim); color: var(--green); }
.badge-declined { background: var(--red-dim); color: var(--red); }

/* Table */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 12px 16px; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); }
tr:hover td { background: var(--bg-card-hover); }
tr.clickable { cursor: pointer; }
tr.clickable:focus-visible td { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Nav */
.nav { background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: 0 16px; position: sticky; top: 0; z-index: 1000; }
.nav-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; height: 56px; }
.nav-brand { font-size: 18px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.nav-brand span { color: var(--green); }
.nav-brand svg { width: 22px; height: 22px; }
.nav-links { display: flex; gap: 4px; }
.nav-link { padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary); cursor: pointer; transition: all 0.2s; border: none; background: none; font-family: var(--font); -webkit-tap-highlight-color: transparent; min-height: 44px; display: inline-flex; align-items: center; }
.nav-link:hover { color: var(--text); background: var(--bg-card); }
.nav-link:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--radius-sm); }
.nav-link.active { color: var(--accent); background: var(--accent-dim); }

/* Mobile hamburger menu */
.nav-hamburger { display: none; background: none; border: none; color: var(--text); padding: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; min-height: 44px; min-width: 44px; align-items: center; justify-content: center; }

/* Hero / Landing */
.hero {
  min-height: calc(100vh - 56px); display: flex; align-items: center;
  position: relative; overflow: hidden;
  background: url('images/hero-mulcher.jpg') 60% center / cover no-repeat;
  background-attachment: fixed;
}
.hero-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(105deg, rgba(10,14,23,0.93) 0%, rgba(10,14,23,0.8) 30%, rgba(10,14,23,0.4) 60%, rgba(10,14,23,0.15) 100%);
}
.hero-content { position: relative; text-align: left; max-width: 600px; padding: 80px 20px 60px 60px; z-index: 1; animation: heroFadeIn 1s ease-out; }
@keyframes heroFadeIn { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
.hero-badge {
  display: inline-block; background: var(--green-dim); border: 1px solid var(--green);
  color: var(--green); font-size: 12px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase;
  padding: 6px 16px; border-radius: 20px; margin-bottom: 20px;
}
.hero h1 { font-size: 56px; font-weight: 900; line-height: 1.05; margin-bottom: 16px; letter-spacing: -1px; }
.hero h1 span { color: var(--green); }
.hero-tagline { font-size: 18px; color: var(--text-secondary); margin-bottom: 36px; line-height: 1.7; max-width: 560px; }
.hero-address { max-width: 480px; background: rgba(10,14,23,0.75); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(52,211,153,0.2); border-radius: var(--radius); padding: 24px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.hero-address-label { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.hero-address input { padding: 16px 20px; font-size: 16px; border-radius: var(--radius); background: rgba(15,21,32,0.9); border: 2px solid var(--border); text-align: left; }
.hero-address input:focus { border-color: var(--green); box-shadow: 0 0 0 4px var(--green-dim); }

/* Landing Page Sections */
.landing-section { padding: 80px 20px; }
.landing-inner { max-width: 1100px; margin: 0 auto; }
.section-title { font-size: 32px; font-weight: 900; text-align: center; margin-bottom: 12px; }
.section-title span { color: var(--green); }
.section-subtitle { text-align: center; color: var(--text-secondary); font-size: 16px; max-width: 550px; margin: 0 auto 48px; line-height: 1.6; }

/* How It Works Steps */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.step-card {
  text-align: center; padding: 32px 24px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); position: relative; transition: transform 0.2s, box-shadow 0.2s;
}
.step-card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
.step-num {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: var(--bg-primary);
  font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}
.step-icon { margin-bottom: 16px; }
.step-card h3 { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.step-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* Services Grid */
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.service-card {
  padding: 24px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); display: flex; align-items: flex-start; gap: 16px;
  transition: border-color 0.2s;
}
.service-card:hover { border-color: var(--green); }
.service-icon {
  width: 48px; height: 48px; min-width: 48px; border-radius: 12px; background: var(--bg-secondary);
  display: flex; align-items: center; justify-content: center;
}
.service-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.service-card p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* About Section */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.about-image { border-radius: var(--radius); overflow: hidden; border: 2px solid rgba(52,211,153,0.15); aspect-ratio: 4/3; box-shadow: 0 20px 60px rgba(0,0,0,0.4); transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease; }
.about-image:hover { transform: translateY(-6px) scale(1.01); box-shadow: 0 28px 70px rgba(0,0,0,0.5), 0 0 0 2px rgba(52,211,153,0.3); border-color: rgba(52,211,153,0.4); }
.about-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-image-fallback { background: linear-gradient(135deg, #1a3a2a, #0f2018); display: flex; align-items: center; justify-content: center; }
.about-image-fallback::after { content: 'LLB Land Services'; font-size: 24px; font-weight: 800; color: var(--green); opacity: 0.4; }
.about-text p { color: var(--text-secondary); font-size: 15px; line-height: 1.7; margin-bottom: 16px; }
.about-stats { display: flex; gap: 24px; margin-top: 20px; }
.about-stat { text-align: center; }
.about-stat-value { font-size: 28px; font-weight: 900; color: var(--green); }
.about-stat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

/* Equipment Trust Strip */
.equip-strip { background: var(--bg-secondary); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 18px 20px; }
.equip-strip-inner { display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap; max-width: 1000px; margin: 0 auto; }
.equip-item { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.equip-item svg { flex-shrink: 0; }
.equip-item strong { color: var(--green); }

/* Vegetation Grid */
.veg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.veg-card {
  padding: 20px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); text-align: center; transition: border-color 0.2s;
}
.veg-card:hover { border-color: var(--green); }
.veg-icon { font-size: 28px; margin-bottom: 8px; }
.veg-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.veg-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }

/* Service Area Banner */
.service-area-banner { background: linear-gradient(135deg, #0a1a12 0%, var(--bg-primary) 100%); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

/* Footer */
.landing-footer { padding: 24px 20px; background: var(--bg-secondary); border-top: 1px solid var(--border); }

/* Map Page */
.map-page { display: flex; height: calc(100vh - 56px); }
.map-sidebar { width: 320px; min-width: 320px; background: var(--bg-secondary); border-right: 1px solid var(--border); padding: 24px; overflow-y: auto; display: flex; flex-direction: column; -webkit-overflow-scrolling: touch; }
.map-container { flex: 1; position: relative; }
#map, #locate-map { width: 100%; height: 100%; }
.acreage-display { background: var(--bg-card); border: 2px solid var(--green); border-radius: var(--radius); padding: 16px; text-align: center; margin: 16px 0; }
.acreage-value { font-size: 36px; font-weight: 900; color: var(--green); }
.acreage-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.zone-list { flex: 1; overflow-y: auto; margin: 12px 0; -webkit-overflow-scrolling: touch; }
.zone-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: var(--bg-card); border-radius: var(--radius-sm); margin-bottom: 8px; font-size: 13px; }
.zone-item .zone-acres { color: var(--green); font-weight: 700; }

/* Questionnaire */
.questionnaire { max-width: 700px; margin: 0 auto; padding: 40px 20px; padding-bottom: calc(40px + var(--safe-bottom)); }
.q-section { margin-bottom: 32px; }
.q-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.q-section h3::before { content: ''; width: 4px; height: 20px; background: var(--accent); border-radius: 2px; display: inline-block; flex-shrink: 0; }
.radio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio-option { display: flex; align-items: flex-start; gap: 10px; padding: 12px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; -webkit-tap-highlight-color: transparent; min-height: 44px; }
.radio-option:hover { border-color: var(--accent); }
.radio-option:active { transform: scale(0.98); }
.radio-option.selected { border-color: var(--green); background: var(--green-dim); }
.radio-option input[type="radio"], .radio-option input[type="checkbox"] { margin-top: 2px; accent-color: var(--green); min-width: 18px; min-height: 18px; }
.radio-option label { cursor: pointer; font-size: 14px; }
.radio-option .option-desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Selection option cards (checkmark + bright highlight) */
.sel-option {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--bg-card); border: 2px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.15s ease; -webkit-tap-highlight-color: transparent;
  min-height: 44px; user-select: none;
}
.sel-option:hover, .sel-option:focus-within { border-color: var(--accent); background: var(--accent-dim); }
.sel-option:active { transform: scale(0.98); }
.sel-option.sel-active {
  border-color: var(--green); background: var(--green-dim);
  box-shadow: 0 0 0 1px var(--green), 0 0 12px rgba(52,211,153,0.15);
}
.sel-check {
  width: 24px; height: 24px; min-width: 24px; border-radius: 6px;
  border: 2px solid var(--border); display: flex; align-items: center; justify-content: center;
  transition: all 0.15s ease; background: var(--bg-input);
}
.sel-active .sel-check {
  background: var(--green); border-color: var(--green); color: #fff;
}
.sel-active .sel-check svg { stroke: #fff; }
.sel-label { font-size: 14px; font-weight: 600; }

/* Submit options grid responsive */
.submit-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .submit-options { grid-template-columns: 1fr; } }

/* Confirmation */
.confirm-page { max-width: 600px; margin: 0 auto; padding: 60px 20px; text-align: center; }
.confirm-check { width: 80px; height: 80px; border-radius: 50%; background: var(--green-dim); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 24px; }
.confirm-check svg { width: 40px; height: 40px; stroke: var(--green); }

/* Login */
.login-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 56px); }
.login-box { width: 100%; max-width: 400px; padding: 20px; }

/* Admin */
.admin-page { padding: 24px 20px; max-width: 1200px; margin: 0 auto; padding-bottom: calc(24px + var(--safe-bottom)); }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.admin-header h2 { font-size: 24px; font-weight: 800; }
.filter-bar { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-bar select, .filter-bar input { max-width: 200px; }

/* Detail */
.detail-page { padding: 24px 20px; max-width: 1200px; margin: 0 auto; padding-bottom: calc(24px + var(--safe-bottom)); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.detail-map { height: 400px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.info-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); gap: 8px; }
.info-label { color: var(--text-muted); font-size: 13px; flex-shrink: 0; }
.info-value { font-weight: 600; font-size: 14px; text-align: right; word-break: break-word; }
.cost-breakdown { background: var(--bg-secondary); border-radius: var(--radius); padding: 20px; }
.cost-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.cost-total { font-size: 20px; font-weight: 800; color: var(--green); border-top: 2px solid var(--border); padding-top: 12px; margin-top: 8px; }
.ai-result { background: var(--bg-secondary); border: 1px solid var(--accent); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
.ai-result h4 { color: var(--accent); margin-bottom: 12px; }

/* Settings */
.settings-page { max-width: 700px; margin: 0 auto; padding: 40px 20px; padding-bottom: calc(40px + var(--safe-bottom)); }
.settings-section { margin-bottom: 32px; }
.settings-section h3 { font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--accent); }

/* Toast */
.toast-container { position: fixed; top: 60px; left: 16px; right: 16px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { padding: 12px 20px; border-radius: var(--radius-sm); font-size: 14px; animation: slideIn 0.3s ease; box-shadow: var(--shadow); pointer-events: auto; }
.toast-success { background: var(--green-dim); color: var(--green); border: 1px solid var(--green); }
.toast-error { background: var(--red-dim); color: var(--red); border: 1px solid var(--red); }
.toast-info { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--accent); }
@keyframes slideIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Spinner */
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10,14,23,0.8); display: flex; align-items: center; justify-content: center; z-index: 9998; flex-direction: column; gap: 16px; }
.loading-overlay .spinner { width: 40px; height: 40px; border-width: 3px; }

/* Map Tutorial Overlay */
.map-tutorial-backdrop {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.7); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.map-tutorial-card {
  background: var(--bg-card); border: 2px solid var(--green); border-radius: var(--radius);
  padding: 24px; max-width: 420px; width: 90%; box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  animation: slideUp 0.4s ease;
}
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.map-tutorial-steps { display: flex; flex-direction: column; gap: 16px; }
.map-tutorial-step { display: flex; align-items: flex-start; gap: 12px; }
.map-tutorial-icon { flex-shrink: 0; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--bg-secondary); border-radius: 10px; }
.map-tutorial-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.map-tutorial-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.map-tutorial-arrow {
  position: fixed; top: 70px; right: 16px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  animation: bounce 1.5s ease infinite;
}
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@media (max-width: 600px) {
  .map-tutorial-card { padding: 18px; max-width: 340px; }
  .map-tutorial-title { font-size: 14px; }
  .map-tutorial-desc { font-size: 12px; }
  .map-tutorial-arrow { top: 60px; right: 8px; }
}

/* ---- Custom Draw Toolbar (OnX-style) ---- */
.custom-draw-toolbar {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 1000; display: flex; align-items: center; gap: 6px;
  background: rgba(17,24,39,0.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--border); border-radius: 14px;
  padding: 8px 12px; box-shadow: 0 4px 24px rgba(0,0,0,0.5);
}
.draw-tool-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: 2px solid transparent; border-radius: 10px;
  color: var(--text-secondary); cursor: pointer; padding: 8px 14px;
  font-family: var(--font); font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  transition: all 0.15s ease; -webkit-tap-highlight-color: transparent;
  min-width: 64px; min-height: 52px;
}
.draw-tool-btn:hover { color: var(--green); border-color: var(--green); background: rgba(52,211,153,0.1); }
.draw-tool-btn:active { transform: scale(0.95); }
.draw-tool-btn.active {
  color: #fff; background: var(--green); border-color: var(--green);
  box-shadow: 0 0 16px rgba(52,211,153,0.4);
}
.draw-tool-btn.active svg { stroke: #fff; }
.draw-tool-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.draw-tool-btn:disabled:hover { color: var(--text-secondary); border-color: transparent; background: none; }
.draw-tool-btn svg { stroke: currentColor; flex-shrink: 0; }
/* Finish button - big green, pulses when visible */
.draw-tool-finish {
  color: #fff !important; background: var(--green) !important; border-color: var(--green) !important;
  animation: finishPulse 1.5s ease infinite;
}
.draw-tool-finish:hover { background: #10b981 !important; box-shadow: 0 0 20px rgba(52,211,153,0.5); }
.draw-tool-finish svg { stroke: #fff; }
@keyframes finishPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(52,211,153,0); }
}
/* Cancel button */
.draw-tool-cancel { color: var(--text-muted); }
.draw-tool-cancel:hover { color: var(--text); border-color: var(--border); background: rgba(255,255,255,0.05); }
/* Danger/clear */
.draw-tool-danger { color: var(--red); }
.draw-tool-danger:hover { color: var(--red); border-color: var(--red); background: rgba(248,113,113,0.1); }
.draw-tool-divider { width: 1px; height: 36px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

/* Floating Acreage Display on Map */
.map-acreage-float {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 1000; opacity: 0; transition: opacity 0.3s, transform 0.3s;
  pointer-events: none; transform: translateX(-50%) translateY(-8px);
}
.map-acreage-float.visible { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.map-acreage-float-inner {
  display: flex; align-items: center; gap: 8px;
  background: rgba(17,24,39,0.95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 2px solid var(--green); border-radius: 12px;
  padding: 10px 20px; box-shadow: 0 4px 20px rgba(52,211,153,0.25);
  font-weight: 800; font-size: 16px; color: var(--green);
}
.map-float-zones { font-size: 12px; color: var(--text-muted); font-weight: 600; }

/* Leaflet Draw tooltip styling (shown while drawing) */
.leaflet-draw-tooltip {
  background: #111827 !important; color: #e8edf5 !important;
  border: 1px solid #34d399 !important; border-radius: 8px !important;
  padding: 8px 12px !important; font-size: 13px !important; font-weight: 600 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}
.leaflet-draw-tooltip-subtext { color: #8899b4 !important; font-size: 11px !important; }
.leaflet-draw-tooltip:before { border-right-color: #34d399 !important; }

/* Tutorial arrow now points down to toolbar */
.map-tutorial-arrow-bottom {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  animation: bounceDown 1.5s ease infinite; z-index: 2001;
}
@keyframes bounceDown { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* Mobile responsive toolbar */
@media (max-width: 768px) {
  .custom-draw-toolbar { bottom: 10px; padding: 6px 8px; gap: 4px; }
  .draw-tool-btn { padding: 6px 10px; min-width: 54px; min-height: 46px; font-size: 9px; }
  .draw-tool-btn svg { width: 18px; height: 18px; }
  .map-acreage-float-inner { padding: 8px 14px; font-size: 14px; }
}
@media (max-width: 380px) {
  .draw-tool-btn span { display: none; }
  .draw-tool-btn { min-width: 44px; padding: 8px; }
  .custom-draw-toolbar { gap: 2px; padding: 6px; }
}

/* Map performance */
.leaflet-tile { image-rendering: -webkit-optimize-contrast; }
.leaflet-container { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.leaflet-tile-pane { will-change: transform; }
.leaflet-map-pane { will-change: transform; }
#map, #locate-map { -webkit-transform: translate3d(0,0,0); transform: translate3d(0,0,0); }

/* Acreage label on polygons */
.acreage-tooltip { background: rgba(26,34,53,0.9) !important; color: #34d399 !important; border: 1px solid #34d399 !important; font-weight: 700; font-size: 14px; padding: 4px 10px !important; border-radius: 6px; pointer-events: none; }

/* ======== MOBILE RESPONSIVE ======== */

/* Tablet */
@media (max-width: 768px) {
  /* Landing sections */
  .landing-section { padding: 60px 16px; }
  .steps-grid { grid-template-columns: 1fr; gap: 20px; max-width: 400px; margin: 0 auto; }
  .services-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-text { text-align: center; }
  .about-text .section-title { text-align: center !important; }
  .about-stats { justify-content: center; }
  .hero { background-attachment: scroll; }
  .hero-content { text-align: center; padding: 60px 20px 40px; }
  .hero-overlay { background: linear-gradient(180deg, rgba(10,14,23,0.7) 0%, rgba(10,14,23,0.85) 50%, rgba(10,14,23,0.95) 100%); }
  .hero-tagline { margin-left: auto; margin-right: auto; }
  .hero-address { margin: 0 auto; }
  .equip-strip-inner { gap: 20px; }
  .veg-grid { grid-template-columns: repeat(2, 1fr); }

  /* Map page: sidebar on top, map fills remaining */
  .map-page { flex-direction: column; }
  .map-sidebar {
    width: 100%; min-width: unset; max-height: none;
    padding: 16px; border-right: none; border-bottom: 1px solid var(--border);
    flex-direction: row; flex-wrap: wrap; gap: 12px; align-items: center;
    overflow-y: visible;
  }
  .map-sidebar h3 { font-size: 14px; margin-bottom: 0; }
  .map-sidebar p { display: none; }
  .map-sidebar .card { display: none; }
  .map-sidebar > div[style*="position:relative"] { width: 100%; }
  .map-container { flex: 1; min-height: 50vh; }
  .acreage-display { margin: 0; padding: 10px 16px; }
  .acreage-value { font-size: 24px; }
  .zone-list { display: none; }
  .map-sidebar .btn-success { width: auto; margin-top: 0; }

  /* Detail grid single column */
  .detail-grid { grid-template-columns: 1fr; }
  .detail-map { height: 250px; }

  /* Nav - show hamburger */
  .nav-hamburger { display: inline-flex; }
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 56px; right: 0; left: 0;
    background: var(--bg-secondary); border-bottom: 1px solid var(--border);
    padding: 8px 16px; gap: 4px; z-index: 999;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  }
  .nav-links.open .nav-link { width: 100%; text-align: left; padding: 12px 16px; }
  .nav-inner { position: relative; }

  /* Stats grid 2 col */
  .stats-grid { grid-template-columns: 1fr 1fr; }

  /* Admin header stack */
  .admin-header { flex-direction: column; align-items: flex-start; }
  .admin-header h2 { font-size: 20px; }
}

/* Phone */
@media (max-width: 600px) {
  .hero { min-height: calc(100vh - 56px); padding: 0; }
  .hero-content { padding: 32px 16px 24px; }
  .hero-badge { font-size: 10px; padding: 5px 12px; margin-bottom: 16px; }
  .hero h1 { font-size: 36px; margin-bottom: 10px; }
  .hero-tagline { font-size: 15px; margin-bottom: 24px; line-height: 1.5; }
  .hero-address { padding: 16px; margin: 0 auto; }
  .equip-item { font-size: 12px; gap: 6px; }
  .equip-strip { padding: 12px 16px; }
  .equip-strip-inner { gap: 14px; }
  .hero-address input { padding: 14px 16px; font-size: 15px; }

  /* Landing sections phone */
  .landing-section { padding: 48px 16px; }
  .section-title { font-size: 24px; }
  .section-subtitle { font-size: 14px; margin-bottom: 32px; }
  .veg-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .veg-card { padding: 14px; }
  .veg-icon { font-size: 22px; margin-bottom: 4px; }
  .veg-card h4 { font-size: 13px; }
  .veg-card p { font-size: 11px; }
  .about-stats { gap: 16px; }
  .about-stat-value { font-size: 22px; }
  .about-image { aspect-ratio: 16/9; }

  .form-row { grid-template-columns: 1fr; gap: 12px; }
  .radio-grid { grid-template-columns: 1fr; gap: 6px; }
  .radio-option { padding: 10px 12px; }

  /* Questionnaire tighter */
  .questionnaire { padding: 24px 16px; padding-bottom: calc(24px + var(--safe-bottom)); }
  .q-section { margin-bottom: 24px; }
  .q-section h3 { font-size: 15px; }

  /* Cards tighter padding */
  .card { padding: 16px; }

  /* Stats single column */
  .stats-grid { grid-template-columns: 1fr; gap: 8px; }
  .stat-card { padding: 14px; }
  .stat-value { font-size: 24px; }

  /* Table mobile-friendly */
  th, td { padding: 10px 12px; font-size: 13px; }

  /* Detail page */
  .detail-map { height: 200px; }
  .info-row { flex-direction: column; gap: 2px; }
  .info-value { text-align: left; }

  /* Cost breakdown */
  .cost-breakdown { padding: 14px; }
  .cost-row { font-size: 13px; }
  .cost-total { font-size: 18px; }

  /* Settings */
  .settings-page { padding: 24px 16px; }

  /* Confirmation */
  .confirm-page { padding: 40px 16px; }

  /* Login */
  .login-box { padding: 16px; }

  /* Toast full width */
  .toast { font-size: 13px; padding: 10px 16px; }

  /* Map sidebar even more compact on phone */
  .map-sidebar {
    padding: 10px 12px;
    flex-direction: column; gap: 8px;
  }
  .map-sidebar h3 { display: none; }
  .acreage-display { padding: 8px 12px; margin: 0; }
  .acreage-value { font-size: 20px; }
  .acreage-label { font-size: 10px; }
  .map-container { min-height: 60vh; }

  /* Filter bar stack */
  .filter-bar { flex-direction: column; }
  .filter-bar select, .filter-bar input { max-width: 100%; }
}

/* Very small phones */
@media (max-width: 380px) {
  .hero h1 { font-size: 28px; }
  .hero-tagline { font-size: 14px; }
  .nav-brand { font-size: 16px; }
  .nav-brand svg { width: 18px; height: 18px; }
  .btn-lg { padding: 12px 20px; font-size: 15px; }
  .veg-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .about-stats { flex-wrap: wrap; }
}

/* Quote summary card */
.quote-summary-card { position: relative; }
.quote-summary-card .form-group label { font-size: 13px; }

/* Edit mode checkbox grid */
.edit-check-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.edit-check-grid label {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; padding: 5px 10px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color 0.2s;
}
.edit-check-grid label:has(input:checked) { border-color: var(--green); background: var(--green-dim); }
.edit-check-grid input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--green); }

/* Add-on rows */
.addon-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border); gap: 8px;
}
.addon-row:last-child { border-bottom: none; }
.addon-badge {
  display: inline-block; font-size: 10px; padding: 2px 8px;
  border-radius: 10px; font-weight: 600; margin-top: 2px;
}
.addon-badge-hourly { background: rgba(251,191,36,0.15); color: var(--amber); }
.addon-badge-fixed { background: rgba(52,211,153,0.15); color: var(--green); }

/* Custom vertex handles (during drawing) */
.custom-vertex-handle {
  width: 18px !important;
  height: 18px !important;
  background: #fff !important;
  border: 2.5px solid #34d399 !important;
  border-radius: 4px !important;
  box-shadow: 0 0 10px rgba(0,0,0,0.7), 0 0 4px rgba(52,211,153,0.9) !important;
  cursor: grab !important;
  transition: transform 0.1s;
}
.custom-vertex-handle:active { cursor: grabbing !important; transform: scale(1.2); }

/* Edit handles - bigger + visible on satellite imagery */
.leaflet-editing-icon {
  width: 16px !important;
  height: 16px !important;
  margin-left: -8px !important;
  margin-top: -8px !important;
  background: #fff !important;
  border: 2px solid #34d399 !important;
  border-radius: 3px !important;
  box-shadow: 0 0 8px rgba(0,0,0,0.6), 0 0 3px rgba(52,211,153,0.8) !important;
  cursor: grab !important;
}
.leaflet-editing-icon:active { cursor: grabbing !important; }
/* Midpoint handles (drag to add vertex) - slightly smaller, translucent */
.leaflet-marker-icon.leaflet-editing-icon[style*="opacity: 0.6"] {
  width: 12px !important;
  height: 12px !important;
  margin-left: -6px !important;
  margin-top: -6px !important;
  border-radius: 50% !important;
  border-color: #60a5fa !important;
}

/* Trial Day Popup */
.trial-popup-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; transition: opacity 0.3s ease;
}
.trial-popup-overlay.trial-popup-visible { opacity: 1; }
.trial-popup {
  background: var(--bg-card); border-radius: var(--radius);
  max-width: 440px; width: 100%; padding: 32px 28px;
  text-align: center; position: relative;
  border: 2px solid var(--green);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 30px rgba(52,211,153,0.15);
  transform: translateY(20px); transition: transform 0.3s ease;
}
.trial-popup-visible .trial-popup { transform: translateY(0); }
.trial-popup-badge {
  display: inline-block; background: var(--green); color: #000;
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 1.5px; padding: 5px 16px; border-radius: 20px; margin-bottom: 16px;
}
.trial-popup-title {
  font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 8px; line-height: 1.2;
}
.trial-popup-subtitle {
  font-size: 15px; color: var(--text-secondary); margin-bottom: 20px; line-height: 1.4;
}
.trial-popup-card {
  background: var(--bg-secondary); border-radius: var(--radius-sm);
  padding: 20px; margin-bottom: 20px; border: 1px solid var(--border);
}
.trial-popup-rate {
  font-size: 48px; font-weight: 900; color: var(--green); line-height: 1;
}
.trial-popup-rate span { font-size: 20px; font-weight: 600; color: var(--text-muted); }
.trial-popup-hours {
  font-size: 14px; color: var(--text-secondary); margin-top: 6px; font-weight: 600;
}
.trial-popup-benefits {
  text-align: left; list-style: none; padding: 0; margin: 0 0 20px;
}
.trial-popup-benefits li {
  font-size: 13px; color: var(--text-secondary); padding: 6px 0 6px 24px;
  position: relative; line-height: 1.4;
}
.trial-popup-benefits li::before {
  content: '\2713'; position: absolute; left: 0; color: var(--green); font-weight: 700;
}
.trial-popup-note {
  font-size: 12px; color: var(--text-muted); margin-bottom: 20px;
  background: var(--bg-secondary); padding: 10px 14px; border-radius: var(--radius-sm);
  line-height: 1.4;
}
.trial-popup-actions { display: flex; flex-direction: column; gap: 10px; }
.trial-popup-btn { width: 100%; font-size: 16px !important; padding: 14px !important; }
.trial-popup-btn-skip {
  background: transparent; border: none; color: var(--text-muted);
  font-size: 13px; cursor: pointer; padding: 8px;
}
.trial-popup-btn-skip:hover { color: var(--text-secondary); }

/* Landscape phone - maximize map */
@media (max-height: 500px) and (orientation: landscape) {
  .map-page { flex-direction: row; }
  .map-sidebar { width: 200px; min-width: 200px; max-height: none; flex-direction: column; border-right: 1px solid var(--border); border-bottom: none; overflow-y: auto; }
  .map-sidebar p, .map-sidebar .card, .zone-list { display: none; }
  .map-container { min-height: unset; height: calc(100vh - 56px); }
}
