.unloading-location-dialog {
  width: min(820px, 94vw);
  max-width: 820px;
}

.unloading-location-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.unloading-location-form .field input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  min-height: 48px;
}

.unloading-location-actions {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.unloading-location-actions button {
  flex: 1 1 150px;
  min-height: 48px;
}

.unloading-location-status {
  grid-column: 1 / -1;
  display: none;
  margin: -4px 0 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: #edf9f3;
  color: #087f5b;
  line-height: 1.55;
}

.unloading-location-status.show {
  display: block;
}

.unloading-location-status.error {
  background: #fff4e5;
  color: #9a5800;
}

.unloading-address-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
}

.unloading-default-toggle {
  grid-column: 1 / -1;
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid #d7e0e7;
  border-radius: 11px;
  background: #f8fafb;
  cursor: pointer;
  font-weight: 700;
}

.unloading-default-toggle:has(input:checked) {
  border-color: #8fcdb9;
  background: #edf9f3;
  color: #087f5b;
}

.unloading-default-toggle input[type="checkbox"] {
  appearance: auto;
  flex: 0 0 20px;
  width: 20px;
  min-width: 20px;
  height: 20px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  accent-color: var(--green);
}

.unloading-save {
  grid-column: 1 / -1;
  min-height: 50px;
}

.unloading-save:disabled,
.unloading-location-actions button:disabled,
.location-picker-dialog button:disabled {
  cursor: wait;
  opacity: .65;
}

.location-picker-overlay {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 4vh 2vw;
  background: rgba(16, 24, 40, .56);
}

.location-picker-dialog {
  width: min(1040px, 96vw);
  max-width: 1040px;
  height: min(760px, 92vh);
  max-height: 760px;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(16, 24, 40, .28);
}

.location-picker-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  padding: 22px;
  gap: 14px;
}

.location-picker-header,
.location-picker-footer,
.location-picker-search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.location-picker-header {
  justify-content: space-between;
}

.location-picker-header h3,
.location-picker-selected {
  margin: 0;
}

.location-picker-search input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  border: 1px solid #cbd5df;
  border-radius: 10px;
  padding: 10px 13px;
}

.location-picker-main {
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 14px;
}

.location-picker-results {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.location-picker-result {
  width: 100%;
  padding: 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.location-picker-result:hover,
.location-picker-result.active {
  background: #edf9f3;
}

.location-picker-result strong,
.location-picker-result small {
  display: block;
}

.location-picker-result small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.location-picker-map-wrap {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #e9f1ed;
}

.location-picker-map {
  width: 100%;
  height: 100%;
}

.location-picker-center-pin {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translate(-50%, -100%);
  border: 5px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: #e03131;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .3);
  rotate: -45deg;
  pointer-events: none;
}

.location-picker-center-pin::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #fff;
}

.location-picker-map-message {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-content: center;
  padding: 28px;
  text-align: center;
  color: #52657a;
  line-height: 1.7;
  background: linear-gradient(135deg, rgba(233, 241, 237, .94), rgba(216, 232, 224, .94));
}

.location-picker-map-message.hidden {
  display: none;
}

.location-picker-map-wrap > .location-picker-map-message.error {
  inset: auto 16px 16px;
  display: block;
  padding: 10px 14px;
  border: 1px solid #efc67a;
  border-radius: 10px;
  background: rgba(255, 248, 230, .96);
  color: #8a5200;
  box-shadow: 0 6px 18px rgba(16, 24, 40, .15);
}

.location-picker-results > .location-picker-map-message {
  position: static;
  min-height: 100%;
  background: #fff;
}

.location-picker-selected {
  min-height: 48px;
  padding: 11px 14px;
  border-radius: 10px;
  background: #f7f9fb;
  color: #475467;
  line-height: 1.55;
}

.location-picker-selected strong {
  color: var(--ink);
}

.location-picker-footer {
  justify-content: flex-end;
}

.location-picker-footer .location-picker-selected {
  flex: 1;
}

@media (max-width: 760px) {
  .unloading-location-dialog {
    width: 96vw;
    max-width: none;
  }

  .unloading-location-form {
    grid-template-columns: 1fr;
  }

  .unloading-location-status,
  .unloading-default-toggle,
  .unloading-save {
    grid-column: auto;
  }

  .location-picker-dialog {
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    border-radius: 0;
  }

  .location-picker-overlay {
    padding: 0;
  }

  .location-picker-shell {
    padding: 14px;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .location-picker-main {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(260px, 1fr) minmax(120px, .45fr);
  }

  .location-picker-map-wrap {
    min-height: 260px;
    grid-row: 1;
  }

  .location-picker-results {
    grid-row: 2;
  }

  .location-picker-footer {
    align-items: stretch;
    flex-wrap: wrap;
  }

  .location-picker-footer .location-picker-selected {
    flex-basis: 100%;
  }

  .location-picker-footer button {
    flex: 1;
  }
}
