/* South American Luxe - Altitude planner ([sal_altitude_planner]). */

.sal-alt {
  --alt-ok: #2E7D5B;
  --alt-note: #3B6EA5;
  --alt-care: #C98A1B;
  --alt-high: #B3261E;
  margin: 8px 0 40px;
  padding: 24px;
  background: #FAF7F2;
  border: 1px solid rgba(197, 168, 128, 0.35);
  border-radius: var(--sal-radius-lg, 16px);
  font-size: 0.98rem;
  line-height: 1.55;
  text-align: left;
}

.sal-alt-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.sal-alt-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #200A01;
}

.sal-alt select,
.sal-alt input[type="number"] {
  min-height: 44px;
  padding: 8px 12px;
  font: inherit;
  color: var(--sal-text-dark, #141A1B);
  background: #FFFFFF;
  border: 1px solid #CFC6B8;
  border-radius: var(--sal-radius-md, 8px);
}

.sal-alt-route {
  width: min(100%, 460px);
}

.sal-alt-units {
  display: inline-flex;
  border: 1px solid #CFC6B8;
  border-radius: var(--sal-radius-full, 9999px);
  overflow: hidden;
  background: #FFFFFF;
}

.sal-alt-unit {
  min-height: 40px;
  padding: 6px 16px;
  font: inherit;
  font-size: 0.88rem;
  color: var(--sal-text-body, #3A4547);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.sal-alt-unit.is-active {
  color: #FFFFFF;
  background: #4A011E;
}

/* Stops */
.sal-editorial-prose .sal-alt-stops,
.sal-alt-stops {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.sal-alt-stop {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px !important;
  padding: 8px 10px;
  background: #FFFFFF;
  border: 1px solid #E6E2D8;
  border-radius: var(--sal-radius-md, 8px);
}

.sal-alt-stop::marker {
  content: none;
}

.sal-alt-stop-num {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: #C5A880;
  color: #200A01;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
}

.sal-alt-place {
  flex: 1 1 220px;
  min-width: 0;
}

.sal-alt-nights {
  width: 72px;
}

.sal-alt-nights-lbl {
  min-width: 3.4em;
  color: var(--sal-text-muted, #727F83);
  font-size: 0.9rem;
}

.sal-alt-stop-actions {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}

.sal-alt-btn-icon {
  width: 40px;
  height: 40px;
  font-size: 1.1rem;
  line-height: 1;
  color: #4A011E;
  background: #FFFFFF;
  border: 1px solid #E6E2D8;
  border-radius: var(--sal-radius-md, 8px);
  cursor: pointer;
}

.sal-alt-btn-icon:disabled {
  opacity: 0.35;
  cursor: default;
}

.sal-alt-add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.sal-alt-btn {
  min-height: 44px;
  padding: 8px 18px;
  font: inherit;
  font-weight: 600;
  color: #FFFFFF;
  background: #4A011E;
  border: 1px solid #4A011E;
  border-radius: var(--sal-radius-full, 9999px);
  cursor: pointer;
}

.sal-alt-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.sal-alt-btn-ghost {
  color: #4A011E;
  background: transparent;
}

.sal-alt-share-msg {
  font-size: 0.88rem;
  color: var(--alt-ok);
  word-break: break-all;
}

.sal-alt button:focus-visible,
.sal-alt select:focus-visible,
.sal-alt input:focus-visible {
  outline: 3px solid #C5A880;
  outline-offset: 2px;
}

.sal-alt-assume {
  margin: 12px 0 20px !important;
  font-size: 0.88rem;
  color: var(--sal-text-muted, #727F83);
}

/* Results */
.sal-alt-verdict {
  margin: 0 0 14px !important;
  padding: 12px 16px;
  border-left: 4px solid var(--alt-ok);
  background: #FFFFFF;
  border-radius: 0 var(--sal-radius-md, 8px) var(--sal-radius-md, 8px) 0;
  font-weight: 600;
  color: #200A01;
}

.sal-alt-verdict.is-note { border-left-color: var(--alt-note); }
.sal-alt-verdict.is-care { border-left-color: var(--alt-care); }
.sal-alt-verdict.is-high { border-left-color: var(--alt-high); }

.sal-alt-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.sal-alt-stats div {
  padding: 12px 14px;
  background: #FFFFFF;
  border: 1px solid #E6E2D8;
  border-radius: var(--sal-radius-md, 8px);
}

.sal-alt-stats dt {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--sal-text-muted, #727F83);
}

.sal-alt-stats dd {
  margin: 4px 0 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: #200A01;
  font-variant-numeric: tabular-nums;
}

.sal-alt-stats dd small {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sal-text-body, #3A4547);
}

.sal-alt-chart-wrap {
  margin: 0 0 18px;
  padding: 12px 12px 8px;
  background: #FFFFFF;
  border: 1px solid #E6E2D8;
  border-radius: var(--sal-radius-md, 8px);
}

.sal-alt-chart svg {
  display: block;
  width: 100%;
  height: auto;
}

.sal-alt-grid { stroke: #EEE8DE; stroke-width: 1; }
.sal-alt-ref { stroke: #4A011E; stroke-width: 1.2; stroke-dasharray: 5 4; }
.sal-alt-ref-lbl { fill: #4A011E; font-size: 11px; font-weight: 600; paint-order: stroke; stroke: #FFFFFF; stroke-width: 4px; stroke-linejoin: round; }
.sal-alt-axis { fill: #727F83; font-size: 11px; font-variant-numeric: tabular-nums; }

.sal-alt-bar.is-ok { fill: var(--alt-ok); }
.sal-alt-bar.is-note { fill: var(--alt-note); }
.sal-alt-bar.is-care { fill: var(--alt-care); }
.sal-alt-bar.is-high { fill: var(--alt-high); }

.sal-alt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--sal-text-body, #3A4547);
}

.sal-alt-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: baseline;
  background: var(--alt-ok);
}

.sal-alt-dash {
  display: inline-block;
  width: 18px;
  margin-right: 6px;
  border-top: 2px dashed #4A011E;
  vertical-align: middle;
}

.sal-alt-dot.is-note { background: var(--alt-note); }
.sal-alt-dot.is-care { background: var(--alt-care); }
.sal-alt-dot.is-high { background: var(--alt-high); }

.sal-editorial-prose .sal-alt-table {
  margin-bottom: 14px;
  background: #FFFFFF;
}

.sal-alt-table td small {
  display: block;
  margin-top: 2px;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--sal-text-muted, #727F83);
  white-space: normal;
}

.sal-editorial-prose .sal-alt-table tbody td:first-child {
  border-left: 4px solid var(--alt-ok);
  font-variant-numeric: tabular-nums;
}

.sal-editorial-prose .sal-alt-table tr.is-note td:first-child { border-left-color: var(--alt-note); }
.sal-editorial-prose .sal-alt-table tr.is-care td:first-child { border-left-color: var(--alt-care); }
.sal-editorial-prose .sal-alt-table tr.is-high td:first-child { border-left-color: var(--alt-high); }

.sal-alt-table td:nth-child(3) {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sal-alt-tour-link {
  margin: 0 !important;
  font-size: 0.92rem;
}

@media (max-width: 640px) {
  .sal-alt {
    padding: 16px 12px;
    margin-left: -4px;
    margin-right: -4px;
  }

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

  .sal-alt-place {
    flex-basis: calc(100% - 40px);
  }

  .sal-alt-stop-actions {
    margin-left: auto;
  }

  /* The night table becomes one card per night. */
  .sal-editorial-prose .sal-alt-table {
    display: block;
    overflow: visible;
    background: transparent;
  }

  .sal-alt-table thead {
    display: none;
  }

  .sal-alt-table tbody,
  .sal-alt-table tr {
    display: block;
  }

  .sal-alt-table tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2px 10px;
    margin-bottom: 8px;
    padding: 10px 12px;
    background: #FFFFFF !important;
    border: 1px solid #E6E2D8;
    border-left: 4px solid var(--alt-ok);
    border-radius: var(--sal-radius-md, 8px);
  }

  .sal-alt-table tr.is-note { border-left-color: var(--alt-note); }
  .sal-alt-table tr.is-care { border-left-color: var(--alt-care); }
  .sal-alt-table tr.is-high { border-left-color: var(--alt-high); }

  .sal-editorial-prose .sal-alt-table td,
  .sal-editorial-prose .sal-alt-table tbody tr:nth-child(even) td {
    display: block;
    padding: 0;
    border: 0 !important;
    background: transparent;
  }

  .sal-editorial-prose .sal-alt-table td:first-child::before {
    content: "Night ";
    font-weight: 600;
  }

  .sal-alt-table td:nth-child(4) {
    grid-column: 1 / -1;
    margin-top: 4px;
    font-size: 0.9rem;
  }
}
