/* SeaVectors Web route planner */
.sv-route-toggle,
.sv-route-panel,
.sv-route-detail,
.sv-route-manager,
.sv-route-toast {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.sv-route-panel[hidden],
.sv-route-detail[hidden],
.sv-route-manager[hidden] {
  display: none !important;
}

.sv-route-toggle {
  position: absolute;
  left: 12px;
  bottom: 74px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #3c4043;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.sv-route-toggle .sv-route-toggle-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 122, 26, 0.14);
  color: #ff7a1a;
}

.sv-route-toggle .sv-route-toggle-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.sv-route-toggle.is-active {
  background: #ff7a1a;
  color: #ffffff;
}

.sv-route-toggle.is-active .sv-route-toggle-icon {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.sv-route-panel {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 6;
  width: min(720px, calc(100vw - 24px));
  color: #111827;
  transform: translateX(-50%);
}

.sv-route-card {
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.10);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.sv-route-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: rgba(17, 24, 39, 0.08);
}

.sv-route-stat {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.88);
}

.sv-route-stat span {
  display: block;
  color: #6f7780;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.sv-route-stat strong {
  display: block;
  margin-top: 3px;
  color: #111827;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1.08;
}

.sv-route-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sv-route-actions::-webkit-scrollbar { display: none; }

.sv-route-actions button,
.sv-route-detail button,
.sv-route-manager button {
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.sv-route-actions button {
  flex: 0 0 auto;
  min-width: 48px;
  height: 40px;
  padding: 0 12px;
  background: transparent;
  color: #3c4043;
}

.sv-route-actions button:hover,
.sv-route-actions button:focus-visible {
  background: rgba(26, 115, 232, 0.09);
  outline: none;
}

.sv-route-actions button:disabled {
  color: #b8b8b8;
  cursor: default;
}

.sv-route-actions button:disabled:hover { background: transparent; }

.sv-route-actions .sv-route-primary {
  background: #1a73e8;
  color: #ffffff;
}

.sv-route-actions .sv-route-accent {
  color: #ff7a1a;
}

.sv-route-actions .sv-route-danger {
  color: #d93025;
}

.sv-route-help {
  margin: 0;
  padding: 0 12px 11px;
  color: #526173;
  font-size: 0.78rem;
  line-height: 1.35;
}


.sv-route-detail {
  position: absolute;
  right: 12px;
  top: 74px;
  z-index: 7;
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100vh - 112px);
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.10);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  color: #111827;
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
}

.sv-route-detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 13px 14px 12px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.sv-route-detail-title {
  min-width: 0;
}

.sv-route-detail-title span {
  display: block;
  margin-bottom: 4px;
  color: #6f7780;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sv-route-detail-title input {
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #111827;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 900;
  line-height: 1.25;
}

.sv-route-detail-title input:focus {
  background: rgba(26, 115, 232, 0.08);
  outline: 2px solid rgba(26, 115, 232, 0.24);
  outline-offset: 2px;
}

.sv-route-detail-close {
  width: 32px;
  height: 32px;
  background: rgba(17, 24, 39, 0.07);
  color: #3c4043;
}

.sv-route-detail-body {
  overflow-y: auto;
  padding: 12px;
}

.sv-route-detail-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 122, 26, 0.12), rgba(26, 115, 232, 0.08));
}

.sv-route-detail-summary span,
.sv-route-detail-metrics span {
  display: block;
  color: #6f7780;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.sv-route-detail-summary small {
  display: block;
  margin-top: 4px;
  color: #526173;
  font-size: 0.78rem;
  font-weight: 750;
}

.sv-route-detail-summary strong {
  color: #ff7a1a;
  font-size: 1.55rem;
  font-weight: 950;
  line-height: 1;
  white-space: nowrap;
}

.sv-route-detail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.sv-route-detail-metrics div {
  padding: 12px;
  border-radius: 13px;
  background: rgba(17, 24, 39, 0.055);
}

.sv-route-detail-metrics strong {
  display: block;
  margin-top: 5px;
  color: #111827;
  font-size: 1rem;
  font-weight: 900;
}

.sv-route-detail-assumption,
.sv-route-detail-meta {
  margin: 8px 2px 0;
  color: #6f7780;
  font-size: 0.76rem;
  line-height: 1.4;
}

.sv-route-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.sv-route-detail-actions button {
  min-height: 36px;
  padding: 0 12px;
  background: rgba(17, 24, 39, 0.065);
  color: #3c4043;
  font-size: 0.8rem;
}

.sv-route-detail-actions button:hover,
.sv-route-detail-actions button:focus-visible {
  background: rgba(26, 115, 232, 0.10);
  outline: none;
}

.sv-route-detail-actions button:disabled {
  color: #b8b8b8;
  cursor: default;
}

.sv-route-detail-actions .sv-route-primary {
  background: #1a73e8;
  color: #ffffff;
}

.sv-route-detail-actions .sv-route-danger {
  color: #d93025;
}

.sv-route-point-section {
  margin-top: 14px;
}

.sv-route-point-section h3 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 0.95rem;
  line-height: 1.2;
}

.sv-route-point-list {
  display: grid;
  gap: 7px;
}

.sv-route-point-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  width: 100%;
  padding: 9px;
  border-radius: 13px;
  background: rgba(17, 24, 39, 0.045);
  color: #111827;
  text-align: left;
}

.sv-route-point-row:hover,
.sv-route-point-row:focus-visible {
  background: rgba(26, 115, 232, 0.085);
  outline: none;
}

.sv-route-point-badge {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #3c4043;
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 950;
}

.sv-route-point-badge.is-endpoint {
  background: #ff7a1a;
}

.sv-route-point-main {
  min-width: 0;
}

.sv-route-point-main strong,
.sv-route-point-main span,
.sv-route-point-main em,
.sv-route-point-main b {
  display: block;
}

.sv-route-point-main strong {
  color: #111827;
  font-size: 0.88rem;
  line-height: 1.25;
}

.sv-route-point-main span {
  margin-top: 2px;
  color: #6f7780;
  font-size: 0.74rem;
  line-height: 1.3;
}

.sv-route-point-main em {
  margin-top: 8px;
  color: #6f7780;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
}

.sv-route-point-main b {
  margin-top: 2px;
  color: #111827;
  font-size: 0.8rem;
  line-height: 1.25;
}

.sv-route-point-empty {
  margin: 0;
  padding: 13px 10px;
  border-radius: 12px;
  background: rgba(17, 24, 39, 0.045);
  color: #6f7780;
  font-size: 0.85rem;
  line-height: 1.4;
}

.sv-route-manager {
  position: absolute;
  right: 12px;
  top: 74px;
  z-index: 6;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - 120px);
  overflow: hidden;
  border: 1px solid rgba(17, 24, 39, 0.10);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

.sv-route-manager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
}

.sv-route-manager-header h2 {
  margin: 0;
  color: #111827;
  font-size: 1rem;
  line-height: 1.2;
}

.sv-route-manager-close {
  width: 32px;
  height: 32px;
  background: rgba(17, 24, 39, 0.07);
  color: #3c4043;
}

.sv-route-list {
  max-height: min(440px, calc(100vh - 190px));
  overflow-y: auto;
  padding: 8px;
}

.sv-route-empty {
  margin: 0;
  padding: 16px 12px;
  color: #6f7780;
  font-size: 0.9rem;
  line-height: 1.45;
}

.sv-route-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px;
  border-radius: 12px;
  color: #111827;
}

.sv-route-row:hover {
  background: rgba(26, 115, 232, 0.07);
}

.sv-route-row:focus-visible {
  background: rgba(26, 115, 232, 0.08);
  outline: 2px solid rgba(26, 115, 232, 0.35);
  outline-offset: 2px;
}

.sv-route-row-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(255, 122, 26, 0.15);
  color: #ff7a1a;
  font-weight: 900;
}

.sv-route-row-main {
  min-width: 0;
  text-align: left;
}

.sv-route-row-main strong {
  display: block;
  overflow: hidden;
  color: #111827;
  font-size: 0.88rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sv-route-row-main span {
  display: block;
  margin-top: 2px;
  color: #6f7780;
  font-size: 0.74rem;
  line-height: 1.25;
}

.sv-route-row-delete {
  width: 34px;
  height: 34px;
  background: transparent;
  color: #d93025;
}

.sv-route-toast {
  position: absolute;
  left: 50%;
  bottom: 112px;
  z-index: 8;
  display: none;
  max-width: calc(100vw - 28px);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.76);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 750;
  transform: translateX(-50%);
}

.sv-route-toast.is-visible { display: block; }

body.sv-route-planning #map { cursor: crosshair; }

.sv-route-marker-label {
  position: absolute;
  z-index: 7;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: #3c4043;
  color: #ffffff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.78rem;
  font-weight: 900;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.sv-route-marker-label.is-endpoint { background: #ff7a1a; }

@media (max-width: 720px) {
  .sv-route-toggle {
    left: 10px;
    bottom: 70px;
    height: 42px;
    padding: 0 11px;
  }

  .sv-route-panel {
    bottom: 10px;
    width: calc(100vw - 18px);
  }

  .sv-route-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sv-route-stat {
    padding: 8px 10px;
  }

  .sv-route-actions {
    padding: 7px;
  }

  .sv-route-actions button {
    height: 38px;
    padding: 0 11px;
  }

  .sv-route-detail,
  .sv-route-manager {
    top: 66px;
    right: 9px;
    width: calc(100vw - 18px);
    max-height: calc(100vh - 86px);
  }

  .sv-route-detail-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .sv-route-detail-summary strong {
    font-size: 1.35rem;
  }

  .sv-route-detail-actions button {
    min-height: 34px;
    padding: 0 10px;
  }

  .sv-route-toast {
    bottom: 156px;
  }
}
