/* =========================================================
   problem-map.css
   ---------------------------------------------------------
   Styling for the Leaflet problem map and its floating UI.
   ========================================================= */

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  overscroll-behavior: none;
}

#mapContainer,
.ima-wrap {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
}

#map {
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

@supports (height: 100dvh) {
  #mapContainer,
  .ima-wrap,
  #map {
    height: 100dvh;
    min-height: 100dvh;
  }
}

.leaflet-container,
.leaflet-container * {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.ima-wrap {
  position: relative;
}

.ima-toggle {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1000;
}

.ima-toggle-list {
  top: 60px;
}

.ima-toggle-accident {
  top: 108px;
}

.ima-toggle-admin {
  top: 156px;
}

.ima-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1100;
  width: 422px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 120px);
  overflow: auto;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
  padding: 14px;
  display: none;
  font-family: Arial, sans-serif;
  color: #1f2937;
}

.ima-panel.open {
  display: block;
}

.ima-add-panel,
.ima-edit-panel,
.ima-list-panel,
.ima-accident-panel,
.ima-admin-panel {
  top: 12px;
}

.ima-panel-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-size: 24px;
  line-height: 24px;
  padding: 0;
}

.ima-panel-close:hover {
  background: #e5e7eb;
  color: #111827;
}

.ima-add-panel,
.ima-edit-panel,
.ima-list-panel,
.ima-accident-panel,
.ima-admin-panel,
.ima-help-panel {
  max-height: calc(100vh - 48px);
}

@supports (height: 100dvh) {
  .ima-add-panel,
  .ima-edit-panel,
  .ima-list-panel,
  .ima-accident-panel,
  .ima-admin-panel,
  .ima-help-panel {
    max-height: calc(100dvh - 48px);
  }
}


.ima-title {
  padding-right: 34px;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 10px 0;
}

.ima-row {
  margin-bottom: 12px;
}

.ima-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}

.ima-input,
.ima-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
}

.ima-textarea {
  min-height: 90px;
  resize: vertical;
}

.ima-help {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.35;
}

.ima-actions,
.ima-actions-small,
.ima-color-filter,
.ima-color-choices {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ima-actions-nowrap {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  align-items: center;
}

.ima-actions-nowrap .ima-btn {
  white-space: nowrap;
}

@media (max-width: 500px) {
  .ima-actions-nowrap {
    flex-wrap: wrap;
  }
}

.ima-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: #1f2937;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.ima-btn:hover,
.ima-color-choice:hover {
  opacity: 0.94;
}

.ima-btn:disabled,
.ima-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(60%);
  box-shadow: none;
}

.ima-btn:disabled:hover,
.ima-btn.disabled:hover {
  opacity: 0.45;
}

.ima-btn.secondary {
  background: #e5e7eb;
  color: #111827;
}

.ima-btn.danger {
  background: #b91c1c;
}

.ima-btn.active {
  background: #0f766e;
}

.ima-pro-dimmed {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(70%);
}

.ima-pro-dimmed:hover {
  opacity: 0.55;
}

.ima-coords {
  font-size: 12px;
  color: #475569;
}

.ima-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ima-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.ima-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.ima-card-text {
  font-size: 13px;
  line-height: 1.35;
  color: #334155;
  margin-bottom: 8px;
  white-space: pre-line;
}

.ima-thumb-grid,
.ima-popup-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.ima-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
}

.ima-thumb img,
.ima-popup-grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ima-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  line-height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  padding: 0;
}

.ima-hidden {
  display: none !important;
}

.ima-popup-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ima-popup-text {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 8px;
  white-space: pre-line;
}


.ima-popup-content {
  box-sizing: border-box;
  max-width: calc(100vw - 72px);
  width: min(360px, calc(100vw - 72px));
}

.ima-popup-actions {
  margin-top: 8px;
}

.leaflet-popup-content {
  max-width: calc(100vw - 72px);
}

.leaflet-popup-content .ima-btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.ima-empty {
  font-size: 13px;
  color: #64748b;
}

.ima-selected-card {
  outline: 2px solid #0f766e;
}

.leaflet-container.ima-add-mode {
  cursor: crosshair;
}

.ima-locate-control {
  width: 42px;
  height: 42px;
  padding: 0;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  cursor: pointer;
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: #111827;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ima-locate-control:hover {
  background: #f8fafc;
}

.ima-locate-control.locating {
  opacity: 0.7;
}

.ima-my-location-pin {
  background: transparent;
  border: 0;
}

.ima-my-location-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2563eb;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.ima-color-choice {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
}

.ima-color-choice.active {
  outline: 2px solid #0f766e;
  background: #f8fafc;
}

.ima-color-choice-label {
  white-space: nowrap;
}

.ima-color-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  vertical-align: middle;
  flex: 0 0 auto;
}

.ima-color-red { background: #dc2626; }
.ima-color-orange { background: #ea580c; }
.ima-color-yellow { background: #ca8a04; }
.ima-color-green { background: #16a34a; }
.ima-color-blue { background: #2563eb; }
.ima-color-purple { background: #9333ea; }
.ima-color-none { background: #94a3b8; }
.ima-color-all {
  background: linear-gradient(
    135deg,
    #dc2626 0%,
    #ea580c 20%,
    #ca8a04 40%,
    #16a34a 60%,
    #2563eb 80%,
    #9333ea 100%
  );
}

.ima-problem-pin-wrap {
  background: transparent;
  border: 0;
}

.ima-problem-pin {
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid #fff;
  box-shadow: 0 0 4px rgba(0,0,0,0.35);
}

.ima-problem-pin span {
  display: inline-block;
  transform: rotate(45deg);
}


.ima-problem-pin-red { background: #dc2626; }
.ima-problem-pin-orange { background: #ea580c; }
.ima-problem-pin-yellow { background: #ca8a04; }
.ima-problem-pin-green { background: #16a34a; }
.ima-problem-pin-blue { background: #2563eb; }
.ima-problem-pin-purple { background: #9333ea; }


/* =========================================================
   Admin panel
   ========================================================= */
.ima-admin-panel {
  width: 420px;
}

.ima-admin-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}


.ima-admin-map-center {
  display: grid;
  grid-template-columns: 1fr 1fr 0.8fr;
  gap: 8px;
}

.ima-admin-map-center .ima-input::placeholder {
  color: #94a3b8;
  opacity: 1;
}


.ima-gpx-upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 6px;
}

.ima-gpx-upload-input {
  flex: 1 1 220px;
  min-width: 0;
}

.ima-gpx-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.ima-gpx-row {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.ima-gpx-info {
  margin-bottom: 8px;
}

.ima-gpx-name {
  font-size: 14px;
  font-weight: 700;
  word-break: break-word;
}

.ima-gpx-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
}

.ima-gpx-actions {
  justify-content: flex-start;
}

/* =========================================================
   Accident report form
   ---------------------------------------------------------
   Accident details are shown only when the Accident checkbox
   is checked. The visual style is intentionally similar to a
   simple Google Forms report: one question block per card.
   ========================================================= */
.ima-accident-label {
  font-weight: 700;
}

.ima-edit-panel,
.ima-add-panel {
  width: 480px;
}

.ima-accident-report {
  margin: 12px 0;
  padding-top: 10px;
  border-top: 2px solid #e5e7eb;
}

.ima-accident-heading {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 10px 0;
}

.ima-accident-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  margin-bottom: 10px;
}

.ima-accident-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.ima-accident-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 1.35;
}

.ima-accident-choice input {
  flex: 0 0 auto;
}

.ima-accident-rating {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
}

.ima-accident-rating .ima-accident-choice {
  flex-direction: column;
  gap: 4px;
  min-width: 44px;
  text-align: center;
}

.ima-accident-other-input {
  margin-top: 10px;
}

.ima-two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 700px) {
  .ima-two-columns {
    grid-template-columns: 1fr;
  }

  .ima-accident-rating {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}


/* =========================================================
   Large image pop-up / lightbox
   ========================================================= */
.ima-thumb-img,
.ima-popup-photo {
  cursor: zoom-in;
}

.ima-popup-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 0;
  padding: 0;
  margin: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}

.ima-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.86);
}

.ima-image-lightbox.open {
  display: flex;
}

.ima-image-lightbox-img {
  max-width: 96vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 10px;
  background: #111827;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.ima-image-lightbox-close {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 5001;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  cursor: pointer;
  font-size: 32px;
  line-height: 42px;
  padding: 0;
}

.ima-image-lightbox-caption {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: 14px;
  color: #ffffff;
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  word-break: break-word;
}

body.ima-lightbox-open {
  overflow: hidden;
}

@media (max-width: 700px) {
  .ima-image-lightbox {
    padding: 10px;
  }

  .ima-image-lightbox-img {
    max-width: 100vw;
    max-height: 86vh;
    border-radius: 6px;
  }
}


/* =========================================================
   Owner message pop-up
   ========================================================= */
.ima-owner-message-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.72);
}

.ima-owner-message-backdrop.open {
  display: flex;
}

.ima-owner-message-dialog {
  position: relative;
  width: min(520px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  box-sizing: border-box;
  border-radius: 16px;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
  padding: 20px;
  font-family: Arial, sans-serif;
}

.ima-owner-message-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #e5e7eb;
  color: #111827;
  cursor: pointer;
  font-size: 26px;
  line-height: 30px;
  padding: 0;
}

.ima-owner-message-close:hover {
  background: #d1d5db;
}

.ima-owner-message-kicker {
  padding-right: 42px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 6px;
}

.ima-owner-message-title {
  padding-right: 42px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 12px;
}

.ima-owner-message-body {
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: #334155;
}

.ima-owner-message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

body.ima-owner-message-open {
  overflow: hidden;
}

@media (max-width: 700px) {
  .ima-owner-message-backdrop {
    padding: 10px;
  }

  .ima-owner-message-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    padding: 16px;
  }
}


/* =========================================================
   Mobile and touch refinements
   ========================================================= */
@media (max-width: 700px) {
  .ima-toggle {
    right: 10px;
  }

  .ima-panel,
  .ima-add-panel,
  .ima-edit-panel,
  .ima-list-panel,
  .ima-accident-panel,
  .ima-admin-panel,
  .ima-help-panel {
    top: 10px;
    left: 10px;
    right: 10px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 20px);
    padding: 12px;
  }

  @supports (height: 100dvh) {
    .ima-panel,
    .ima-add-panel,
    .ima-edit-panel,
    .ima-list-panel,
    .ima-accident-panel,
    .ima-admin-panel,
    .ima-help-panel {
      max-height: calc(100dvh - 20px);
    }
  }

  .ima-toggle-help {
    top: 202px;
  }

  .ima-thumb-grid,
  .ima-popup-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .ima-panel-close,
  .ima-thumb-remove {
    min-width: 44px;
    min-height: 44px;
  }

  .ima-actions-nowrap,
  .ima-popup-actions {
    flex-wrap: wrap;
  }

  .leaflet-popup-content .ima-btn {
    flex: 1 1 calc(50% - 8px);
  }
}

@media (max-width: 380px) {
  .leaflet-popup-content .ima-btn {
    flex-basis: 100%;
  }
}


/* Admin status/debug panel */
.ima-admin-status-section {
  margin-top: 4px;
}

.ima-admin-health {
  margin-top: 6px;
  font-size: 12px;
  color: #334155;
}

.ima-admin-health-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
}

.ima-admin-health-table th,
.ima-admin-health-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 6px 8px;
  vertical-align: top;
  text-align: left;
}

.ima-admin-health-table tr:last-child th,
.ima-admin-health-table tr:last-child td {
  border-bottom: 0;
}

.ima-admin-health-table th {
  width: 34%;
  color: #475569;
  background: #f8fafc;
  font-weight: 700;
}

.ima-admin-health-actions {
  margin-top: 8px;
}

/* =========================================================
   Professional in-app feedback
   ---------------------------------------------------------
   Replaces browser alert()/confirm() popups with branded UI
   that works cleanly in embedded maps and mobile browsers.
   ========================================================= */
.ima-toast-container {
  position: absolute;
  left: 12px;
  bottom: 16px;
  z-index: 2200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(380px, calc(100vw - 24px));
  pointer-events: none;
  font-family: Arial, sans-serif;
}

.ima-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-sizing: border-box;
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
  animation: ima-toast-enter 160ms ease-out;
}

.ima-toast.closing {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 160ms ease-out, transform 160ms ease-out;
}

.ima-toast-success { border-left: 5px solid #16a34a; }
.ima-toast-error { border-left: 5px solid #b91c1c; }
.ima-toast-warning { border-left: 5px solid #ca8a04; }
.ima-toast-info { border-left: 5px solid #2563eb; }

.ima-toast-text {
  flex: 1 1 auto;
  font-size: 13px;
  line-height: 1.35;
  word-break: break-word;
}

.ima-toast-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-size: 22px;
  line-height: 24px;
  padding: 0;
}

.ima-toast-close:hover {
  background: #e5e7eb;
  color: #111827;
}

.ima-confirm-backdrop {
  position: absolute;
  inset: 0;
  z-index: 2300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.35);
  font-family: Arial, sans-serif;
}

.ima-confirm-backdrop.open {
  display: flex;
}

.ima-confirm-dialog {
  width: min(420px, calc(100vw - 36px));
  border-radius: 16px;
  background: #fff;
  color: #1f2937;
  box-shadow: 0 18px 55px rgba(15, 23, 42, 0.32);
  padding: 18px;
  box-sizing: border-box;
  animation: ima-confirm-enter 140ms ease-out;
}

.ima-confirm-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.ima-confirm-message {
  font-size: 14px;
  line-height: 1.45;
  color: #334155;
  margin-bottom: 16px;
  white-space: pre-line;
}

.ima-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

@keyframes ima-toast-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ima-confirm-enter {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 700px) {
  .ima-toast-container {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
  }

  .ima-confirm-backdrop {
    align-items: flex-end;
    padding: 10px;
  }

  .ima-confirm-dialog {
    width: 100%;
  }

  .ima-confirm-actions .ima-btn {
    flex: 1 1 auto;
  }
}

/* =========================================================
   Professional role display
   ---------------------------------------------------------
   Gives customer-facing names to the existing numeric user.type
   permission model.
   ========================================================= */
.ima-role-summary {
  margin: -2px 0 12px 0;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
  color: #1f2937;
}

.ima-role-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  vertical-align: middle;
}

.ima-role-level {
  display: inline-block;
  margin-left: 6px;
  color: #64748b;
  font-size: 12px;
  vertical-align: middle;
}

.ima-role-desc,
.ima-admin-role-desc {
  margin-top: 6px;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

.ima-admin-cap-list {
  margin: 0;
  padding-left: 18px;
}

.ima-admin-cap-list li {
  margin: 0 0 3px 0;
}

/* =========================================================
   Problem workflow: status and priority
   ========================================================= */
.ima-select {
  appearance: auto;
}

.ima-workflow-fields {
  margin-bottom: 2px;
}

.ima-workflow-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px 0;
}

.ima-workflow-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.ima-status-fixed,
.ima-status-verified {
  background: #dcfce7;
  color: #166534;
}

.ima-status-in_progress {
  background: #dbeafe;
  color: #1d4ed8;
}

.ima-status-confirmed {
  background: #fef3c7;
  color: #92400e;
}

.ima-priority-high {
  background: #ffedd5;
  color: #9a3412;
}

.ima-priority-urgent {
  background: #fee2e2;
  color: #991b1b;
}

.ima-workflow-badge-label {
  opacity: 0.78;
  margin-right: 3px;
}

/* =========================================================
   Customer feature flag: Status/Priority workflow fields
   ---------------------------------------------------------
   Admin can turn this off for directory-style maps such as
   accommodations or points of interest.
   ========================================================= */
body.ima-hide-workflow .ima-workflow-fields,
body.ima-hide-workflow .ima-workflow-badges {
  display: none !important;
}

.ima-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14px;
  line-height: 1.35;
  cursor: pointer;
}

.ima-check input {
  flex: 0 0 auto;
  margin-top: 2px;
}

/* =========================================================
   Help / instructions panel
   ========================================================= */
.ima-toggle-help {
  top: 204px;
  min-width: 42px;
  font-size: 19px;
  font-weight: 800;
}

.ima-help-panel {
  width: 420px;
}

.ima-help-intro {
  margin: 0 0 12px 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-size: 13px;
  line-height: 1.4;
}

.ima-help-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 10px;
  margin-top: 10px;
}

.ima-help-section h3 {
  margin: 0 0 5px 0;
  font-size: 14px;
  color: #111827;
}

.ima-help-section p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #334155;
}



/* =========================================================
   Public warnings shared across nearby maps
   ========================================================= */
.ima-public-warning-options {
  padding: 10px;
  border: 1px solid #f59e0b;
  border-radius: 12px;
  background: #fffbeb;
}

.ima-public-warning-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin: 2px 0 8px 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.ima-card-public-warning {
  border-color: #f59e0b;
  background: #fffbeb;
}

.ima-problem-pin-public {
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.28), 0 0 4px rgba(0, 0, 0, 0.35);
}

.ima-problem-pin-public span {
  font-size: 22px;
  line-height: 1;
}

.ima-problem-pin-accident {
  border-color: #111827;
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.24), 0 0 5px rgba(0, 0, 0, 0.42);
}

.ima-problem-pin-accident span {
  font-size: 19px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* Public warnings belong to the Status/Priority workflow. When that workflow
   is disabled for directory/POI-style maps, remove the public-warning UI too. */
body.ima-hide-public-warnings .ima-public-warning-row,
body.ima-hide-public-warnings .ima-public-warning-options,
body.ima-hide-public-warnings .ima-public-warning-badge {
  display: none !important;
}

/* Keep the Help button's mobile position after the global Help styles. */
@media (max-width: 700px) {
  .ima-toggle-help {
    top: 202px;
  }
}

/* Respect users who request reduced motion. The UI remains the same, but
   toast/confirm/lightbox transitions no longer animate. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

/* =========================================================
   Accessibility: reduced motion
   ---------------------------------------------------------
   Respect browser/OS settings for users who prefer less motion.
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }

  .ima-toast,
  .ima-confirm-dialog {
    animation: none !important;
  }
}


/* PinProb i18n: translated action labels can be longer.
   Keep problem-card buttons on a clean wrapped row instead of forcing
   horizontal scrolling on narrow panels. */
.ima-card .ima-actions-nowrap,
.ima-popup-content .ima-actions-nowrap {
  flex-wrap: wrap;
  width: 100%;
  margin-top: 8px;
}

.ima-card .ima-actions-nowrap .ima-btn,
.ima-popup-content .ima-actions-nowrap .ima-btn {
  flex: 0 1 auto;
  max-width: 100%;
  white-space: normal;
}

@media (max-width: 520px) {
  .ima-card .ima-actions-nowrap .ima-btn,
  .ima-popup-content .ima-actions-nowrap .ima-btn {
    flex: 1 1 calc(50% - 8px);
  }
}
