.path-editor[hidden], .path-editor [hidden], .path-map-workspace [hidden], #path-geometry-details[hidden], #survey-map-error[hidden], #survey-map-unavailable[hidden], #survey-withdrawal-note[hidden], #path-pin-clear[hidden] { display: none !important; }
.path-main-actions, .path-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.path-main-actions { margin-bottom: 12px; }
.path-button { min-height: 44px; border: 1px solid #658b8e; border-radius: 4px; background: #0e323c; color: var(--light); padding: 10px 12px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; line-height: 1.35; }
.path-button:hover:not(:disabled) { background: #214b53; }
.path-button[aria-pressed="true"], .path-primary { background: var(--teal); border-color: var(--teal); color: var(--ink); }
.path-primary:hover:not(:disabled) { background: #88e4da; }
.path-button:disabled { opacity: .45; cursor: default; }
.path-button:focus-visible, .path-editor input:focus-visible, .path-point-fields summary:focus-visible, #path-geometry-details select:focus-visible, .survey-path-map:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.path-danger { color: #ffc3b4; border-color: #aa766c; }
.path-mode-note { font-size: 12px; line-height: 1.65; margin: 8px 0; color: var(--light); }
.survey-path-map { height: 420px; margin: 0; }
.survey-path-map .leaflet-control-zoom a { color: #173a43; }
.survey-path-map .marker-icon { width: 16px; height: 16px; margin: -8px 0 0 -8px; border: 2px solid #045f67; }
.survey-path-map .leaflet-pm-tooltip { max-width: 250px; white-space: normal; }
.path-pin-mode { cursor: crosshair; }
.path-legend { display: flex; flex-wrap: wrap; gap: 5px 17px; margin-top: 10px; font-size: 11px; color: var(--muted); }
.path-legend span { display: inline-flex; align-items: center; gap: 7px; }
.path-key { display: inline-block; width: 22px; border-top: 4px solid #087f89; }
.path-key-reference { border-top: 3px dashed #89999e; }
.path-status { color: var(--teal); font-size: 12px; line-height: 1.6; margin: 15px 0 9px; }
.path-history { margin: 10px 0 18px; }
.path-gpx-panel, .path-pending { border: 1px solid #5d7779; border-radius: 5px; padding: 16px; margin: 14px 0; background: #123c44; }
.path-pending { border-left: 3px solid var(--gold); }
.path-gpx-panel h2, .path-pending h2, .path-sections h2 { font-size: 18px; letter-spacing: -.2px; margin: 0 0 7px; }
.path-gpx-panel ol { margin: 10px 0 17px; padding-left: 20px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.path-gpx-panel li + li { margin-top: 5px; }
.path-gpx-panel .field { margin-bottom: 0; }
.path-phone-help { margin-bottom: 18px; font-size: 12px; }
.path-phone-help summary { cursor: pointer; font-weight: 700; padding-bottom: 6px; }
.path-phone-help p { margin-top: 7px; color: var(--muted); line-height: 1.75; }
.path-phone-help a { color: var(--teal); text-decoration: underline; text-underline-offset: 3px; }
.path-gpx-panel input[type="file"] { max-width: 100%; min-width: 0; font-size: 12px; padding: 10px 6px; }
.path-gpx-panel input::file-selector-button { min-height: 38px; margin-right: 8px; border: 0; border-radius: 3px; background: var(--teal); color: var(--ink); font: inherit; font-weight: 700; padding: 8px 10px; }
.path-pending p, .path-sections > p { color: var(--muted); font-size: 12px; line-height: 1.75; }
.path-pending p + p { margin-top: 6px; }
.path-pending .path-actions { margin-top: 12px; }
.path-draw-actions { padding: 12px; border-left: 3px solid var(--gold); background: #123c44; }
.path-sections { margin: 16px 0; }
.path-sections ol { list-style: none; padding: 0; margin: 12px 0 0; max-height: 400px; overflow-y: auto; }
.path-section-row { border-top: 1px solid var(--line); padding: 12px 0; }
.path-section-row strong { display: inline-block; font-size: 13px; margin-right: 8px; }
.path-section-row small { color: var(--muted); font-size: 11px; }
.path-section-row .path-actions { margin-top: 7px; gap: 6px; }
.path-section-row .path-button { font-size: 11px; padding-inline: 10px; }
.path-trim-panel .field { margin-top: 13px; }
.path-trim-panel input[type="range"] { padding: 0; min-height: 44px; accent-color: var(--teal); }
#path-trim-status { margin-bottom: 10px; }
#path-geometry-details { border-top: 1px solid var(--line); padding-top: 17px; margin-top: 18px; }
.survey-form .consent-field { flex-wrap: wrap; }
.survey-form .consent-field input { flex: 0 0 20px; width: 20px; min-height: 20px; padding: 0; }
.survey-form .consent-field label { flex: 1; min-width: 0; }
.survey-form .consent-field .errorlist { flex: 0 0 100%; }
.geometry-server-errors .errorlist { color: #ffad9c; list-style: none; font-size: 12px; padding: 0; }
.path-point-fields { border-top: 1px solid var(--line); margin: 20px 0 15px; padding-top: 13px; }
.path-point-fields summary { font-size: 12px; font-weight: 700; cursor: pointer; min-height: 36px; }
.path-point-fields .fieldset-note { margin-top: 8px; }
.withdrawal-note { padding: 12px; background: #123c44; border-left: 3px solid var(--gold); }
@media (max-width: 760px) {
  .survey-path-map { height: 350px; }
  .path-main-actions { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .path-main-actions .path-button { width: 100%; }
  .path-draw-actions .path-button { flex: 1 1 110px; }
  .path-gpx-panel, .path-pending { padding: 13px; }
}
@media (max-width: 390px) { .survey-path-map { height: 320px; } }

/* A dedicated map surface keeps touch controls beside the work. The map node
   moves into this dialog, so opening or closing never recreates a drawn line. */
.path-map-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.path-map-heading h2 { font-size: 19px; letter-spacing: -.02em; }
.path-map-heading .path-button { flex: 0 0 auto; }
.path-edit-actions { justify-content: space-between; padding: 8px 0; font-size: 13px; }
.path-trim-control { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 10px; align-items: center; }
.path-trim-control .path-button { padding: 0; font-size: 22px; }
.path-trim-control input { min-width: 0; }
.path-workspace-status { font-size: 12px; color: var(--teal); margin: 8px 0 0; line-height: 1.5; }
.path-map-workspace.path-expanded {
  position: fixed; inset: 0; z-index: 4000;
  width: 100%; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; overflow: hidden;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: var(--night); color: var(--light);
}
.path-expanded .path-map-heading { flex-shrink: 0; margin-bottom: 8px; }
.path-expanded .path-main-actions { flex-shrink: 0; margin-bottom: 4px; }
.path-expanded #path-map-stage { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.path-expanded .survey-path-map { min-height: 100px; height: auto; flex: 1 1 100px; border-radius: 8px; }
.path-expanded .path-mode-note { margin: 6px 0 10px; flex-shrink: 0; font-size: 13px; line-height: 1.5; }
.path-expanded .path-draw-actions { flex-shrink: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; border: 0; gap: 8px; margin: 0; background: transparent; }
.path-expanded .path-draw-actions .path-button { padding: 9px 5px; }
.path-expanded .path-pending { flex-shrink: 0; max-height: 42dvh; overflow-y: auto; margin: 8px 0 0; padding: 12px; }
.path-expanded .path-pending h2 { font-size: 16px; }
.path-expanded .path-pending p { font-size: 12px; line-height: 1.5; }
.path-expanded .path-pending .path-actions { margin-top: 8px; }
.path-expanded .path-trim-panel > p:first-of-type { display: none; }
.path-expanded .path-trim-panel .field { margin: 7px 0; }
.path-expanded .path-trim-panel .field label { margin-bottom: 0; }
.path-expanded #path-trim-status { margin-bottom: 0; }
.path-expanded.is-drawing .path-main-actions,
.path-expanded.is-editing .path-main-actions,
.path-expanded.is-trimming .path-main-actions,
.path-expanded.is-importing .path-main-actions { display: none; }
.path-expanded .path-workspace-status { flex-shrink: 0; }
.path-expanded .form-alert { flex-shrink: 0; max-height: 20dvh; overflow-y: auto; margin-bottom: 8px; }
.survey-error-summary h2 { font-size: 20px; margin-bottom: 8px; }
.survey-error-summary ul { margin-top: 8px; padding-left: 0; font-size: 14px; }
.survey-error-summary li + li { margin-top: 8px; }
.survey-error-summary a { display: block; min-height: 44px; padding-block: 8px; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.survey-error-summary { scroll-margin-top: 125px; font-size: 14px; }
.survey-extra-details { border: 1px solid var(--line); padding: 0 16px 4px; border-radius: 8px; margin: 20px 0; }
.survey-extra-details summary { min-height: 48px; padding: 12px 0; cursor: pointer; font-weight: 700; font-size: 14px; }
.survey-extra-details[open] summary { margin-bottom: 12px; }
.field-required { display: inline-block; color: var(--gold); font-size: 11px; margin: 0 0 6px; }
.survey-skip-map { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin: -10px 0 15px; color: var(--teal); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 760px), (max-height: 540px), (pointer: coarse) {
  .survey-path-map .leaflet-control-zoom a { width: 44px; height: 44px; line-height: 44px; }
  /* Geoman's bundled marker sizes are !important; override those here. */
  .survey-path-map .marker-icon { width: 32px !important; height: 32px !important; margin: -16px 0 0 -16px !important; border-width: 3px; }
  .survey-path-map .marker-icon-middle { width: 24px !important; height: 24px !important; margin: -12px 0 0 -12px !important; }
  .path-point-fields summary, .path-phone-help summary { min-height: 44px; padding-block: 10px; }
  .path-map-heading .path-button { font-size: 12px; }
}
@media (max-height: 540px) and (min-width: 600px) {
  .path-expanded .path-map-heading { margin-bottom: 4px; }
  .path-expanded .path-map-heading h2 { font-size: 16px; }
  .path-expanded #path-map-stage { position: relative; }
  .path-expanded.is-trimming #path-map-stage,
  .path-expanded.is-importing #path-map-stage { padding-right: 310px; }
  .path-expanded .path-pending { position: absolute; right: 0; top: 0; bottom: 0; width: 298px; max-height: none; margin: 0; }
  .path-expanded .path-mode-note { margin: 4px 0; }
  .path-expanded .path-workspace-status { margin-top: 4px; }
  .path-expanded .path-main-actions { display: flex; }
}
