.tuce-location-select-button {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  color: #1f2937;
  text-align: left;
  cursor: pointer;
}

.tuce-location-select-button:hover,
.tuce-location-select-button:focus-visible {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, .12);
  outline: none;
}

.tuce-location-pin {
  position: relative;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  margin: 0 5px 7px 3px;
  border-radius: 50% 50% 50% 0;
  background: #1677ff;
  transform: rotate(-45deg);
  box-shadow: 0 3px 8px rgba(22, 119, 255, .28);
}

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

.tuce-location-select-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tuce-location-select-copy strong,
.tuce-location-select-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tuce-location-select-copy strong {
  color: inherit;
  font-size: 13px;
  font-weight: 600;
}

.tuce-location-select-copy small {
  color: #7a8494;
  font-size: 12px;
}

.tuce-location-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483180;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, .46);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.tuce-location-picker-dialog {
  width: min(520px, calc(100vw - 36px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid #dce2ea;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  box-shadow: 0 18px 46px rgba(15, 23, 42, .2);
  opacity: 0;
  transform: translateY(8px) scale(.99);
  transition: opacity 160ms ease, transform 160ms ease;
}

.tuce-location-picker-dialog.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tuce-location-picker-header,
.tuce-location-picker-footer {
  display: flex;
  align-items: center;
}

.tuce-location-picker-header {
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #edf0f4;
}

.tuce-location-picker-header h2 {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  font-weight: 650;
}

.tuce-location-picker-close {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #667085;
  font-size: 25px;
  line-height: 30px;
  cursor: pointer;
}

.tuce-location-picker-close:hover {
  background: #f2f4f7;
  color: #172033;
}

.tuce-location-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 10px 16px 0;
  padding: 3px;
  border: 1px solid #e4e9f0;
  border-radius: 7px;
  background: #f5f7fa;
}

.tuce-location-tab {
  position: relative;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #667085;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.tuce-location-tab.is-active {
  background: #fff;
  color: #0958d9;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .1);
}

.tuce-location-tab:focus-visible {
  outline: 2px solid rgba(22, 119, 255, .42);
  outline-offset: 1px;
}

.tuce-location-map-shell {
  position: relative;
  height: min(340px, 41vh);
  min-height: 250px;
  margin: 12px 16px 10px;
  overflow: hidden;
  border: 1px solid #dfe5ec;
  border-radius: 6px;
  background: #f2f4f7;
}

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

.tuce-location-map-status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(247, 249, 252, .9);
  color: #667085;
  font-size: 14px;
  text-align: center;
}

.tuce-location-map-status[hidden] {
  display: none;
}

.tuce-location-panels {
  min-height: 126px;
}

.tuce-location-mode-panel[hidden] {
  display: none;
}

.tuce-location-search-panel {
  padding: 0 16px;
}

.tuce-location-search-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 92px;
  gap: 8px;
}

.tuce-location-region-input,
.tuce-location-search-input,
.tuce-location-search-button,
.tuce-location-fallback-button {
  height: 38px;
  border-radius: 4px;
  font: inherit;
}

.tuce-location-region-input,
.tuce-location-search-input {
  min-width: 0;
  padding: 0 11px;
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #172033;
  outline: none;
}

.tuce-location-region-input:focus,
.tuce-location-search-input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, .12);
}

.tuce-location-search-button {
  border: 1px solid #1677ff;
  background: #1677ff;
  color: #fff;
  cursor: pointer;
}

.tuce-location-search-button:disabled {
  border-color: #a9c9f5;
  background: #a9c9f5;
  cursor: wait;
}

.tuce-location-search-status {
  min-height: 27px;
  padding: 7px 2px 4px;
  color: #667085;
  font-size: 12px;
  line-height: 16px;
}

.tuce-location-results {
  display: grid;
  gap: 7px;
  max-height: 190px;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.tuce-location-result {
  position: relative;
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 9px 42px 9px 12px;
  border: 1px solid #e1e6ed;
  border-radius: 6px;
  background: #f8fafc;
  color: #172033;
  text-align: left;
  cursor: pointer;
}

.tuce-location-result:hover,
.tuce-location-result:focus-visible {
  border-color: #91caff;
  background: #f0f7ff;
  outline: none;
}

.tuce-location-result.is-selected {
  border-color: #69b1ff;
  background: #eaf4ff;
  box-shadow: inset 3px 0 0 #1677ff;
}

.tuce-location-result.is-selected::after {
  content: "✓";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #1677ff;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transform: translateY(-50%);
}

.tuce-location-result-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.tuce-location-result-copy strong,
.tuce-location-result-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tuce-location-result-copy strong {
  font-size: 13px;
  line-height: 18px;
}

.tuce-location-result-copy small {
  color: #7a8494;
  font-size: 12px;
  line-height: 16px;
}

.tuce-location-search-state {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border: 1px dashed #cfd7e3;
  border-radius: 6px;
  background: #fafbfc;
  color: #667085;
  font-size: 12px;
}

.tuce-location-search-state.is-error {
  border-style: solid;
  border-color: #ffd591;
  background: #fff9ed;
  color: #7a4a00;
}

.tuce-location-search-state p {
  margin: 0;
  line-height: 18px;
}

.tuce-location-fallback-button {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 11px;
  border: 1px solid #91caff;
  background: #fff;
  color: #0958d9;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tuce-location-fallback-button:hover,
.tuce-location-fallback-button:focus-visible {
  border-color: #1677ff;
  outline: none;
}

.tuce-location-coordinate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 8px;
  padding: 0 16px 8px;
}

.tuce-location-coordinate-input,
.tuce-location-coordinate-button,
.tuce-location-cancel,
.tuce-location-send {
  height: 38px;
  border-radius: 4px;
  font: inherit;
}

.tuce-location-coordinate-input {
  min-width: 0;
  padding: 0 11px;
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #172033;
  outline: none;
}

.tuce-location-coordinate-input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, .12);
}

.tuce-location-coordinate-button,
.tuce-location-send {
  border: 1px solid #1677ff;
  background: #1677ff;
  color: #fff;
  cursor: pointer;
}

.tuce-location-coordinate-button:disabled,
.tuce-location-send:disabled {
  border-color: #a9c9f5;
  background: #a9c9f5;
  cursor: not-allowed;
}

.tuce-location-coordinate-help {
  min-height: 22px;
  padding: 0 16px;
  color: #7a8494;
  font-size: 12px;
  line-height: 20px;
}

.tuce-location-details {
  display: grid;
  gap: 8px;
  padding: 8px 16px 2px;
}

.tuce-location-detail-field {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #344054;
  font-size: 13px;
}

.tuce-location-detail-input {
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d0d5dd;
  border-radius: 4px;
  background: #fff;
  color: #172033;
  font: inherit;
  outline: none;
}

.tuce-location-detail-input:focus {
  border-color: #1677ff;
  box-shadow: 0 0 0 2px rgba(22, 119, 255, .12);
}

.tuce-location-coordinate-picker-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #1677ff;
  font-weight: 600;
  text-decoration: none;
  vertical-align: -3px;
}

.tuce-location-coordinate-picker-link:hover,
.tuce-location-coordinate-picker-link:focus-visible {
  color: #0958d9;
  text-decoration: underline;
  outline: none;
}

.tuce-location-coordinate-picker-icon {
  position: relative;
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  overflow: hidden;
  border-radius: 4px;
  background: linear-gradient(135deg, #20c9b5 0 47%, #1677ff 47% 100%);
  box-shadow: 0 1px 3px rgba(22, 119, 255, .22);
}

.tuce-location-coordinate-picker-icon::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 5px;
  width: 8px;
  height: 8px;
  border: 2px solid #fff;
  border-left-width: 0;
  border-bottom-width: 0;
  transform: rotate(-16deg) skew(-8deg, -8deg);
}

.tuce-location-picker-footer {
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 16px 16px;
}

.tuce-location-cancel,
.tuce-location-send {
  min-width: 88px;
  padding: 0 16px;
}

.tuce-location-cancel {
  border: 1px solid #d0d5dd;
  background: #fff;
  color: #344054;
  cursor: pointer;
}

html[data-tuce-theme-active="dark"] .tuce-location-select-button,
html[data-tuce-theme-active="dark"] .tuce-location-picker-dialog,
html[data-tuce-theme-active="dark"] .tuce-location-coordinate-input,
html[data-tuce-theme-active="dark"] .tuce-location-detail-input,
html[data-tuce-theme-active="dark"] .tuce-location-cancel,
html[data-tuce-theme-active="dark"] .tuce-location-region-input,
html[data-tuce-theme-active="dark"] .tuce-location-search-input,
html[data-tuce-theme-active="dark"] .tuce-location-fallback-button {
  border-color: #414a57;
  background: #252b33;
  color: #d8dee8;
}

html[data-tuce-theme-active="dark"] .tuce-location-picker-header,
html[data-tuce-theme-active="dark"] .tuce-location-coordinate-input {
  border-color: #39414c;
}

html[data-tuce-theme-active="dark"] .tuce-location-select-copy small,
html[data-tuce-theme-active="dark"] .tuce-location-coordinate-help {
  color: #aeb7c5;
}

html[data-tuce-theme-active="dark"] .tuce-location-detail-field {
  color: #c7cfda;
}

html[data-tuce-theme-active="dark"] .tuce-location-tabs {
  border-color: #39414c;
  background: #1f242b;
}

html[data-tuce-theme-active="dark"] .tuce-location-tab {
  color: #aeb7c5;
}

html[data-tuce-theme-active="dark"] .tuce-location-tab.is-active {
  background: #303741;
  color: #69b1ff;
}

html[data-tuce-theme-active="dark"] .tuce-location-result {
  border-color: #414a57;
  background: #292f37;
  color: #d8dee8;
}

html[data-tuce-theme-active="dark"] .tuce-location-result:hover,
html[data-tuce-theme-active="dark"] .tuce-location-result:focus-visible,
html[data-tuce-theme-active="dark"] .tuce-location-result.is-selected {
  border-color: #3c89e8;
  background: #243b53;
}

html[data-tuce-theme-active="dark"] .tuce-location-result-copy small,
html[data-tuce-theme-active="dark"] .tuce-location-search-status {
  color: #aeb7c5;
}

html[data-tuce-theme-active="dark"] .tuce-location-search-state {
  border-color: #4a5563;
  background: #292f37;
  color: #bdc6d3;
}

html[data-tuce-theme-active="dark"] .tuce-location-search-state.is-error {
  border-color: #8a6426;
  background: #3c321f;
  color: #ffd591;
}

html[data-tuce-theme-active="dark"] .tuce-location-coordinate-picker-link {
  color: #69b1ff;
}

html[data-tuce-theme-active="dark"] .tuce-location-map-status {
  background: rgba(37, 43, 51, .92);
  color: #bdc6d3;
}

@media (max-width: 767px) {
  .tuce-location-picker-overlay {
    align-items: start;
    padding: 10px;
  }

  .tuce-location-picker-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .tuce-location-tabs {
    margin-inline: 12px;
  }

  .tuce-location-map-shell {
    height: min(300px, 37dvh);
    min-height: 220px;
    margin-inline: 12px;
  }

  .tuce-location-search-panel {
    padding-inline: 12px;
  }

  .tuce-location-search-row {
    grid-template-columns: 92px minmax(0, 1fr) 76px;
  }

  .tuce-location-results {
    max-height: 168px;
  }

  .tuce-location-coordinate-row {
    grid-template-columns: minmax(0, 1fr) 76px;
    padding-inline: 12px;
  }

  .tuce-location-coordinate-help {
    padding-inline: 12px;
  }

  .tuce-location-details {
    padding-inline: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tuce-location-picker-dialog {
    transition: none;
  }
}
