/* ==========================================================================
   MAP-DRAW SPLIT LAYOUT v3  —  Beautiful, 3-Step, Responsive
   Desktop : left map flex:1  +  right panel 420px
   Mobile  : top map 45vh     +  bottom panel flex:1
   ========================================================================== */

/* ── Base reset ─────────────────────────────────────────────────────────── */
.mds-shell *,
.mds-shell *::before,
.mds-shell *::after {
  box-sizing: border-box;
}

html:has(body.map-draw-active),
body.map-draw-active {
  overflow: hidden !important;
  height: 100%;
}

/* Suppress conflicting legacy rules that would show old panel UI */
#panel,
#statusbar,
#btn-open-panel,
#btn-close-panel,
#md-topbar {
  display: none !important;
}

/* ── Shell ──────────────────────────────────────────────────────────────── */
.mds-shell {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  padding-top: 88px;
  /* global header height */
  font-family: 'Noto Sans Thai', 'Noto Sans', sans-serif;
  background: #f0faf5;
}

/* ══════════════════════════════════════════════════════════════════════════
   LEFT — Map Area
   ══════════════════════════════════════════════════════════════════════════ */
.mds-map-side {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #ffffff;
  /* white until map tiles load */
}

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

.mds-shell.drawing .mds-map-container {
  cursor: crosshair !important;
}

/* ── Search overlay ── */
.mds-search-wrap {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: min(380px, calc(100% - 80px));
}

.mds-search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 6px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: all 0.3s ease;
}

.mds-search-box:focus-within {
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.14), 0 0 0 3px rgba(45, 158, 95, 0.15);
  transform: translateY(-1px);
}

.mds-search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 11px 16px;
  font-size: 15px;
  font-family: 'Noto Sans Thai', 'Noto Sans', sans-serif;
  color: #1a3d2b;
  outline: none;
}

.mds-search-input::placeholder {
  color: #94a3b0;
}

.mds-search-btn {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #2d9e5f, #0d9488);
  border: none;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin: 4px;
  border-radius: 13px;
  box-shadow: 0 4px 12px rgba(45, 158, 95, 0.3);
  flex-shrink: 0;
}

.mds-search-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(45, 158, 95, 0.4);
}

.mds-search-results {
  background: #fff;
  border: 1px solid rgba(45, 158, 95, 0.1);
  border-radius: 14px;
  margin-top: 8px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.mds-search-item {
  padding: 12px 16px;
  font-size: 15px;
  color: #1a3d2b;
  cursor: pointer;
  border-bottom: 1px solid rgba(45, 158, 95, 0.06);
  transition: all 0.18s;
  font-family: 'Noto Sans Thai', 'Noto Sans', sans-serif;
}

.mds-search-item:last-child {
  border-bottom: none;
}

.mds-search-item:hover {
  background: rgba(45, 158, 95, 0.06);
  padding-left: 20px;
}

/* ── Map controls ── */
.mds-map-controls {
  position: absolute;
  bottom: 36px;
  right: 14px;
  left: auto;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mds-map-ctrl-btn {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #555;
  cursor: pointer;
  transition: all 0.2s;
}

.mds-map-ctrl-btn:hover {
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.14);
  transform: translateY(-2px);
  color: #2d9e5f;
}

/* ── Basemap card ── */
.mds-basemap-card {
  position: absolute;
  bottom: 36px;
  right: 58px;
  left: auto;
  width: 216px;
  background: #fff;
  border: 1px solid rgba(45, 158, 95, 0.12);
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.14);
  z-index: 60;
  padding: 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(10px) scale(0.97);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.mds-basemap-card.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) scale(1);
}

.mds-basemap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 800;
  color: #1a3d2b;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.mds-basemap-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(45, 158, 95, 0.1);
  border-radius: 10px;
  margin-bottom: 5px;
  cursor: pointer;
  font-size: 14px;
  color: #5a8a6a;
  font-weight: 600;
  transition: all 0.2s;
}

.mds-basemap-option:last-child {
  margin-bottom: 0;
}

.mds-basemap-option:hover {
  background: rgba(45, 158, 95, 0.06);
  border-color: rgba(45, 158, 95, 0.22);
}

.mds-basemap-option.active {
  background: rgba(45, 158, 95, 0.1);
  border-color: #2d9e5f;
  color: #1e7a47;
}

.mds-basemap-option i {
  font-size: 15px;
}

/* ── Status bar ── */
.mds-statusbar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 13px;
  color: #5a8a6a;
  border-top: 1px solid rgba(45, 158, 95, 0.08);
  z-index: 40;
  font-family: 'Noto Sans Thai', 'Noto Sans', sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mds-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2d9e5f;
  flex-shrink: 0;
  animation: mdsStatusPulse 2s ease-in-out infinite;
}

@keyframes mdsStatusPulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.35;
  }
}

/* ── MapLibre overrides ── */
.mds-map-container .maplibregl-ctrl-bottom-right {
  bottom: 84px !important;
  right: 14px !important;
}

.mds-map-container .maplibregl-ctrl-group {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 !important;
}

.mds-map-container .maplibregl-ctrl-group button {
  width: 36px !important;
  height: 36px !important;
  background: rgba(255, 255, 255, 0.97) !important;
  border: 1px solid rgba(0, 0, 0, 0.07) !important;
  border-radius: 10px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.2s !important;
}

.mds-map-container .maplibregl-ctrl-group button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15) !important;
}

.mds-map-container .maplibregl-ctrl-attrib {
  display: none !important;
}

/* ══════════════════════════════════════════════════════════════════════════
   RIGHT — Data Panel
   ══════════════════════════════════════════════════════════════════════════ */
.mds-panel-side {
  width: 50%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #f8fdf9;
  border-left: 1px solid rgba(22, 163, 74, 0.12);
  box-shadow: -6px 0 40px rgba(0, 0, 0, 0.07);
  z-index: 10;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), margin-right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mds-panel-side.closed {
  display: none !important;
}

.mds-mobile-drag-handle {
  display: none;
}

/* ── Toggle Buttons ── */
.mds-panel-toggle-btn {
  position: absolute;
  top: 108px;
  right: 20px;
  z-index: 50;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d9e5f, #0d9488);
  color: #fff;
  border: 2px solid #fff;
  box-shadow: 0 6px 20px rgba(45, 158, 95, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mds-panel-toggle-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 24px rgba(45, 158, 95, 0.45);
}

.mds-panel-toggle-text {
  display: none;
}

/* ── Close button — now a flex inline item on the right ── */
.mds-panel-close-btn {
  display: none !important;     /* hide old absolute version */
}

/* Inline version used in JSX */
.mds-panel-close-inline {
  flex-shrink: 0 !important;
  margin-left: 8px !important;
  width: 32px !important;
  height: 32px !important;
  background: rgba(22, 163, 74, 0.1) !important;
  border: 1.5px solid rgba(22, 163, 74, 0.25) !important;
  color: #16a34a !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 14px !important;
  cursor: pointer !important;
  transition: all 0.22s ease !important;
  position: static !important;
  transform: none !important;
}

.mds-panel-close-inline:hover {
  background: rgba(22, 163, 74, 0.2) !important;
  border-color: #22c55e !important;
  color: #0f2d1c !important;
  transform: rotate(90deg) scale(1.08) !important;
}

/* ── Panel Header ── */
.mds-panel-hd {
  flex-shrink: 0;
  padding: 16px 20px 14px;
  background: linear-gradient(155deg, #ffffff 0%, #f0fdf4 60%, #e8faf0 100%);
  border-bottom: 1.5px solid rgba(22, 163, 74, 0.12);
  position: relative;
  overflow: hidden;
}

/* Subtle green orb */
.mds-panel-hd::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -30px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(22, 163, 74, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.mds-panel-hd-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

/* Brand */
.mds-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mds-brand-icon {
  width: 38px;
  height: 38px;
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #16a34a;
  flex-shrink: 0;
}

.mds-brand-text {
  line-height: 1.15;
}

.mds-brand-name {
  font-size: 21px;
  font-weight: 800;
  color: #0f2d1c;
  letter-spacing: -0.4px;
}

.mds-brand-name span {
  color: #16a34a;
}

.mds-brand-sub {
  font-size: 14px;
  color: #6b9e7e;
  margin-top: 1px;
}

/* User pill */
.mds-user-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(22, 163, 74, 0.06);
  border: 1px solid rgba(22, 163, 74, 0.18);
  border-radius: 50px;
  padding: 5px 12px 5px 5px;
  flex-shrink: 0;
}

.mds-user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #ffffff;
  flex-shrink: 0;
}

.mds-user-name {
  font-size: 15px;
  font-weight: 600;
  color: #15803d;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Step Tracker ── */
.mds-stepper {
  display: flex;
  align-items: center;
  padding: 24px 20px 16px 48px;
  background: linear-gradient(180deg, #f4fcf7 0%, #ffffff 100%);
  border-bottom: 1px solid rgba(45, 158, 95, 0.08);
  flex-shrink: 0;
  position: relative;
}

.mds-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  position: relative;
  gap: 5px;
}

/* Connector line between steps */
.mds-step:not(:last-of-type)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: rgba(45, 158, 95, 0.13);
  border-radius: 2px;
  z-index: 0;
  transition: background 0.4s ease;
}

.mds-step.done:not(:last-of-type)::after {
  background: linear-gradient(90deg, rgba(45, 158, 95, 0.5), rgba(13, 148, 136, 0.4));
}

.mds-step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(45, 158, 95, 0.18);
  background: #fff;
  color: #b0bec5;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  position: relative;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(45, 158, 95, 0.06);
}

.mds-step.active .mds-step-circle {
  background: linear-gradient(135deg, #2d9e5f, #0d9488);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 20px rgba(45, 158, 95, 0.38);
  transform: scale(1.14);
}

.mds-step.done .mds-step-circle {
  background: rgba(45, 158, 95, 0.1);
  border-color: #2d9e5f;
  color: #2d9e5f;
}

.mds-step-label {
  font-size: 13px;
  font-weight: 700;
  color: #b0bec5;
  text-align: center;
  white-space: nowrap;
  transition: color 0.25s;
}

.mds-step.active .mds-step-label {
  color: #1e7a47;
  font-weight: 800;
}

.mds-step.done .mds-step-label {
  color: #2d9e5f;
}

/* ── Panel Body ── */
.mds-panel-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.mds-panel-body::-webkit-scrollbar {
  width: 3px;
}

.mds-panel-body::-webkit-scrollbar-thumb {
  background: rgba(45, 158, 95, 0.18);
  border-radius: 3px;
}

/* ══════════════════════════════════════════════════════════════════════════
   STEP 1 CONTENT
   ══════════════════════════════════════════════════════════════════════════ */
.mds-s1 {
  padding: 22px 20px 28px;
}

/* Tag badge */
.mds-section-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(45, 158, 95, 0.09);
  border: 1px solid rgba(45, 158, 95, 0.2);
  color: #1e7a47;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 10px;
}

.mds-s1-title {
  font-size: 26px;
  font-weight: 800;
  color: #0f2d1c;
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin: 0 0 5px;
}

.mds-s1-sub {
  font-size: 15px;
  color: #7aaa8a;
  margin: 0 0 20px;
  line-height: 1.55;
}

/* Method selector */
.mds-method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-bottom: 18px;
}

.mds-method-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 17px 12px;
  background: rgba(45, 158, 95, 0.03);
  border: 2px solid rgba(45, 158, 95, 0.11);
  border-radius: 15px;
  color: #5a8a6a;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  user-select: none;
}

.mds-method-card i {
  font-size: 24px;
  color: #2d9e5f;
  opacity: 0.6;
  transition: all 0.2s;
}

.mds-method-card:hover:not(.active) {
  background: rgba(45, 158, 95, 0.08);
  border-color: rgba(45, 158, 95, 0.3);
  color: #1e7a47;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(45, 158, 95, 0.1);
}

.mds-method-card:hover:not(.active) i {
  opacity: 1;
}

.mds-method-card.active {
  background: linear-gradient(135deg, rgba(45, 158, 95, 0.12), rgba(13, 148, 136, 0.08));
  border-color: rgba(45, 158, 95, 0.45);
  color: #1e7a47;
  box-shadow: 0 6px 22px rgba(45, 158, 95, 0.16);
  transform: translateY(-1px);
}

.mds-method-card.active i {
  opacity: 1;
}

/* Draw hint banner */
.mds-draw-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid rgba(22, 163, 74, 0.25);
  border-radius: 12px;
  color: #15803d;
  font-size: 15px;
  font-weight: 600;
  margin-top: 10px;
  animation: mdsHintFade 0.3s ease;
  line-height: 1.45;
}

@keyframes mdsHintFade {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mds-dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  flex-shrink: 0;
  animation: mdsDP 1.4s ease-in-out infinite;
}

@keyframes mdsDP {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.6);
  }

  50% {
    box-shadow: 0 0 0 7px rgba(22, 163, 74, 0);
  }
}

/* Draw success card */
.mds-success-box {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 15px 16px;
  background: linear-gradient(135deg, rgba(45, 158, 95, 0.1), rgba(13, 148, 136, 0.07));
  border: 1px solid rgba(45, 158, 95, 0.28);
  border-radius: 15px;
  margin-bottom: 12px;
  animation: mdsSuccessFade 0.4s ease;
}

@keyframes mdsSuccessFade {
  from {
    opacity: 0;
    transform: scale(0.97);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.mds-success-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d9e5f, #0d9488);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(45, 158, 95, 0.32);
}

.mds-success-text strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: #0f2d1c;
  margin-bottom: 3px;
}

.mds-success-text span {
  font-size: 15px;
  color: #5a8a6a;
  line-height: 1.45;
}

/* Dropzone */
.mds-dropzone {
  border: 2px dashed rgba(45, 158, 95, 0.28);
  border-radius: 16px;
  padding: 28px 16px 22px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(45, 158, 95, 0.02);
  margin-bottom: 12px;
  user-select: none;
}

.mds-dropzone i {
  font-size: 32px;
  color: rgba(45, 158, 95, 0.5);
  display: block;
  margin-bottom: 10px;
  transition: all 0.3s;
}

.mds-dropzone p {
  font-size: 14px;
  font-weight: 600;
  color: #1a3d2b;
  margin: 0 0 5px;
}

.mds-dropzone span {
  font-size: 12px;
  color: #7aaa8a;
  letter-spacing: 0.2px;
}

.mds-dropzone:hover,
.mds-dropzone.drag-over {
  border-color: #2d9e5f;
  background: rgba(45, 158, 95, 0.07);
  transform: scale(1.015);
}

.mds-dropzone:hover i,
.mds-dropzone.drag-over i {
  color: #2d9e5f;
  transform: translateY(-3px);
}

.mds-dropzone.drag-over {
  border-style: solid;
  box-shadow: 0 0 0 4px rgba(45, 158, 95, 0.12);
}

.mds-dropzone.has-file i {
  color: #2d9e5f;
}

.mds-dropzone.has-file p {
  color: #1e7a47;
  font-weight: 700;
}

.mds-shp-msg {
  font-size: 14px;
  color: #e53e3e;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(229, 62, 62, 0.06);
  border: 1px solid rgba(229, 62, 62, 0.15);
  margin-bottom: 10px;
}

.mds-shp-msg.ok {
  color: #1e7a47;
  background: rgba(45, 158, 95, 0.07);
  border-color: rgba(45, 158, 95, 0.2);
}

/* Divider */
.mds-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(45, 158, 95, 0.1), transparent);
  margin: 18px 0;
}

/* Vertical stepper guide */
.mds-vertical-stepper {
  background: rgba(45, 158, 95, 0.02);
  border: 1px solid rgba(45, 158, 95, 0.09);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mds-v-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  min-height: 46px;
}

.mds-v-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(45, 158, 95, 0.18);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #b0bec5;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.mds-v-circle.active {
  background: linear-gradient(135deg, #2d9e5f, #0d9488);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 5px 16px rgba(45, 158, 95, 0.36);
  transform: scale(1.08);
}

.mds-v-circle.done {
  background: rgba(45, 158, 95, 0.1);
  border-color: #2d9e5f;
  color: #2d9e5f;
}

.mds-v-label {
  padding-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #b0bec5;
  line-height: 1.4;
  transition: color 0.25s;
}

.mds-v-label.active {
  color: #0f2d1c;
  font-weight: 800;
}

.mds-v-label.done {
  color: #2d9e5f;
}

.mds-v-line {
  position: absolute;
  left: 14px;
  top: 30px;
  width: 2px;
  height: 20px;
  background: rgba(45, 158, 95, 0.14);
  border-radius: 2px;
  transition: background 0.3s;
}

.mds-v-line.done {
  background: rgba(45, 158, 95, 0.4);
}

/* ══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════════════ */
.mds-btn {
  width: 100%;
  padding: 12px 20px;
  border-radius: 13px;
  font-size: 17px;
  font-weight: 700;
  font-family: 'Noto Sans Thai', 'Noto Sans', sans-serif;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

.mds-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.mds-btn-solid {
  background: linear-gradient(135deg, #2d9e5f, #0d9488);
  color: #fff;
  box-shadow: 0 6px 20px rgba(45, 158, 95, 0.28);
}

.mds-btn-solid:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(45, 158, 95, 0.4);
}

.mds-btn-danger {
  background: linear-gradient(135deg, #e53e3e, #c53030);
  color: #fff;
  box-shadow: 0 6px 20px rgba(229, 62, 62, 0.25);
}

.mds-btn-danger:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(229, 62, 62, 0.36);
}

.mds-btn-soft {
  background: rgba(45, 158, 95, 0.07);
  color: #1e7a47;
  border: 1.5px solid rgba(45, 158, 95, 0.2);
}

.mds-btn-soft:hover:not(:disabled) {
  background: rgba(45, 158, 95, 0.13);
  border-color: rgba(45, 158, 95, 0.35);
  transform: translateY(-1px);
}

/* ══════════════════════════════════════════════════════════════════════════
   STEPS 2 & 3 — Results container
   ══════════════════════════════════════════════════════════════════════════ */
.mds-results-container {
  padding: 0 20px 28px;
}

/* PRP panel in split layout */
.mds-results-container .prp-shell {
  padding: 0;
  margin-top: 0;
  border-top: none;
}

/* ══════════════════════════════════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════════════════════════════════ */
.mds-toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(45, 158, 95, 0.95);
  color: #fff;
  padding: 10px 24px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Noto Sans Thai', 'Noto Sans', sans-serif;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  white-space: nowrap;
  animation: mdsToastIn 0.3s ease;
}

@keyframes mdsToastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   MOBILE  (≤ 768px)
   ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .mds-shell {
    flex-direction: column;
    padding-top: 56px;
  }

  .mds-map-side {
    flex: 0 0 42vh;
    min-height: 180px;
    z-index: 1;
    transition: flex 0.3s ease;
  }

  .mds-shell.drawing .mds-map-side {
    flex: 1 1 auto;
  }

  .mds-shell.drawing .mds-panel-side {
    flex: 0 0 auto;
  }

  /* Hide headers when drawing on mobile to save space */
  .mds-shell.drawing .mds-s1-hd,
  .mds-shell.drawing .mds-method-toggle {
    display: none !important;
  }

  .mds-panel-side {
    width: 100% !important;
    flex: 1;
    border-left: none;
    border-top: none;
    margin-top: -24px;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.12);
    z-index: 2;
    position: relative;
    overflow: hidden;
  }

  .mds-panel-hd {
    border-radius: 24px 24px 0 0;
    padding-top: 18px;
  }

  /* Drag handle */
  .mds-panel-hd::after {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: rgba(22, 163, 74, 0.2);
    border-radius: 4px;
    margin: 8px auto 0;
  }

  .mds-stepper {
    padding: 12px 16px 10px;
  }

  .mds-step-label {
    font-size: 8.5px;
  }

  .mds-step-circle {
    width: 26px;
    height: 26px;
    font-size: 10px;
  }

  .mds-step::after {
    top: 12px;
  }

  .mds-s1 {
    padding: 16px 16px 24px;
  }

  .mds-results-container {
    padding: 0 16px 24px;
  }

  .mds-search-wrap {
    top: 12px;
    width: calc(100% - 28px);
    left: 14px;
    transform: none;
  }

  .mds-map-container .maplibregl-ctrl-bottom-right {
    position: fixed !important;
    top: auto !important;
    bottom: 64px !important;
    right: 14px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    z-index: 1 !important;
  }

  .mds-map-controls {
    position: fixed !important;
    top: auto !important;
    bottom: 20px !important;
    right: 14px !important;
    z-index: 1 !important;
  }

  .mds-map-ctrl-btn {
    width: 38px !important;
    height: 38px !important;
  }

  .mds-basemap-card {
    position: fixed !important;
    top: auto !important;
    bottom: 20px !important;
    right: 60px !important;
    z-index: 60 !important;
  }

  .mds-statusbar {
    display: none !important;
  }
}

@media (max-width: 480px) {
  .mds-map-side {
    flex: 0 0 38vh;
  }

  .mds-user-name {
    display: none;
  }

  .mds-brand-sub {
    display: none;
  }

  .mds-s1-title {
    font-size: 20px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   STEP 1 — Instruction list + Notes
   ══════════════════════════════════════════════════════════════════════════ */
.mds-instr-note {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(251, 191, 36, 0.09);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 11px;
  padding: 9px 13px;
  font-size: 13px;
  color: #6d4c00;
  font-weight: 600;
  margin-bottom: 14px;
  line-height: 1.45;
}

.mds-instr-note i {
  color: #d97706;
  font-size: 15px;
  flex-shrink: 0;
}

.mds-instr-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  counter-reset: instr;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.mds-instr-list li {
  counter-increment: instr;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: #3a5a4a;
  line-height: 1.5;
}

.mds-instr-list li::before {
  content: counter(instr);
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(45, 158, 95, 0.12);
  border: 1.5px solid rgba(45, 158, 95, 0.28);
  color: #1e7a47;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.mds-instr-list li strong {
  color: #1e7a47;
}

/* ── Stepper close button ── */
.mds-step-close {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid rgba(200, 60, 60, 0.22);
  background: rgba(254, 226, 226, 0.7);
  color: #dc2626;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.22s;
  padding: 0;
}

.mds-step-close:hover {
  background: #ef4444;
  border-color: transparent;
  color: #fff;
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ── Danger text-link button ── */
.mds-btn-link-danger {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 6px;
  background: none;
  border: none;
  color: rgba(200, 53, 53, 0.7);
  font-size: 13px;
  font-weight: 600;
  font-family: 'Noto Sans Thai', 'Noto Sans', sans-serif;
  cursor: pointer;
  transition: color 0.18s;
}

.mds-btn-link-danger:hover {
  color: #dc2626;
}

/* ── Back / secondary link (prp panels) ── */
.prp-back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 8px;
  background: none;
  border: none;
  color: #7aaa8a;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.18s;
  margin-top: 2px;
}

.prp-back-link:hover {
  color: #1e7a47;
}

/* ════════════════════════════════════════════════════════════════════════════
   ▌ NEW DESIGN v2 — Complete panel & step-1 redesign
   ▌ Overrides all earlier panel/stepper/step-1 rules above
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Panel shell ────────────────────────────────────────────────────────── */
.mds-panel-side {
  width: 50% !important;
  background: #f8fdf9 !important;
  border-left: 1px solid rgba(22, 163, 74, 0.12) !important;
  box-shadow: -4px 0 32px rgba(0, 0, 0, 0.06) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  position: relative !important;
}

/* top accent bar */
.mds-panel-side::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #16a34a 0%, #22c55e 50%, #4ade80 100%);
  z-index: 30;
}

/* ── Stepper — Premium Track Design ────────────────────────────────────── */
.mds-stepper {
  display: flex !important;
  align-items: center !important;
  padding: 14px 14px 12px 14px !important;
  background: #ffffff !important;
  border-bottom: 1px solid rgba(22, 163, 74, 0.1) !important;
  position: relative !important;
  flex-shrink: 0 !important;
  gap: 8px !important;
}

/* Wrapper: flex row holding track (abs) + 3 step cols */
.mds-steps-row {
  flex: 1 !important;
  display: flex !important;
  align-items: flex-start !important;
  position: relative !important;
  gap: 0 !important;
}

/* ─ Track: absolute inside .mds-steps-row ─
   3 equal cols: centre of col-1 = 1/6, centre of col-3 = 5/6 of row.
   So left=1/6, right=1/6 spans perfectly between step centres. */
.mds-stepper-track {
  display: block !important;
  position: absolute !important;
  top: 20px !important;                     /* half of 40px circle height */
  left: calc(100% / 6) !important;
  right: calc(100% / 6) !important;
  height: 3px !important;
  background: #e2e8f0 !important;
  border-radius: 99px !important;
  overflow: hidden !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

.mds-stepper-fill {
  display: block !important;
  height: 100% !important;
  background: #1fae59 !important;
  border-radius: 99px !important;
  transition: width 0.5s ease !important;
}

/* ─ Each step column ─ */
.mds-step {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 6px !important;
  flex: 1 !important;
  position: relative !important;
  z-index: 1 !important;
}

/* No ::after connectors — the track handles it */
.mds-step::after,
.mds-step:last-of-type::after {
  display: none !important;
}

/* ─ Circle ─ */
.mds-step-circle {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50% !important;
  border: 2px solid #e2e8f0 !important;
  background: #ffffff !important;
  color: #94a3b8 !important;
  font-size: 18px !important;
  font-weight: 800 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  z-index: 2 !important;
  transition: all 0.3s ease !important;
  box-shadow: none !important;
}

.mds-step.active .mds-step-circle {
  background: #1fae59 !important;
  border-color: #1fae59 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 6px #eaf5ef !important;
  transform: scale(1) !important;
}

.mds-step.done .mds-step-circle {
  background: #ffffff !important;
  border-color: #1fae59 !important;
  color: #1fae59 !important;
  box-shadow: none !important;
  transform: scale(1) !important;
}

/* ─ Labels ─ */
.mds-step-label {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #94a3b8 !important;
  white-space: nowrap !important;
  letter-spacing: 0.2px !important;
  transition: color 0.25s !important;
  line-height: 1 !important;
}

.mds-step.active .mds-step-label {
  color: #1fae59 !important;
  font-weight: 800 !important;
}

.mds-step.done .mds-step-label {
  color: #1fae59 !important;
}

/* ─ Close button ─ */
.mds-step-close {
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  border: 1.5px solid rgba(239, 68, 68, 0.25) !important;
  color: #ef4444 !important;
  font-size: 15px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  margin-left: 8px !important;
  position: relative !important;
  z-index: 10 !important;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

@media (hover: hover) and (pointer: fine) {
  .mds-step-close:hover {
    background: #ef4444 !important;
    border-color: transparent !important;
    color: #fff !important;
    transform: rotate(90deg) scale(1.1) !important;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3) !important;
  }
}

.mds-step-close:active {
  background: #ef4444 !important;
  color: #fff !important;
  transform: scale(0.95) !important;
}

/* ── Panel body ─────────────────────────────────────────────────────────── */
.mds-panel-body {
  flex: 1 !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  padding: 14px !important;
  background: #f8fdf9 !important;
}

.mds-panel-body::-webkit-scrollbar {
  width: 4px !important;
}

.mds-panel-body::-webkit-scrollbar-thumb {
  background: rgba(22, 163, 74, 0.2) !important;
  border-radius: 4px !important;
}

/* ── Step 1 ─────────────────────────────────────────────────────────────── */
.mds-s1 {
  padding: 0 !important;
}

.mds-s1-card {
  background: #ffffff;
  border-radius: 22px;
  padding: 22px 20px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(22, 163, 74, 0.08);
  animation: s1CardIn 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes s1CardIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mds-s1-hd {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 8px;
}

.mds-section-tag {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.1), rgba(34, 197, 94, 0.06)) !important;
  border: 1px solid rgba(22, 163, 74, 0.2) !important;
  color: #15803d !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  padding: 4px 12px !important;
  border-radius: 50px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.7px !important;
  margin-bottom: 8px !important;
}

.mds-s1-title {
  font-size: 28px !important;
  font-weight: 900 !important;
  color: #0f2d1c !important;
  letter-spacing: -0.6px !important;
  line-height: 1.2 !important;
  margin: 0 0 6px !important;
  -webkit-text-fill-color: unset !important;
  background: none !important;
}

.mds-s1-sub {
  font-size: 16px !important;
  color: #6b8f78 !important;
  margin: 0 !important;
  line-height: 1.55 !important;
}

/* large decorative step number */
.mds-s1-num {
  display: none !important;
}

/* ── Method toggle (replaces old method-grid/card) ──────────────────────── */
.mds-method-toggle {
  display: flex;
  background: #f1f5f2;
  border-radius: 14px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 20px;
}

.mds-mtab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 11px;
  background: transparent;
  font-family: 'Noto Sans Thai', 'Noto Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.mds-mtab:hover:not(.active) {
  background: rgba(22, 163, 74, 0.06);
  color: #15803d;
}

.mds-mtab.active {
  background: #ffffff;
  color: #15803d;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.09);
}

.mds-mtab i {
  font-size: 15px;
}

/* ── Action content ─────────────────────────────────────────────────────── */
.mds-action-content {
  margin-bottom: 4px;
}

/* ── Info note ──────────────────────────────────────────────────────────── */
.mds-instr-note {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: rgba(22, 163, 74, 0.06) !important;
  border: 1px solid rgba(22, 163, 74, 0.18) !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #15803d !important;
  margin-bottom: 14px !important;
  line-height: 1.45 !important;
}

.mds-instr-note i {
  color: #22c55e !important;
  font-size: 16px !important;
  flex-shrink: 0 !important;
}

/* ── Instruction list — timeline style ──────────────────────────────────── */
.mds-instr-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 20px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 0 !important;
  counter-reset: instr !important;
  position: relative !important;
}

/* vertical timeline line */
.mds-instr-list::before {
  content: '';
  position: absolute;
  left: 13px;
  top: 24px;
  bottom: 10px;
  width: 1px;
  background: linear-gradient(180deg, rgba(22, 163, 74, 0.3), rgba(22, 163, 74, 0.06));
}

.mds-instr-list li {
  counter-increment: instr !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  font-size: 15px !important;
  color: #3a5a4a !important;
  line-height: 1.55 !important;
  padding: 10px 0 !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transform: none !important;
  transition: color 0.2s !important;
  position: relative !important;
}

.mds-instr-list li::before {
  content: counter(instr) !important;
  flex-shrink: 0 !important;
  width: 26px !important;
  height: 26px !important;
  min-width: 26px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  border: 2px solid rgba(22, 163, 74, 0.3) !important;
  color: #16a34a !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.12) !important;
  margin-top: 0 !important;
  position: relative !important;
  z-index: 1 !important;
  transition: all 0.25s !important;
}

.mds-instr-list li:hover::before {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3) !important;
}

.mds-instr-list li:hover {
  color: #0f2d1c !important;
}

.mds-instr-list li strong {
  color: #16a34a !important;
}

/* ── Draw hint ──────────────────────────────────────────────────────────── */
.mds-draw-hint {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 12px 15px !important;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7) !important;
  border: 1px solid rgba(22, 163, 74, 0.25) !important;
  border-radius: 14px !important;
  color: #15803d !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  margin-top: 0 !important;
  animation: s1CardIn 0.3s ease !important;
  line-height: 1.45 !important;
}

.mds-dot-pulse {
  width: 9px !important;
  height: 9px !important;
  border-radius: 50% !important;
  background: #16a34a !important;
  flex-shrink: 0 !important;
  animation: mdsDP 1.4s ease-in-out infinite !important;
}

/* ── Success box ────────────────────────────────────────────────────────── */
.mds-success-box {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 14px 16px !important;
  background: linear-gradient(135deg, rgba(22, 163, 74, 0.08), rgba(34, 197, 94, 0.05)) !important;
  border: 1.5px solid rgba(22, 163, 74, 0.25) !important;
  border-radius: 16px !important;
  margin-bottom: 14px !important;
}

.mds-success-icon {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg, #16a34a, #22c55e) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 22px !important;
  color: #fff !important;
  flex-shrink: 0 !important;
  box-shadow: 0 8px 20px rgba(22, 163, 74, 0.35) !important;
}

.mds-success-text strong {
  display: block !important;
  font-size: 17px !important;
  font-weight: 800 !important;
  color: #0f2d1c !important;
  margin-bottom: 3px !important;
}

.mds-success-text span {
  font-size: 15px !important;
  color: #6b8f78 !important;
}

/* ── Buttons — pill style ───────────────────────────────────────────────── */
.mds-btn {
  width: 100% !important;
  padding: 13px 20px !important;
  border-radius: 50px !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  font-family: 'Noto Sans Thai', 'Noto Sans', sans-serif !important;
  border: none !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1) !important;
  margin-bottom: 10px !important;
  letter-spacing: 0.2px !important;
}

.mds-btn:disabled {
  opacity: 0.42 !important;
  cursor: not-allowed !important;
}

.mds-btn-solid {
  background: linear-gradient(135deg, #16a34a, #22c55e) !important;
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.32) !important;
}

.mds-btn-solid:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 14px 32px rgba(22, 163, 74, 0.44) !important;
}

.mds-btn-soft {
  background: #ffffff !important;
  color: #16a34a !important;
  border: 1.5px solid rgba(22, 163, 74, 0.25) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

.mds-btn-soft:hover:not(:disabled) {
  background: #f0fdf4 !important;
  border-color: #22c55e !important;
  transform: translateY(-1px) !important;
}

.mds-btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.28) !important;
}

.mds-btn-danger:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 26px rgba(239, 68, 68, 0.4) !important;
}

.mds-btn-link-danger {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  width: 100% !important;
  padding: 6px !important;
  background: none !important;
  border: none !important;
  color: rgba(200, 53, 53, 0.65) !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  transition: color 0.18s !important;
}

.mds-btn-link-danger:hover {
  color: #dc2626 !important;
}

/* ── Dropzone ───────────────────────────────────────────────────────────── */
.mds-dropzone {
  border: 2px dashed rgba(22, 163, 74, 0.25) !important;
  border-radius: 18px !important;
  padding: 30px 18px 24px !important;
  text-align: center !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  background: rgba(22, 163, 74, 0.02) !important;
  margin-bottom: 14px !important;
  user-select: none !important;
}

.mds-dropzone:hover,
.mds-dropzone.drag-over {
  border-color: #22c55e !important;
  background: rgba(22, 163, 74, 0.06) !important;
  transform: scale(1.012) !important;
}

.mds-dropzone.has-file {
  border-style: solid !important;
  border-color: #22c55e !important;
  background: rgba(22, 163, 74, 0.04) !important;
}

/* ── Results container ──────────────────────────────────────────────────── */
.mds-results-container {
  background: #ffffff;
  border-radius: 22px;
  padding: 20px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(22, 163, 74, 0.08);
  animation: s1CardIn 0.38s ease;
}

.mds-results-container .prp-shell {
  padding: 0 !important;
  margin-top: 0 !important;
  border-top: none !important;
}

/* ── Mobile v2 ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .mds-panel-side.closed {
    display: none !important;
  }

  .mds-map-side {
    height: 42vh;
    transition: height 0.4s ease, flex 0.4s ease;
  }

  /* When panel is closed on mobile, map fills remaining space */
  .mds-shell:has(.mds-panel-side.closed) .mds-map-side {
    height: auto !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
  }

  .mds-panel-side {
    width: 100% !important;
    border-left: none !important;
    margin-top: -24px !important;
    border-radius: 24px 24px 0 0 !important;
    box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.1) !important;
  }

  /* clickable drag handle area */
  .mds-mobile-drag-handle {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 32px;
    z-index: 100;
    cursor: pointer;
    display: block;
  }

  .mds-mobile-drag-handle::after {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 5px;
    background: rgba(22, 163, 74, 0.28);
    border-radius: 10px;
  }

  /* Stepper — sits BELOW the drag handle (36px) so close button is visible */
  .mds-stepper {
    padding: 42px 12px 12px 12px !important;
    gap: 6px !important;
    border-radius: 24px 24px 0 0 !important;
    z-index: 101 !important;
    position: relative !important;
  }

  /* Drag handle must NOT cover stepper content */
  .mds-mobile-drag-handle {
    height: 36px !important;
    z-index: 102 !important;
  }

  /* Mobile: smaller circles */
  .mds-step-circle {
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
  }

  .mds-step.active .mds-step-circle {
    transform: scale(1.1) !important;
  }

  /* Mobile: track centre = 32/2 = 16px from top of circles */
  .mds-stepper-track {
    top: 16px !important;
  }

  .mds-step-label {
    font-size: 13px !important;
  }

  /* Inline close button on mobile */
  .mds-panel-close-inline {
    width: 30px !important;
    height: 30px !important;
    font-size: 14px !important;
    z-index: 103 !important;
    position: relative !important;
    flex-shrink: 0 !important;
  }

  /* Ensure old absolute button stays hidden */
  .mds-panel-close-btn {
    display: none !important;
  }

  .mds-panel-body {
    padding: 10px !important;
    padding-bottom: 80px !important;
  }

  .mds-s1-card {
    padding: 18px 16px 16px;
    border-radius: 18px;
  }

  .mds-s1-title {
    font-size: 23px !important;
  }

  .mds-s1-num {
    font-size: 40px;
  }

  .mds-mtab {
    font-size: 14px;
    padding: 9px 8px;
  }

  .mds-instr-list li {
    font-size: 15px !important;
  }

  .mds-results-container {
    border-radius: 18px;
    padding: 16px !important;
  }

  .mds-map-container .maplibregl-ctrl-bottom-right {
    bottom: 60px !important;
    right: 14px !important;
  }

  /* Icon button — top right, below navbar */
  /* navbar on mobile is ~75px; place FAB 20px below it */
  .mds-panel-toggle-btn {
    position: fixed !important;
    top: 100px !important;
    right: 14px !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    z-index: 200 !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    font-size: 22px !important;
    white-space: normal !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    box-shadow: 0 6px 20px rgba(45, 158, 95, 0.35) !important;
    animation: mdsFabIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    background: linear-gradient(135deg, #2d9e5f, #0d9488) !important;
    color: #ffffff !important;
    border: 2px solid #ffffff !important;
  }

  @keyframes mdsFabIn {
    from { opacity: 0; transform: scale(0.6); }
    to   { opacity: 1; transform: scale(1); }
  }

  .mds-panel-toggle-btn:hover,
  .mds-panel-toggle-btn:active {
    transform: scale(1.08) !important;
    box-shadow: 0 8px 24px rgba(45, 158, 95, 0.45) !important;
  }

  .mds-panel-toggle-text {
    display: none !important;
  }

  /* Force display even during drawing mode on mobile so they can reopen panel anytime */
  .mds-shell.drawing .mds-panel-toggle-btn {
    display: flex !important;
  }
}

@media (max-width: 480px) {
  .mds-s1-title {
    font-size: 19px !important;
  }

  .mds-s1-sub {
    font-size: 14px !important;
  }

  .mds-s1-num {
    font-size: 34px;
  }

  .mds-btn {
    padding: 12px 16px !important;
    font-size: 14px !important;
  }

}

/* ── Center Content on Desktop ── */
@media (min-width: 769px) {
  .mds-steps-row {
    max-width: 480px !important;
    margin: 0 auto !important;
  }
  .mds-s1-card, .mds-results-container {
    max-width: 520px !important;
    margin: 0 auto !important;
  }
}

/* ── Hide MapLibre logo ── */
.maplibregl-ctrl-logo,
.maplibregl-logo {
  display: none !important;
}

/* ── ParcelResultsPanel: improved empty state ── */
.prp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 20px 24px;
  gap: 6px;
}

.prp-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(22, 163, 74, 0.07);
  border: 1.5px solid rgba(22, 163, 74, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: rgba(22, 163, 74, 0.45);
  margin-bottom: 8px;
}

.prp-empty-title {
  font-size: 16px;
  font-weight: 800;
  color: #1a3d2b;
  letter-spacing: -0.3px;
}

.prp-empty-hint {
  font-size: 12.5px;
  color: #7aaa8a;
  line-height: 1.55;
  max-width: 240px;
  margin-top: 2px;
}

.prp-empty .prp-btn-primary {
  width: 100%;
  max-width: 260px;
  padding: 13px 20px;
  border-radius: 50px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: 'Noto Sans Thai', 'Noto Sans', sans-serif;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  box-shadow: 0 8px 24px rgba(22, 163, 74, 0.32);
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.prp-empty .prp-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(22, 163, 74, 0.44);
}

.prp-empty .prp-btn-ghost {
  width: 100%;
  max-width: 260px;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'Noto Sans Thai', 'Noto Sans', sans-serif;
  border: 1.5px solid rgba(22, 163, 74, 0.25);
  cursor: pointer;
  background: #ffffff;
  color: #16a34a;
  transition: all 0.22s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  gap: 6px;
}

.prp-empty .prp-btn-ghost:hover {
  background: #f0fdf4;
  border-color: #22c55e;
  transform: translateY(-1px);
}

/* Hide Next.js Dev Indicator ("N" logo) */
nextjs-portal,
#nextjs-portal,
[data-nextjs-dialog-overlay] {
  display: none !important;
}

/* ════════════════════════════════════════════════════════════════════════════
   ▌ REDESIGN v3 — Balanced & Premium
   ════════════════════════════════════════════════════════════════════════════ */

/* ── Shell background ──────────────────────────────────────────────────── */
.mds-shell {
  background: #edf7f2 !important;
}

/* ── Panel: clean white with subtle green gradient top ─────────────────── */
.mds-panel-side {
  width: 44% !important;
  max-width: 540px !important;
  min-width: 380px !important;
  background: #ffffff !important;
  border-left: 1px solid rgba(22,163,74,0.1) !important;
  box-shadow: -8px 0 48px rgba(0,0,0,0.07) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  position: relative !important;
}

/* top gradient bar */
.mds-panel-side::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 4px !important;
  background: linear-gradient(90deg,#16a34a,#22c55e,#4ade80) !important;
  z-index: 30 !important;
}

/* ── Stepper — centered, balanced ─────────────────────────────────────── */
.mds-stepper {
  display: flex !important;
  align-items: center !important;
  padding: 20px 20px 16px 20px !important;
  background: #ffffff !important;
  border-bottom: 1px solid rgba(22,163,74,0.08) !important;
  position: relative !important;
  flex-shrink: 0 !important;
  gap: 10px !important;
}

/* Row holding the 3 steps + the track */
.mds-steps-row {
  flex: 1 !important;
  display: flex !important;
  align-items: flex-start !important;
  position: relative !important;
  gap: 0 !important;
  max-width: 100% !important;
  margin: 0 !important;
}

/* Track: spans from centre of step-1 to centre of step-3 */
.mds-stepper-track {
  display: block !important;
  position: absolute !important;
  top: 22px !important;
  left: calc(100% / 6) !important;
  right: calc(100% / 6) !important;
  height: 2px !important;
  background: #e9f5ee !important;
  border-radius: 99px !important;
  overflow: visible !important;
  z-index: 0 !important;
  pointer-events: none !important;
}

.mds-stepper-fill {
  display: block !important;
  height: 100% !important;
  background: linear-gradient(90deg,#16a34a,#22c55e) !important;
  border-radius: 99px !important;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1) !important;
  position: relative !important;
}

/* Glow dot at end of fill */
.mds-stepper-fill::after {
  content: '' !important;
  position: absolute !important;
  right: -1px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 6px !important;
  height: 6px !important;
  border-radius: 50% !important;
  background: #22c55e !important;
  box-shadow: 0 0 0 3px rgba(34,197,94,0.2) !important;
  display: none !important;
}

/* Step column */
.mds-step {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 8px !important;
  flex: 1 !important;
  position: relative !important;
  z-index: 1 !important;
}

/* Kill old ::after connectors */
.mds-step::after,
.mds-step:last-of-type::after {
  display: none !important;
  content: none !important;
}

/* Circle */
.mds-step-circle {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  border: 2px solid #dde8e2 !important;
  background: #f8fdf9 !important;
  color: #aac4b4 !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  z-index: 2 !important;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1) !important;
  box-shadow: none !important;
}

.mds-step.active .mds-step-circle {
  background: linear-gradient(135deg,#16a34a,#22c55e) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 5px rgba(22,163,74,0.12), 0 6px 18px rgba(22,163,74,0.3) !important;
  transform: scale(1.1) !important;
}

.mds-step.done .mds-step-circle {
  background: #f0fdf4 !important;
  border-color: #22c55e !important;
  color: #16a34a !important;
  box-shadow: none !important;
  transform: scale(1) !important;
}

/* Labels */
.mds-step-label {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #aac4b4 !important;
  white-space: nowrap !important;
  letter-spacing: 0.1px !important;
  transition: all 0.25s !important;
  line-height: 1 !important;
}

.mds-step.active .mds-step-label {
  color: #16a34a !important;
  font-weight: 800 !important;
}

.mds-step.done .mds-step-label {
  color: #4ade80 !important;
}

/* Close button in stepper */
.mds-panel-close-btn,
.mds-panel-close-inline {
  flex-shrink: 0 !important;
  width: 34px !important;
  height: 34px !important;
  border-radius: 50% !important;
  background: #f8f8f8 !important;
  border: 1.5px solid #e5e7eb !important;
  color: #9ca3af !important;
  font-size: 15px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.22s ease !important;
  position: static !important;
  transform: none !important;
  margin-left: 4px !important;
  margin-right: 0 !important;
}

.mds-panel-close-btn:hover,
.mds-panel-close-inline:hover {
  background: #fee2e2 !important;
  border-color: #fca5a5 !important;
  color: #ef4444 !important;
  transform: rotate(90deg) scale(1.08) !important;
}

/* ── Panel Body ─────────────────────────────────────────────────────────── */
.mds-panel-body {
  flex: 1 !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  padding: 20px !important;
  background: #f9fdfb !important;
}

.mds-panel-body::-webkit-scrollbar { width: 4px !important; }
.mds-panel-body::-webkit-scrollbar-thumb {
  background: rgba(22,163,74,0.18) !important;
  border-radius: 4px !important;
}

/* ── Step 1 ─────────────────────────────────────────────────────────────── */
.mds-s1 {
  padding: 0 !important;
}

.mds-s1-card {
  background: #ffffff !important;
  border-radius: 20px !important;
  padding: 24px 22px 22px !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06) !important;
  border: 1px solid rgba(22,163,74,0.09) !important;
  animation: v3CardIn 0.35s cubic-bezier(0.4,0,0.2,1) !important;
  max-width: 100% !important;
  margin: 0 !important;
}

@keyframes v3CardIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.mds-s1-hd {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  margin-bottom: 20px !important;
  gap: 12px !important;
}

.mds-s1-num {
  display: none !important;
}

.mds-section-tag {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  background: rgba(22,163,74,0.08) !important;
  border: 1px solid rgba(22,163,74,0.18) !important;
  color: #15803d !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  padding: 3px 10px !important;
  border-radius: 50px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  margin-bottom: 8px !important;
}

.mds-s1-title {
  font-size: 24px !important;
  font-weight: 900 !important;
  color: #0d2318 !important;
  letter-spacing: -0.5px !important;
  line-height: 1.2 !important;
  margin: 0 0 6px !important;
  background: none !important;
  -webkit-text-fill-color: unset !important;
}

.mds-s1-sub {
  font-size: 15px !important;
  color: #7aaa8a !important;
  margin: 0 !important;
  line-height: 1.6 !important;
}

/* ── Method Toggle ─────────────────────────────────────────────────────── */
.mds-method-toggle {
  display: flex !important;
  background: #f1f5f2 !important;
  border-radius: 14px !important;
  padding: 4px !important;
  gap: 4px !important;
  margin-bottom: 18px !important;
}

.mds-mtab {
  flex: 1 !important;
  padding: 10px 12px !important;
  border: none !important;
  border-radius: 11px !important;
  background: transparent !important;
  font-family: 'Noto Sans Thai','Noto Sans',sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #6b8f78 !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
}

.mds-mtab:hover:not(.active) {
  background: rgba(22,163,74,0.06) !important;
  color: #15803d !important;
}

.mds-mtab.active {
  background: #ffffff !important;
  color: #15803d !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08) !important;
}

.mds-mtab i { font-size: 15px !important; }

/* ── Info note ─────────────────────────────────────────────────────────── */
.mds-instr-note {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  background: linear-gradient(135deg,rgba(22,163,74,0.06),rgba(34,197,94,0.04)) !important;
  border: 1px solid rgba(22,163,74,0.15) !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #15803d !important;
  margin-bottom: 16px !important;
  line-height: 1.5 !important;
}

.mds-instr-note i {
  color: #22c55e !important;
  font-size: 16px !important;
  flex-shrink: 0 !important;
}

/* ── Instruction list ──────────────────────────────────────────────────── */
.mds-instr-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 0 20px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  counter-reset: instr !important;
  position: relative !important;
}

/* Vertical connector line */
.mds-instr-list::before {
  content: '' !important;
  position: absolute !important;
  left: 14px !important;
  top: 28px !important;
  bottom: 14px !important;
  width: 1px !important;
  background: linear-gradient(180deg,rgba(22,163,74,0.25),rgba(22,163,74,0.04)) !important;
  pointer-events: none !important;
}

.mds-instr-list li {
  counter-increment: instr !important;
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  font-size: 15px !important;
  color: #3d5c4a !important;
  line-height: 1.55 !important;
  padding: 9px 0 !important;
  background: none !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  position: relative !important;
  transition: color 0.2s !important;
}

.mds-instr-list li::before {
  content: counter(instr) !important;
  flex-shrink: 0 !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  border-radius: 50% !important;
  background: #ffffff !important;
  border: 2px solid rgba(22,163,74,0.22) !important;
  color: #16a34a !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  z-index: 1 !important;
  transition: all 0.2s !important;
  box-shadow: 0 2px 8px rgba(22,163,74,0.1) !important;
}

.mds-instr-list li:hover { color: #0d2318 !important; }
.mds-instr-list li:hover::before {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(22,163,74,0.28) !important;
}
.mds-instr-list li strong { color: #16a34a !important; }

/* ── Action content ────────────────────────────────────────────────────── */
.mds-action-content { margin-bottom: 4px !important; }

/* ── Draw hint ─────────────────────────────────────────────────────────── */
.mds-draw-hint {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 12px 14px !important;
  background: linear-gradient(135deg,#f0fdf4,#dcfce7) !important;
  border: 1px solid rgba(22,163,74,0.22) !important;
  border-radius: 14px !important;
  color: #15803d !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  margin-top: 0 !important;
  animation: v3CardIn 0.3s ease !important;
  line-height: 1.5 !important;
}

/* ── Success box ───────────────────────────────────────────────────────── */
.mds-success-box {
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 14px 16px !important;
  background: linear-gradient(135deg,rgba(22,163,74,0.07),rgba(34,197,94,0.04)) !important;
  border: 1.5px solid rgba(22,163,74,0.22) !important;
  border-radius: 16px !important;
  margin-bottom: 14px !important;
  animation: v3CardIn 0.35s ease !important;
}

.mds-success-icon {
  width: 44px !important;
  height: 44px !important;
  border-radius: 50% !important;
  background: linear-gradient(135deg,#16a34a,#22c55e) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 22px !important;
  color: #fff !important;
  flex-shrink: 0 !important;
  box-shadow: 0 6px 18px rgba(22,163,74,0.32) !important;
}

.mds-success-text strong {
  display: block !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  color: #0d2318 !important;
  margin-bottom: 3px !important;
}

.mds-success-text span {
  font-size: 14px !important;
  color: #6b8f78 !important;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.mds-btn {
  width: 100% !important;
  padding: 13px 20px !important;
  border-radius: 14px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  font-family: 'Noto Sans Thai','Noto Sans',sans-serif !important;
  border: none !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1) !important;
  margin-bottom: 10px !important;
  letter-spacing: 0.15px !important;
}

.mds-btn:disabled { opacity: 0.4 !important; cursor: not-allowed !important; }

.mds-btn-solid {
  background: linear-gradient(135deg,#16a34a 0%,#22c55e 100%) !important;
  color: #fff !important;
  box-shadow: 0 6px 20px rgba(22,163,74,0.3) !important;
}
.mds-btn-solid:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 28px rgba(22,163,74,0.42) !important;
}

.mds-btn-soft {
  background: #ffffff !important;
  color: #16a34a !important;
  border: 1.5px solid rgba(22,163,74,0.22) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04) !important;
}
.mds-btn-soft:hover:not(:disabled) {
  background: #f0fdf4 !important;
  border-color: #22c55e !important;
  transform: translateY(-1px) !important;
}

.mds-btn-danger {
  background: linear-gradient(135deg,#ef4444,#dc2626) !important;
  color: #fff !important;
  box-shadow: 0 6px 18px rgba(239,68,68,0.25) !important;
}
.mds-btn-danger:hover:not(:disabled) {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 26px rgba(239,68,68,0.38) !important;
}

.mds-btn-link-danger {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  width: 100% !important;
  padding: 6px !important;
  background: none !important;
  border: none !important;
  color: rgba(200,53,53,0.65) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  transition: color 0.18s !important;
}
.mds-btn-link-danger:hover { color: #dc2626 !important; }

/* ── Dropzone ──────────────────────────────────────────────────────────── */
.mds-dropzone {
  border: 2px dashed rgba(22,163,74,0.22) !important;
  border-radius: 16px !important;
  padding: 28px 16px 22px !important;
  text-align: center !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  background: rgba(22,163,74,0.02) !important;
  margin-bottom: 14px !important;
  user-select: none !important;
}
.mds-dropzone:hover,
.mds-dropzone.drag-over {
  border-color: #22c55e !important;
  background: rgba(22,163,74,0.05) !important;
  transform: scale(1.01) !important;
}
.mds-dropzone.has-file {
  border-style: solid !important;
  border-color: #22c55e !important;
  background: rgba(22,163,74,0.04) !important;
}

/* ── Results container ─────────────────────────────────────────────────── */
.mds-results-container {
  background: #ffffff !important;
  border-radius: 20px !important;
  padding: 20px !important;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06) !important;
  border: 1px solid rgba(22,163,74,0.08) !important;
  animation: v3CardIn 0.35s ease !important;
  max-width: 100% !important;
  margin: 0 !important;
}

.mds-results-container .prp-shell {
  padding: 0 !important;
  margin-top: 0 !important;
  border-top: none !important;
}

/* ── Mobile v3 ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .mds-panel-side {
    width: 100% !important;
    min-width: unset !important;
    max-width: unset !important;
    border-left: none !important;
    margin-top: -24px !important;
    border-radius: 24px 24px 0 0 !important;
  }
  .mds-step-circle {
    width: 36px !important;
    height: 36px !important;
    font-size: 16px !important;
  }
  .mds-stepper-track { top: 18px !important; }
  .mds-step-label { font-size: 13px !important; }
  .mds-stepper { padding: 44px 14px 12px !important; }
  .mds-s1-title { font-size: 20px !important; }
  .mds-s1-sub { font-size: 14px !important; }
  .mds-instr-list li { font-size: 15px !important; }
  .mds-instr-note { font-size: 14px !important; }
  .mds-mtab { font-size: 14px !important; }
}

/* ── Desktop center constraint ─────────────────────────────────────────── */
@media (min-width: 769px) {
  .mds-steps-row { max-width: 100% !important; margin: 0 !important; }
  .mds-s1-card, .mds-results-container { max-width: 100% !important; margin: 0 !important; }
}

/* ════════════════════════════════════════════════════════════════════════════
   ▌ PANEL TOPBAR — Brand header above the stepper
   ════════════════════════════════════════════════════════════════════════════ */
.mds-panel-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 14px;
  background: linear-gradient(135deg, #ffffff 0%, #f6fdf9 100%);
  border-bottom: 1px solid rgba(22,163,74,0.08);
  flex-shrink: 0;
  gap: 10px;
  position: relative;
  z-index: 2;
  margin-top: 4px; /* clears the ::before gradient bar */
}

.mds-panel-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mds-panel-topbar-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(22,163,74,0.12), rgba(34,197,94,0.07));
  border: 1px solid rgba(22,163,74,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #16a34a;
  flex-shrink: 0;
}

.mds-panel-topbar-title {
  font-size: 15px;
  font-weight: 800;
  color: #0d2318;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.mds-panel-topbar-sub {
  font-size: 12px;
  color: #7aaa8a;
  margin-top: 2px;
  line-height: 1;
}

.mds-panel-topbar-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f3f4f6;
  border: 1.5px solid #e5e7eb;
  color: #9ca3af;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.22s ease;
}

.mds-panel-topbar-close:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #ef4444;
  transform: rotate(90deg) scale(1.08);
}

/* Stepper — sits directly below topbar, no padding-top needed */
.mds-stepper {
  padding: 14px 20px 12px 20px !important;
}

/* Mobile: extra space for drag handle */
@media (max-width: 768px) {
  .mds-panel-topbar {
    padding-top: 44px; /* room for drag handle */
    border-radius: 24px 24px 0 0;
  }
  .mds-panel-topbar-title { font-size: 14px; }
  .mds-panel-topbar-sub { font-size: 12px; }
}

/* Desktop: hide the "finish draw" button — users can double-click or click first point */
@media (min-width: 769px) {
  .mds-finish-btn-mobile {
    display: none !important;
  }
}
/* -- Area Validation Popup -- */
.mds-area-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 45, 28, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
  animation: mdsFadeIn 0.3s ease;
}

.mds-area-popup {
  background: #ffffff;
  width: 100%;
  max-width: 400px;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  padding: 30px;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: mdsSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mds-area-popup-icon {
  width: 64px;
  height: 64px;
  background: #fff5f5;
  color: #ef4444;
  font-size: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  border: 4px solid #fff;
  box-shadow: 0 8px 20px rgba(239, 68, 68, 0.15);
}

.mds-area-popup-content h3 {
  font-size: 22px;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 12px;
  font-family: inherit;
}

.mds-area-popup-content p {
  font-size: 15px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 16px;
  font-family: inherit;
}

.mds-area-popup-hint {
  font-size: 14px;
  color: #ef4444;
  background: #fff5f5;
  padding: 8px 12px;
  border-radius: 10px;
  display: inline-block;
  font-weight: 600;
  font-family: inherit;
}

.mds-area-popup-close {
  width: 100%;
  margin-top: 24px;
  background: linear-gradient(135deg, #2d9e5f, #0d9488);
  color: #fff;
  border: none;
  padding: 12px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.mds-area-popup-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(45, 158, 95, 0.3);
}

@keyframes mdsFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes mdsSlideUp { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* Responsive adjustments */
@media (max-width: 768px) {
  .mds-area-popup {
    padding: 24px 20px;
    border-radius: 20px;
    max-width: 320px;
  }
  .mds-area-popup-icon {
    width: 52px;
    height: 52px;
    font-size: 24px;
  }
  .mds-area-popup-content h3 {
    font-size: 20px;
  }
  .mds-area-popup-content p {
    font-size: 15px;
  }
}

