.appointment-optimizer-form {
  display: grid;
  gap: 14px;
}

.appointment-optimizer-settings-heading,
.appointment-optimizer-summary > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.appointment-optimizer-settings-heading span,
.appointment-optimizer-onetime__heading span {
  color: #a30035;
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.appointment-optimizer-settings-heading h3 {
  margin: 3px 0 0;
  color: #20272e;
  font-size: 1rem;
}

.appointment-optimizer-settings-heading small {
  color: #69747d;
  font-size: .72rem;
}

.appointment-optimizer-duration-control {
  justify-content: flex-start;
  min-height: 76px;
}

.appointment-optimizer-duration-control > div:first-child {
  display: grid;
  gap: 7px;
}

.appointment-optimizer-duration-control > div:first-child > span,
.appointment-optimizer-priority legend,
.appointment-optimizer-onetime__draft label > span {
  color: #59636c;
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.appointment-optimizer-priority {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
  border: 0;
  padding: 0;
}

.appointment-optimizer-priority legend {
  grid-column: 1 / -1;
  margin-bottom: 1px;
}

.appointment-optimizer-priority label {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 66px;
  border: 1px solid #dce2e6;
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
}

.appointment-optimizer-priority label.is-selected {
  border-color: #a30035;
  background: #fff7fa;
  box-shadow: inset 0 0 0 1px #a30035;
}

.appointment-optimizer-priority input {
  position: absolute;
  opacity: 0;
}

.appointment-optimizer-priority svg {
  width: 20px;
  height: 20px;
  color: #7a858e;
}

.appointment-optimizer-priority .is-selected svg {
  color: #a30035;
}

.appointment-optimizer-priority strong,
.appointment-optimizer-priority small {
  display: block;
}

.appointment-optimizer-priority strong {
  color: #20272e;
  font-size: .78rem;
}

.appointment-optimizer-priority small {
  margin-top: 3px;
  color: #6f7a83;
  font-size: .68rem;
  line-height: 1.35;
}

.appointment-optimizer-onetime {
  display: grid;
  gap: 10px;
  border-top: 1px solid #e2e6e9;
  border-bottom: 1px solid #e2e6e9;
  padding: 13px 0;
}

.appointment-optimizer-onetime__heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.appointment-optimizer-onetime__heading p {
  margin: 3px 0 0;
  color: #6f7a83;
  font-size: .7rem;
}

.appointment-optimizer-onetime__heading em {
  align-self: flex-start;
  border-radius: 999px;
  background: #eef1f3;
  padding: 4px 8px;
  color: #58636c;
  font-size: .65rem;
  font-style: normal;
  font-weight: 850;
}

.appointment-optimizer-onetime__draft {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 150px 105px 105px auto;
  align-items: end;
  gap: 8px;
}

.appointment-optimizer-onetime__draft label {
  display: grid;
  gap: 5px;
}

.appointment-optimizer-onetime__draft input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #ccd4da;
  border-radius: 7px;
  background: #fff;
  padding: 8px 10px;
  color: #20272e;
  font: inherit;
  font-size: .74rem;
}

.appointment-optimizer-onetime__draft input:focus {
  border-color: #a30035;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(163, 0, 53, .08);
}

.appointment-optimizer-onetime__draft > button,
.appointment-optimizer-calculate,
.appointment-optimizer-agenda-modal > footer button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #a30035;
  border-radius: 7px;
  background: #fff;
  padding: 0 14px;
  color: #a30035;
  font: inherit;
  font-size: .72rem;
  font-weight: 850;
  cursor: pointer;
}

.appointment-optimizer-onetime__draft button svg,
.appointment-optimizer-calculate svg {
  width: 16px;
  height: 16px;
}

.appointment-optimizer-onetime__draft > button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.appointment-optimizer-onetime__list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.appointment-optimizer-onetime__list > div {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 7px;
  border: 1px solid #e0d2d7;
  border-radius: 7px;
  background: #fff8fa;
  padding: 6px 7px 6px 9px;
  color: #5f2237;
}

.appointment-optimizer-onetime__list > div > svg {
  width: 16px;
  height: 16px;
}

.appointment-optimizer-onetime__list strong,
.appointment-optimizer-onetime__list small {
  display: block;
  font-size: .65rem;
}

.appointment-optimizer-onetime__list button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #8c5467;
  cursor: pointer;
}

.appointment-optimizer-onetime__list button svg {
  width: 14px;
  height: 14px;
}

.appointment-optimizer-calculate {
  justify-self: end;
  min-width: 240px;
  background: #a30035;
  color: #fff;
}

.appointment-optimizer-calculate:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.appointment-optimizer-summary > header > em {
  border: 1px solid #dce3e8;
  border-radius: 999px;
  padding: 5px 9px;
  color: #68737c;
  font-size: .64rem;
  font-style: normal;
  font-weight: 800;
}

.appointment-suggestion footer {
  grid-template-columns: minmax(220px, 1fr);
}

.appointment-optimizer-loading-overlay {
  position: fixed;
  z-index: 10020;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(25, 31, 36, .58);
  padding: 20px;
  backdrop-filter: blur(2px);
}

.appointment-optimizer-loading-dialog {
  display: grid;
  width: min(430px, calc(100vw - 32px));
  justify-items: center;
  gap: 10px;
  border: 1px solid #dfe4e7;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(18, 26, 32, .3);
  padding: 26px 28px 22px;
  text-align: center;
}

.appointment-optimizer-loading-dialog > svg {
  width: 30px;
  height: 30px;
  color: #a30035;
}

.appointment-optimizer-loading-dialog > strong {
  color: #20272e;
  font-size: 1rem;
}

.appointment-optimizer-loading-dialog > p {
  min-height: 34px;
  margin: 0;
  color: #65717a;
  font-size: .76rem;
  line-height: 1.45;
}

.appointment-optimizer-loading-dialog > small {
  color: #a30035;
  font-size: .7rem;
  font-weight: 850;
}

.appointment-optimizer-loading-progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border-radius: 5px;
  background: #e9edf0;
}

.appointment-optimizer-loading-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #a30035;
  transition: width .28s ease;
}

.appointment-suggestion__map-preview {
  position: relative;
  display: block;
  min-height: 174px;
  overflow: hidden;
  border: 1px solid #d7dfe2;
  border-radius: 7px;
  background: #eef3f0;
  padding: 0;
  cursor: default;
}

.appointment-suggestion__map-preview > [data-appointment-optimizer-inline-map] {
  width: 100%;
  height: 174px;
}

.appointment-suggestion__map-preview.is-empty > [data-appointment-optimizer-inline-map] {
  display: grid;
  place-items: center;
  padding: 14px;
  color: #65717a;
  font-size: .7rem;
  font-weight: 750;
  text-align: center;
}

.appointment-suggestion__map-preview.is-empty span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.appointment-suggestion__map-preview.is-empty svg {
  width: 16px;
  height: 16px;
}

.appointment-suggestion__map-preview.is-empty [data-lucide="loader-circle"] {
  animation: appointment-optimizer-spin 1s linear infinite;
}

.appointment-suggestion__map-preview > button {
  position: absolute;
  z-index: 500;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  border: 0;
  background: transparent;
  padding: 8px;
  color: #25313a;
  cursor: zoom-in;
}

.appointment-suggestion__map-preview > button > span {
  border: 1px solid #d6dde0;
  border-radius: 6px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 2px 8px rgba(31, 45, 54, .15);
  padding: 5px 8px;
  font-size: .61rem;
  font-weight: 850;
}

.appointment-suggestion__map-preview > button > svg {
  position: absolute;
  right: 94px;
  bottom: 14px;
  width: 12px;
  height: 12px;
}

.appointment-suggestion__agenda {
  display: inline-flex;
  width: 100%;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #ccd5da;
  border-radius: 7px;
  background: #fff;
  color: #35414a;
  font: inherit;
  font-size: .7rem;
  font-weight: 850;
  cursor: pointer;
}

.appointment-suggestion__agenda:hover,
.appointment-suggestion__agenda:focus-visible {
  border-color: #a30035;
  color: #a30035;
}

.appointment-suggestion__agenda svg {
  width: 15px;
  height: 15px;
}

.appointment-optimizer-route-marker {
  border: 0;
  background: transparent;
}

.appointment-optimizer-route-marker > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #1559b7;
  box-shadow: 0 3px 9px rgba(24, 44, 58, .3);
  color: #fff;
  font-size: .7rem;
  font-weight: 900;
}

.appointment-optimizer-route-marker.is-prospect > span {
  background: #a30035;
}

.appointment-optimizer-route-marker.is-home > span {
  width: 32px;
  height: 32px;
  background: #27333b;
}

.appointment-optimizer-route-marker.is-home svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.appointment-optimizer-route-tooltip {
  border: 1px solid #d6dde0;
  border-radius: 6px;
  box-shadow: 0 3px 10px rgba(24, 39, 49, .14);
  color: #20272e;
  font-size: .7rem;
  font-weight: 850;
}

.appointment-optimizer-agenda-modal .quick-week-slot.is-optimizer-proposal:disabled,
.appointment-optimizer-agenda-modal .quick-week-proposal-legend > span {
  --proposal-color: #2563eb;
  --proposal-rgb: 37, 99, 235;
}

.appointment-optimizer-agenda-modal .quick-week-slot.is-optimizer-proposal:disabled {
  background: rgba(37, 99, 235, .17);
  box-shadow: inset 3px 0 0 #2563eb;
}

.appointment-optimizer-agenda-modal .quick-week-proposal-label {
  color: #164fb7 !important;
}

.appointment-optimizer-agenda-modal .quick-week-proposal-label em {
  font-size: .58rem;
}

.appointment-optimizer-agenda-modal {
  width: min(1180px, calc(100vw - 36px));
  max-height: calc(100dvh - 36px);
}

.appointment-optimizer-agenda-modal > header p {
  margin: 3px 0 0;
  color: #68737c;
  font-size: .72rem;
}

.appointment-optimizer-agenda-modal__planner {
  min-height: 0;
  overflow: auto;
  padding: 14px;
}

.appointment-optimizer-agenda-modal .quick-week-slot.is-optimizer-proposal:disabled {
  z-index: 1;
  cursor: default;
  opacity: 1;
  background: rgba(var(--proposal-rgb), .14);
  box-shadow: inset 3px 0 0 var(--proposal-color);
}

.appointment-optimizer-agenda-modal .quick-week-slot.is-optimizer-proposal.is-proposal-start:disabled {
  border-top: 1px solid rgba(var(--proposal-rgb), .34);
  border-radius: 5px 5px 0 0;
}

.appointment-optimizer-agenda-modal .quick-week-slot.is-optimizer-proposal.is-proposal-end:disabled {
  border-bottom: 1px solid rgba(var(--proposal-rgb), .34);
  border-radius: 0 0 5px 5px;
}

.appointment-optimizer-agenda-modal > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid #e1e6e9;
  padding: 12px 14px;
  color: #68737c;
  font-size: .7rem;
}

@media (max-width: 820px) {
  .appointment-optimizer-settings-heading,
  .appointment-optimizer-summary > header,
  .appointment-optimizer-onetime__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .appointment-optimizer-priority,
  .appointment-optimizer-onetime__draft {
    grid-template-columns: 1fr;
  }

  .appointment-optimizer-calculate,
  .appointment-optimizer-onetime__draft > button {
    width: 100%;
    justify-self: stretch;
  }

  .appointment-suggestion footer {
    grid-template-columns: 1fr;
  }

  .appointment-optimizer-loading-dialog {
    padding: 22px 18px 18px;
  }

  .appointment-optimizer-agenda-modal {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }

  .appointment-optimizer-agenda-modal > footer {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  .appointment-optimizer-loading-progress > span {
    transition: none;
  }
}
