/* ============================================
   EarthSama — Design System
   Typeform-style one-question-at-a-time
   ============================================ */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- Header ---- */
.header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary);
}
.header-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.header-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.82rem;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  -webkit-tap-highlight-color: transparent;
  font-weight: 500;
}
.header-link:hover, .header-link:active {
  color: var(--primary);
  background: var(--success-bg);
}

/* ---- Status Banner ---- */
.status-banner {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--success-bg);
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 1rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.status-banner a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.status-banner a:hover { text-decoration: underline; }

/* ---- Progress ---- */
.tf-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1001;
  background: transparent;
}
.tf-progress-fill {
  height: 100%;
  background: var(--primary-light);
  width: 0%;
  transition: width 0.5s var(--ease);
}

/* ---- Typeform Main ---- */
.tf-main {
  flex: 1;
  position: relative;
  margin-top: 80px; /* header + status banner */
}

/* ---- Slides ---- */
.tf-slide {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.tf-slide.active {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  animation: tfFadeIn 0.35s var(--ease);
}

.tf-slide.tf-out-up {
  display: flex;
  animation: tfSlideOutUp 0.25s var(--ease) forwards;
}
.tf-slide.tf-out-down {
  display: flex;
  animation: tfSlideOutDown 0.25s var(--ease) forwards;
}
.tf-slide.tf-in-up {
  animation: tfSlideInUp 0.35s var(--ease);
}
.tf-slide.tf-in-down {
  animation: tfSlideInDown 0.35s var(--ease);
}

@keyframes tfFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes tfSlideOutUp {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-60px); }
}
@keyframes tfSlideOutDown {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(60px); }
}
@keyframes tfSlideInUp {
  from { opacity: 0; transform: translateY(60px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes tfSlideInDown {
  from { opacity: 0; transform: translateY(-60px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Shake on validation error */
@keyframes tfShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}
.tf-shake { animation: tfShake 0.4s ease; }

/* ---- Slide Content ---- */
.tf-content {
  width: 100%;
  max-width: 580px;
  padding: 3rem 1.5rem 5rem;
  margin: 0 auto;
}

.tf-content-center {
  text-align: center;
  padding-top: 2rem;
}

.tf-content-map,
.tf-content-review {
  max-width: 960px;
  padding: 1.5rem 1rem 3rem;
}

/* ---- Question Elements ---- */
.tf-num {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary-light);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.tf-arrow {
  font-size: 0.72rem;
}

.tf-question {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 1rem;
  color: var(--text);
}
.tf-question-sm {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.tf-req {
  color: var(--error);
  font-weight: 400;
}

.tf-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: -0.5rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}
.tf-desc-sm {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* ---- Typeform Input ---- */
.tf-input {
  width: 100%;
  padding: 0.85rem 0;
  border: none;
  border-bottom: 2px solid var(--border);
  font-family: inherit;
  font-size: 1.15rem;
  color: var(--text);
  background: transparent;
  transition: border-color 0.2s;
  outline: none;
  -webkit-appearance: none;
  border-radius: 0;
}
.tf-input:focus {
  border-bottom-color: var(--primary-light);
}
.tf-input::placeholder {
  color: #C4C7CC;
}
.tf-input.tf-error {
  border-bottom-color: var(--error);
}

.tf-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  background: var(--card);
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}
.tf-textarea:focus {
  border-color: var(--primary-light);
}

.tf-error-msg {
  display: block;
  color: var(--error);
  font-size: 0.82rem;
  margin-top: 0.4rem;
}

/* ---- Typeform Labels & Sub ---- */
.tf-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 0.3rem;
}
.tf-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.tf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.tf-field {
  display: flex;
  flex-direction: column;
}

/* ---- Typeform Footer ---- */
.tf-footer {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tf-ok {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 42px;
}
.tf-ok:hover { background: var(--primary-hover); }
.tf-ok:active { transform: scale(0.97); }

.tf-submit {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  justify-content: center;
}
.tf-submit:disabled {
  background: #9CA3AF;
  cursor: not-allowed;
  transform: none;
}

.tf-check {
  font-size: 0.75rem;
  opacity: 0.7;
}

.tf-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.tf-hint strong {
  background: #F3F4F6;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.72rem;
}

.tf-skip {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-height: 42px;
}
.tf-skip:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* ---- Typeform Card Choices ---- */
.tf-cards {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.25rem;
}
.tf-cards-inline {
  flex-direction: row;
}
.tf-cards-inline .tf-card {
  flex: 1;
  justify-content: center;
}

.tf-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  text-align: left;
}
.tf-card:hover {
  border-color: var(--primary-light);
  background: #FAFDF7;
}
.tf-card.selected {
  border-color: var(--primary);
  background: var(--success-bg);
  color: var(--primary);
}

.tf-card-key {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1.5px solid var(--border);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.15s;
}
.tf-card.selected .tf-card-key {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ---- Bottom Navigation Bar ---- */
.tf-bottombar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--card);
  border-top: 1px solid var(--border);
}

.tf-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: none;
  border: 1.5px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.tf-back:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: var(--success-bg);
}

.tf-counter {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.tf-powered {
  font-size: 0.68rem;
  color: #C4C7CC;
  font-weight: 500;
}

/* ---- Map Header ---- */
.tf-map-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.tut-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  background: var(--success-bg);
  color: var(--primary);
  border: 1px solid var(--primary-light);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.tut-trigger:hover {
  background: var(--primary);
  color: white;
}

/* ---- Map Tutorial Overlay ---- */
.tut-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: tfFadeIn 0.2s ease;
}

.tut-card {
  background: var(--card);
  border-radius: var(--radius);
  max-width: 380px;
  width: 100%;
  padding: 1.75rem 1.5rem 1.25rem;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.tut-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}
.tut-close:hover { color: var(--text); }

.tut-frame {
  display: none;
  text-align: center;
}
.tut-frame.active {
  display: block;
  animation: tfFadeIn 0.25s ease;
}

.tut-illustration {
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tut-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.tut-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 0.25rem;
}

.tut-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.tut-dots {
  display: flex;
  gap: 0.35rem;
}
.tut-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all 0.2s;
}
.tut-dot.active {
  background: var(--primary-light);
  transform: scale(1.2);
}

.tut-buttons {
  display: flex;
  gap: 0.5rem;
}

.tut-btn-next {
  padding: 0.5rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.tut-btn-next:hover { background: var(--primary-hover); }

.tut-btn-back {
  padding: 0.5rem 0.85rem;
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tut-btn-back:hover {
  border-color: var(--text-muted);
  color: var(--text);
}

/* ---- Autocomplete (reused from location search) ---- */
.autocomplete-wrap {
  position: relative;
}
.autocomplete-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 500;
  background: var(--card);
  border: 1.5px solid var(--border-focus);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}
.autocomplete-list.active { display: block; }
.autocomplete-list-lg { max-height: 320px; }

.autocomplete-item {
  padding: 0.6rem 0.75rem;
  cursor: pointer;
  font-size: 0.88rem;
  border-bottom: 1px solid #F3F4F6;
  transition: background 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover,
.autocomplete-item.highlighted {
  background: var(--success-bg);
  color: var(--primary);
}
.autocomplete-item mark {
  background: #FEF3C7;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}
.autocomplete-empty {
  padding: 0.75rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  text-align: center;
}
.autocomplete-item-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}

/* ---- Location Result Card ---- */
.location-result {
  background: var(--success-bg);
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin-top: 0.75rem;
  position: relative;
}
.location-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.location-result-item {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}
.location-result-label {
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.location-result-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}
.location-change-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  color: var(--primary-light);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
}
.location-change-btn:hover {
  background: rgba(76,175,80,0.12);
  color: var(--primary);
}

/* ---- Upload Zone ---- */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--primary-light);
  background: rgba(76,175,80,0.04);
}
.upload-zone.drag-over { border-style: solid; }
.upload-text { font-size: 0.85rem; color: var(--text-muted); }
.upload-link {
  background: none; border: none; color: var(--primary-light);
  font-weight: 600; font-size: 0.85rem; cursor: pointer;
  text-decoration: underline; font-family: inherit;
}

.upload-list { margin-top: 0.75rem; }
.upload-item {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.5rem 0; border-bottom: 1px solid var(--border);
  animation: tfFadeIn 0.2s var(--ease);
}
.upload-item:last-child { border-bottom: none; }
.upload-item-icon {
  width: 32px; height: 32px; border-radius: 4px;
  background: #F3F4F6; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; overflow: hidden;
}
.upload-item-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.upload-item-info { flex: 1; min-width: 0; }
.upload-item-name { font-size: 0.82rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upload-item-size { font-size: 0.7rem; color: var(--text-muted); }
.upload-item-remove {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; padding: 0.25rem;
  -webkit-tap-highlight-color: transparent;
  min-width: 28px; min-height: 28px;
  display: flex; align-items: center; justify-content: center;
}
.upload-item-remove:hover { color: var(--error); }

/* ---- Buttons (used in confirm, review) ---- */
.btn {
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  min-height: 46px;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.97); }
.btn-secondary { background: transparent; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.82rem; min-height: 38px; }

/* ======== Map ======== */
.map-container {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--border);
  margin-bottom: 0.65rem;
  position: relative;
}

.map-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 900;
  background: rgba(76,175,80,0.12);
  border: 3px dashed var(--primary-light);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--primary);
  font-size: 1rem;
  pointer-events: none;
  border-radius: var(--radius);
}
.map-drop-overlay.active { display: flex; }

.map-toolbar {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.45rem; background: #F9FAFB;
  border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.map-search-wrap { flex: 1; min-width: 0; position: relative; }
.search-icon {
  position: absolute; left: 0.6rem; top: 50%;
  transform: translateY(-50%); color: var(--text-muted); pointer-events: none;
}
.map-search-input {
  width: 100%;
  padding: 0.55rem 0.6rem 0.55rem 2rem !important;
  border: 1.5px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  font-family: inherit !important;
  font-size: 0.85rem !important;
  outline: none; min-height: 38px;
}
.map-search-input:focus {
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 3px rgba(76,175,80,0.12);
}
.map-tools { display: flex; gap: 0.25rem; flex-shrink: 0; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.4rem 0.55rem; background: white;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.72rem; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  transition: all 0.15s; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; min-height: 38px;
}
.tool-btn:hover, .tool-btn:active { border-color: var(--primary-light); color: var(--primary); }
.tool-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.map-layer-toggle {
  position: absolute; bottom: 3.5rem; right: 0.5rem; z-index: 800;
  display: flex; border-radius: 6px; overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.layer-btn {
  padding: 0.3rem 0.55rem; background: white; border: none;
  font-family: inherit; font-size: 0.68rem; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; border-right: 1px solid var(--border);
}
.layer-btn:last-child { border-right: none; }
.layer-btn.active { background: var(--primary); color: white; }

.map {
  width: 100%; height: 55vh; min-height: 280px; max-height: 560px;
  background: #E8E8E8; position: relative; z-index: 1;
}

.map-info {
  display: flex; gap: 0.85rem; padding: 0.55rem 0.7rem;
  background: #F9FAFB; border-top: 1px solid var(--border);
  flex-wrap: wrap; align-items: center;
}
.map-info-item { display: flex; flex-direction: column; gap: 0.05rem; }
.map-info-kml { margin-left: auto; }
.map-info-label { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); font-weight: 600; }
.map-info-value { font-size: 0.82rem; font-weight: 500; }

.kml-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.35rem 0.65rem; background: var(--primary); color: white;
  border: none; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; min-height: 34px;
}
.kml-btn:active { transform: scale(0.97); }
.kml-btn-sm { padding: 0.3rem 0.55rem; font-size: 0.72rem; min-height: 30px; }
.kml-btn-alt {
  background: transparent; color: var(--primary); border: 1px solid var(--primary-light);
  padding: 0.3rem 0.55rem; font-size: 0.72rem;
}
.kml-btn-alt:hover { background: var(--success-bg); }

.mobile-draw-hint {
  display: flex; align-items: center; gap: 0.45rem;
  padding: 0.55rem 0.65rem; background: var(--success-bg);
  border-radius: var(--radius-sm); color: var(--primary);
  font-size: 0.78rem; margin-bottom: 0.4rem;
}
.mobile-draw-hint svg { flex-shrink: 0; }

/* ---- KML Preview ---- */
.kml-preview {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.7rem; background: #F9FAFB;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.kml-preview-info { flex: 1; display: flex; flex-direction: column; gap: 0.05rem; }
.kml-preview-info strong { font-size: 0.85rem; }
.kml-preview-info span { font-size: 0.72rem; color: var(--text-muted); }

/* ---- Review ---- */
.review-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  max-width: 640px;
  margin: 0 auto;
}

.review-section {
  margin-bottom: 1.15rem; padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
}
.review-section:last-of-type { border-bottom: none; margin-bottom: 0.5rem; }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.55rem; }
.review-header h3 { font-size: 0.9rem; font-weight: 600; }
.edit-btn {
  background: none; border: none; color: var(--primary-light);
  font-family: inherit; font-size: 0.8rem; font-weight: 500;
  cursor: pointer; padding: 0.25rem 0.5rem; border-radius: 4px;
  -webkit-tap-highlight-color: transparent; min-height: 34px;
}
.edit-btn:hover, .edit-btn:active { background: var(--success-bg); color: var(--primary); }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.55rem; }
.review-item { display: flex; flex-direction: column; gap: 0.05rem; }
.review-label { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.review-value { font-size: 0.88rem; font-weight: 500; word-break: break-word; }
.review-map { height: 180px; border-radius: var(--radius-sm); margin-top: 0.55rem; overflow: hidden; background: #e8f5e9; }
.review-doc-list { display: flex; flex-direction: column; gap: 0.35rem; }
.review-doc-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.4rem 0.5rem; background: #F9FAFB;
  border-radius: 4px; font-size: 0.82rem;
}
.review-doc-item svg { flex-shrink: 0; }

.consent-box {
  background: #F9FAFB; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.75rem;
  margin-top: 0.75rem;
}
.checkbox-label {
  display: flex; align-items: flex-start; gap: 0.6rem;
  font-size: 0.85rem; line-height: 1.5;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.checkbox-label input { margin-top: 0.15rem; flex-shrink: 0; width: 18px; height: 18px; accent-color: var(--primary); }

/* ---- Confirmation ---- */
.confirm-icon { margin-bottom: 1rem; }
.confirm-ref { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.confirm-text { color: var(--text-muted); max-width: 420px; margin: 0 auto 1.25rem; line-height: 1.7; font-size: 0.88rem; }
.confirm-actions { margin-bottom: 1.5rem; }
.confirm-timeline { text-align: left; max-width: 380px; margin: 0 auto 1.5rem; }
.confirm-timeline h3 { font-size: 0.88rem; font-weight: 600; margin-bottom: 0.75rem; }
.timeline { display: flex; flex-direction: column; }
.timeline-item { display: flex; gap: 0.75rem; padding-bottom: 1rem; position: relative; }
.timeline-item:not(:last-child)::after {
  content: ''; position: absolute; left: 7px; top: 17px;
  width: 2px; height: calc(100% - 9px); background: var(--border);
}
.timeline-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border); background: white;
  flex-shrink: 0; margin-top: 2px;
}
.timeline-dot.active { border-color: var(--primary-light); background: var(--primary-light); }
.timeline-content { display: flex; flex-direction: column; gap: 0.05rem; }
.timeline-content strong { font-size: 0.82rem; }
.timeline-content span { font-size: 0.72rem; color: var(--text-muted); }
.timeline-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: #FEF3C7;
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  border-top: 1px solid var(--border);
}

/* ---- Leaflet overrides ---- */
.leaflet-draw-toolbar { display: none !important; }
.custom-pin { background: none !important; border: none !important; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); }

/* ======== Responsive ======== */
@media (max-width: 480px) {
  .tf-content { padding: 2rem 1rem 3rem; }
  .tf-question { font-size: 1.2rem; }
  .tf-input { font-size: 1rem; }
  .tf-row { grid-template-columns: 1fr; gap: 1rem; }
  .tool-label { display: none; }
  .map { height: 42vh; min-height: 240px; }
  .location-result-grid { grid-template-columns: 1fr; }
  .review-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .map-toolbar { flex-direction: column; gap: 0.35rem; }
  .map-search-wrap { width: 100%; }
  .map-tools { width: 100%; }
  .tool-btn { flex: 1; justify-content: center; }
  .map-info { flex-direction: column; gap: 0.4rem; }
  .map-info-kml { margin-left: 0; }
  .kml-btn { width: 100%; justify-content: center; }
}

@media (min-width: 641px) {
  .mobile-draw-hint { display: none; }
}

@media (min-width: 1024px) {
  .tf-content { padding: 4rem 2rem 4rem; }
  .tf-question { font-size: 1.65rem; }
  .tf-input { font-size: 1.25rem; }
  .map { height: 500px; max-height: 600px; }
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .footer { padding-bottom: calc(0.75rem + env(safe-area-inset-bottom)); }
}
