* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

select, input, textarea, button {
  font-family: inherit;
}

/* ---- Site nav ----
   Separate from .header below by design: account-control and page links
   used to live inside .header itself, absolutely positioned over the same
   band as the centered title -- as account-control grew (My Contracts +
   Trip Value + email + Sign out, all at once when signed in) it started
   visually colliding with the title. This bar can grow freely instead. */
.site-nav {
  background: white;
  border-bottom: 1px solid #e0e0e0;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-nav-brand {
  font-weight: 700;
  font-size: 1rem;
  color: #4a148c;
  text-decoration: none;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  flex-wrap: wrap;
}

.site-nav-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-nav-group-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #aaa;
  font-weight: 700;
}

.site-nav-divider {
  width: 1px;
  height: 16px;
  background: #e0e0e0;
}

.site-nav-links a {
  font-size: 0.82rem;
  color: #555;
  text-decoration: none;
  font-weight: 500;
  padding: 2px 0;
  border-bottom: 2px solid transparent;
}

.site-nav-links a:hover { color: #4a148c; }

.site-nav-links a.active {
  color: #4a148c;
  border-bottom-color: #4a148c;
  font-weight: 600;
}

.account-btn, .account-link-btn {
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid #ddd;
  background: #f7f5fa;
  color: #4a148c;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
}

.account-btn:hover, .account-link-btn:hover {
  background: #ece1f7;
  border-color: #4a148c;
}

/* ---- Header ---- */
.header {
  background: linear-gradient(135deg, #1a237e, #4a148c);
  color: white;
  padding: 16px 24px;
  text-align: center;
}

.header h1 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.header .subtitle {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* ---- Controls ---- */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 24px;
  background: white;
  border-bottom: 1px solid #e0e0e0;
  align-items: center;
  justify-content: center;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.control-group label {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 600;
  color: #666;
  letter-spacing: 0.5px;
}

/* ---- Custom Select (styled dropdown for Room Type / Booking Window / Points Year) ---- */
.native-select {
  display: none;
}

.custom-select {
  position: relative;
  min-width: 200px;
  max-width: 360px;
}

.custom-select-narrow {
  min-width: 80px;
  max-width: 120px;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  background: white;
  color: #333;
  cursor: pointer;
  text-align: left;
}

.custom-select-trigger:hover {
  border-color: #b39ddb;
}

.custom-select.open .custom-select-trigger {
  border-color: #4a148c;
  border-radius: 6px 6px 0 0;
  box-shadow: 0 0 0 2px rgba(74, 20, 140, 0.15);
}

.custom-select-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-arrow {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-right: 2px solid #999;
  border-bottom: 2px solid #999;
  transform: rotate(45deg);
  margin-top: -4px;
  transition: transform 0.12s ease;
}

.custom-select.open .custom-select-arrow {
  transform: rotate(-135deg);
  margin-top: 2px;
}

.custom-select-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #4a148c;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.custom-select.open .custom-select-dropdown {
  display: block;
}

.custom-select-option {
  padding: 8px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}

.custom-select-option:last-child {
  border-bottom: none;
}

.custom-select-option:hover {
  background: #f3e5f5;
}

.custom-select-option.selected {
  background: #ede7f6;
  font-weight: 600;
}

/* ---- Searchable Select ---- */
.searchable-select {
  position: relative;
  min-width: 360px;
}

.searchable-select input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
  background: white;
  cursor: pointer;
}

.searchable-select input:focus {
  outline: none;
  border-color: #4a148c;
  box-shadow: 0 0 0 2px rgba(74, 20, 140, 0.15);
  cursor: text;
}

.searchable-select.open input {
  border-radius: 6px 6px 0 0;
}

.searchable-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #4a148c;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 260px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.searchable-dropdown.open {
  display: block;
}

.searchable-option {
  padding: 8px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}

.searchable-option:last-child {
  border-bottom: none;
}

.searchable-option:hover {
  background: #f3e5f5;
}

.searchable-option.active {
  background: #ede7f6;
  font-weight: 600;
}

/* ---- Month Navigation ---- */
.month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 4px 0 2px;
}

.month-nav button {
  background: #4a148c;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}

.month-nav button:hover {
  background: #6a1b9a;
}

.month-nav .month-label {
  font-size: 1rem;
  font-weight: 600;
  min-width: 140px;
  text-align: center;
}

/* ---- Main Layout: Calendar Left, Summary Right ---- */
.main-layout {
  display: flex;
  gap: 20px;
  max-width: 1200px;
  margin: 16px auto;
  padding: 0 16px;
  align-items: flex-start;
}

.calendar-side {
  flex: 1;
  min-width: 0;
}

.summary-side {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 16px;
}

/* ---- Selection Hint ---- */
.selection-hint {
  text-align: center;
  font-size: 0.8rem;
  color: #666;
  padding: 6px 0;
  font-style: italic;
}

.selection-hint .checkin-date {
  font-weight: 600;
  color: #1a237e;
  font-style: normal;
}

/* ---- Calendar ---- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  background: white;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.day-header {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #888;
  padding: 6px 0;
}

.day-cell {
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  position: relative;
  padding: 6px 2px;
  min-height: 54px;
}

.day-cell:hover:not(.empty) {
  transform: scale(1.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1;
}

.day-cell.empty {
  cursor: default;
  background: transparent;
}

.day-body {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.day-cell .day-number {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.6);
}

.day-cell .day-points {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 1px;
}

.day-cell .day-type-label {
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  opacity: 0.6;
  margin-top: 1px;
}

.day-cell .day-topline {
  position: absolute;
  top: 3px;
  left: 4px;
  right: 4px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.day-cell .day-cash {
  font-size: 0.5rem;
  font-weight: 600;
  color: #999;
  letter-spacing: -0.3px;
}

.day-cell .day-crowd {
  position: relative;
  font-size: 0.5rem;
  font-weight: 700;
  line-height: 1;
  padding: 1px 4px;
  border-radius: 999px;
}

/* ---- Crowd level color scale (Undercover Tourist, 1-10) ---- */
.crowd-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
  color: white;
}

.crowd-low { background: #2e7d32; }
.crowd-moderate { background: #f9a825; }
.crowd-busy { background: #ef6c00; }
.crowd-heavy { background: #d84315; }
.crowd-extreme { background: #b71c1c; }

/* ---- Hover Tooltip (generic rich hover card, used by crowd/value/distribution hovers) ---- */
.tooltip-anchor {
  position: relative;
}

.tooltip-card {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 210px;
  background: white;
  color: #333;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  padding: 10px 12px;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.12s ease;
  z-index: 50;
}

.tooltip-card::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-bottom-color: white;
  filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.06));
}

.tooltip-anchor.tooltip-align-left .tooltip-card {
  left: -10px;
  transform: none;
}

.tooltip-anchor.tooltip-align-left .tooltip-card::before {
  left: 18px;
  transform: none;
}

.tooltip-anchor.tooltip-align-right .tooltip-card {
  left: auto;
  right: -10px;
  transform: none;
}

.tooltip-anchor.tooltip-align-right .tooltip-card::before {
  left: auto;
  right: 18px;
  transform: none;
}

.tooltip-anchor:hover .tooltip-card,
.tooltip-anchor:focus .tooltip-card,
.tooltip-anchor:focus-within .tooltip-card {
  opacity: 1;
  visibility: visible;
}

.crowd-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid #eee;
}

.crowd-tooltip-date {
  font-size: 0.78rem;
  font-weight: 700;
  color: #333;
}

.crowd-tooltip-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #777;
  margin-bottom: 8px;
  text-transform: none;
}

.crowd-tooltip-season {
  font-weight: 700;
  color: #2e7d32;
  letter-spacing: 0.5px;
}

.crowd-tooltip-parks {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.park-flag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: #333;
}

.park-flag-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  font-size: 0.58rem;
  font-weight: 700;
  color: white;
}

.park-flag.recommended .park-flag-icon { background: #2e7d32; }
.park-flag.busy .park-flag-icon { background: #ef6c00; }

.park-flag-name {
  flex: 1;
}

.park-flag-tag {
  font-size: 0.58rem;
  font-weight: 600;
  color: #999;
  white-space: nowrap;
}

.crowd-tooltip-empty {
  font-size: 0.65rem;
  color: #999;
  font-style: italic;
}

.crowd-tooltip-footer {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid #f0f0f0;
  font-size: 0.55rem;
  color: #aaa;
  text-align: right;
}

/* ---- Period Tooltip (calendar cell travel-period hover) ---- */
.period-tooltip {
  width: 170px;
}

.period-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.period-tooltip-date {
  font-size: 0.72rem;
  font-weight: 700;
  color: #333;
}

.period-tooltip-pill {
  font-size: 0.62rem;
  font-weight: 700;
  color: white;
  padding: 2px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.period-tooltip-sub {
  margin-top: 5px;
  font-size: 0.65rem;
  color: #888;
}

/* ---- Stay Comparison (distribution widgets) ---- */
.dist-subtitle {
  font-size: 0.68rem;
  color: #888;
  margin-top: -6px;
  margin-bottom: 10px;
}

.compare-range-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.compare-range-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #999;
  margin-right: 2px;
}

.compare-range-select {
  font-size: 0.72rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 2px 4px;
  color: #333;
  background: white;
}

.compare-range-sep {
  color: #bbb;
  font-size: 0.72rem;
}

.dist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px;
  margin-bottom: 4px;
}

.dist-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.dist-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #555;
}

.dist-current {
  font-size: 0.9rem;
  font-weight: 700;
  color: #4a148c;
}

.dist-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 44px;
}

.dist-bar-anchor {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
}

.dist-bar {
  width: 100%;
  background: #ede7f6;
  border-radius: 4px 4px 0 0;
}

.dist-bar.current {
  background: #4a148c;
}

.dist-tooltip {
  width: 150px;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 600;
  color: #333;
  line-height: 1.35;
}

.dist-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.6rem;
  color: #aaa;
  margin-top: 3px;
}

.dist-callout {
  font-size: 0.7rem;
  color: #555;
  margin-top: 6px;
}

.dist-callout strong {
  color: #4a148c;
}

/* ---- Better Alternatives ---- */
.alt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.alt-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  min-width: 0;
}

.alt-card:hover,
.alt-card:focus {
  background: #f9f5fc;
  border-color: #ce93d8;
  outline: none;
}

.alt-badge {
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

.alt-dates {
  font-size: 0.78rem;
  font-weight: 600;
  color: #333;
}

.alt-note {
  font-size: 0.68rem;
  color: #777;
}

.alt-resort {
  font-size: 0.65rem;
  font-weight: 700;
  color: #4a148c;
}

.alt-card-empty {
  cursor: default;
  background: #fafafa;
}

.alt-card-empty:hover {
  background: #fafafa;
  border-color: #eee;
}

.alt-badge.muted {
  background: #ccc;
}

/* ---- Find Alternatives button + modal ---- */
.find-alt-btn {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: #4a148c;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.find-alt-btn:hover {
  background: #38116b;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-box {
  background: white;
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-header h3 {
  font-size: 1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
}

.modal-close:hover {
  color: #333;
}

.alt-cross-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #555;
  margin: 10px 0;
  cursor: pointer;
}

/* Selected state */
.day-cell.selected {
  outline: 3px solid #1a237e;
  outline-offset: -1px;
  box-shadow: 0 1px 6px rgba(26, 35, 126, 0.25);
}

/* Check-in marker */
.day-cell.checkin {
  outline-color: #2e7d32;
}

.day-cell.checkin::after {
  content: "IN";
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 0.45rem;
  font-weight: 700;
  color: #2e7d32;
  letter-spacing: 0.5px;
}

/* Check-out marker */
.day-cell.checkout {
  outline: 3px dashed #b71c1c;
  outline-offset: -1px;
  background: rgba(183, 28, 28, 0.06) !important;
}

.day-cell.checkout::after {
  content: "OUT";
  position: absolute;
  top: 2px;
  left: 3px;
  font-size: 0.45rem;
  font-weight: 700;
  color: #b71c1c;
  letter-spacing: 0.5px;
}

/* ---- Legend ---- */
.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  margin-top: 6px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  flex-wrap: wrap;
}

.legend-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.5px;
  margin-right: 4px;
}

.legend-items {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  color: #555;
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.source-link {
  font-size: 0.6rem;
  color: #aaa;
  text-decoration: none;
  margin-left: auto;
  white-space: nowrap;
}

.source-link:hover {
  color: #4a148c;
  text-decoration: underline;
}

/* Owner value color in summary */
.summary-row .row-value.owner {
  color: #4a148c;
}

/* ---- Action Buttons (between settings and summary) ---- */
#action-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#action-buttons:empty {
  display: none;
}

/* ---- Summary Panel (right side) ---- */
#summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.summary-card {
  background: white;
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  min-width: 0;
}

.summary-card h3 {
  font-size: 0.8rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eee;
}

.summary-dates-display {
  margin-bottom: 10px;
}

.summary-dates-display .date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.summary-dates-display .date-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  color: #888;
}

.summary-dates-display .date-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
}

.summary-divider {
  height: 1px;
  background: #eee;
  margin: 8px 0;
}

.summary-stats {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.summary-row .row-label {
  font-size: 0.8rem;
  color: #666;
}

.summary-row .row-value {
  font-size: 1rem;
  font-weight: 700;
  color: #1a237e;
  white-space: nowrap;
  flex-shrink: 0;
}

.summary-row .row-value.cash {
  color: #2e7d32;
  display: inline-flex;
  align-items: center;
}

.summary-row .row-value .save-amount {
  min-width: 70px;
  text-align: right;
}

.summary-row .row-value.rack {
  color: #b71c1c;
}

.cost-per-point {
  font-size: 0.65rem;
  font-weight: 600;
  color: #888;
  margin-left: 6px;
}

.summary-row .row-value .savings-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  min-width: 42px;
  text-align: center;
}

.summary-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 600;
  color: #aaa;
  letter-spacing: 0.5px;
  margin-top: 8px;
  margin-bottom: 2px;
}

/* ---- Cost Comparison tiles ---- */
.cost-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 6px;
}

.cost-tile {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #eee;
  border-radius: 10px;
}

.cost-tile-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  font-weight: 600;
  color: #aaa;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.cost-tile-value {
  font-size: 1.15rem;
  font-weight: 700;
}

.cost-tile-value.rack { color: #b71c1c; }
.cost-tile-value.owner { color: #4a148c; }
.cost-tile-value.cash { color: #2e7d32; }

.cost-tile-sub {
  font-size: 0.68rem;
  color: #888;
  margin-top: 2px;
}

.cost-tile-select {
  width: 100%;
  margin-bottom: 6px;
  padding: 4px 6px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.68rem;
  background: white;
  cursor: pointer;
}

.cost-tile-select:focus {
  outline: none;
  border-color: #4a148c;
  box-shadow: 0 0 0 2px rgba(74, 20, 140, 0.15);
}

.cost-tile-rate-input {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 6px;
  font-size: 0.75rem;
  color: #555;
}

.cost-tile-rate-input input[type="number"] {
  width: 46px;
  padding: 3px 5px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.75rem;
  text-align: right;
}

.cost-tile-rate-input input[type="number"]:focus {
  outline: none;
  border-color: #4a148c;
  box-shadow: 0 0 0 2px rgba(74, 20, 140, 0.15);
}

.cost-tile-savings {
  margin-top: 6px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #2e7d32;
}

.cost-tile-savings .savings-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  background: #e8f5e9;
  color: #2e7d32;
  padding: 2px 6px;
  border-radius: 4px;
}

.summary-row.total {
  padding-top: 10px;
  border-top: 2px solid #1a237e;
  margin-top: 4px;
}

.summary-row.total .row-label {
  font-weight: 600;
  color: #333;
}

.summary-row.total .row-value {
  font-size: 1.3rem;
}

.summary-nightly {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #eee;
}

.summary-nightly h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  color: #888;
  margin-bottom: 0;
  letter-spacing: 0.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.summary-nightly h4::after {
  content: "\25B6";
  font-size: 0.55rem;
  transition: transform 0.15s;
}

.summary-nightly.open h4::after {
  transform: rotate(90deg);
}

.summary-nightly h4:hover {
  color: #4a148c;
}

.nightly-rows {
  display: none;
  margin-top: 6px;
}

.summary-nightly.open .nightly-rows {
  display: block;
}

.nightly-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-size: 0.75rem;
}

.nightly-row .night-date {
  color: #555;
  flex: 1;
}

.nightly-row .night-points {
  font-weight: 600;
  color: #1a237e;
  min-width: 48px;
  text-align: right;
}

.nightly-row .night-cash {
  color: #b71c1c;
  font-size: 0.65rem;
  min-width: 52px;
  text-align: right;
}

.summary-empty {
  color: #999;
  font-style: italic;
  font-size: 0.85rem;
  text-align: center;
  padding: 24px 12px;
}

/* ---- Booking As (contract personalization) ---- */
.contract-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  background: white;
}

.contract-select:focus {
  outline: none;
  border-color: #4a148c;
  box-shadow: 0 0 0 2px rgba(74, 20, 140, 0.15);
}

.contract-eligibility {
  font-size: 0.8rem;
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
}

.contract-eligibility.contract-ok {
  color: #2e7d32;
  background: #e8f5e9;
}

.contract-eligibility.contract-blocked {
  color: #b71c1c;
  background: #ffebee;
}

.contract-points {
  font-size: 0.78rem;
  color: #666;
  margin-top: 6px;
  padding: 6px 10px;
}

.contract-points.contract-points-over {
  color: #b71c1c;
  background: #fff3e0;
  border-radius: 6px;
  font-weight: 600;
}

.summary-empty.small {
  padding: 8px 4px;
  text-align: left;
  font-size: 0.72rem;
}

/* ---- Value Score ---- */
.value-score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.value-score-badge {
  flex-shrink: 0;
  min-width: 54px;
  height: 46px;
  padding: 0 10px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.value-score-num {
  font-size: 1.25rem;
  font-weight: 800;
}

.value-score-body {
  min-width: 0;
}

.value-score-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #333;
}

.value-tooltip {
  width: 200px;
}

.value-tooltip-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 4px;
}

.value-tooltip-desc {
  font-size: 0.68rem;
  color: #777;
  line-height: 1.35;
}

.value-score-desc {
  font-size: 0.66rem;
  color: #888;
  margin-top: 1px;
}

.no-cash-note {
  font-size: 0.72rem;
  color: #999;
  font-style: italic;
  margin-top: 8px;
}

.prior-year-note {
  font-size: 0.65rem;
  color: #999;
  font-style: italic;
  margin-top: 2px;
}

.day-cash.prior-year {
  color: #bbb;
  font-style: italic;
}

.custom-cash-input {
  margin-top: 8px;
}

.custom-cash-row {
  margin-top: 6px;
}

.custom-cash-row label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #666;
}

.custom-cash-field {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.custom-cash-field .cash-prefix,
.custom-cash-field .cash-suffix {
  font-size: 0.8rem;
  color: #888;
  font-weight: 600;
}

.custom-cash-field input {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.85rem;
  text-align: right;
}

.custom-cash-field input:focus {
  outline: none;
  border-color: #4a148c;
  box-shadow: 0 0 0 2px rgba(74, 20, 140, 0.15);
}

.summary-compare {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: #4a148c;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: background 0.15s;
}

.summary-compare:hover {
  background: #6a1b9a;
}

.summary-clear {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 6px;
  background: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #666;
  cursor: pointer;
  transition: all 0.15s;
}

.summary-clear:hover {
  border-color: #b71c1c;
  color: #b71c1c;
  background: rgba(183, 28, 28, 0.04);
}

/* ---- Contract personalization: dates outside this contract's current
   booking window (11mo home / 7mo elsewhere), or a resort it can never
   book. Dimmed but still clickable -- unlike the old Booking Window
   dropdown, this is informational, not a hard gate, since someone may
   reasonably want to see what a date would cost even before they can
   actually book it. ---- */
.day-cell.contract-not-yet-bookable {
  opacity: 0.4;
}

.day-cell.contract-not-yet-bookable::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    rgba(0,0,0,0.035),
    rgba(0,0,0,0.035) 4px,
    transparent 4px,
    transparent 9px
  );
  pointer-events: none;
}

/* ---- Split Stay: Calendar ---- */
.day-cell.prev-segment {
  opacity: 0.45;
  pointer-events: none;
  outline: 2px solid #888;
  outline-offset: -1px;
}

/* ---- Split Stay: Summary ---- */
.segment-block {
  padding: 8px 0;
  border-bottom: 1px solid #eee;
}

.segment-block:last-of-type {
  border-bottom: none;
}

.segment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.segment-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  font-weight: 700;
  color: #888;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.segment-resort {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
}

.segment-edit {
  font-size: 0.65rem;
  color: #4a148c;
  cursor: pointer;
  margin-left: auto;
  font-weight: 600;
}

.segment-edit:hover {
  text-decoration: underline;
}

.segment-remove {
  font-size: 0.9rem;
  color: #bbb;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}

.segment-remove:hover {
  color: #b71c1c;
}

.segment-detail {
  font-size: 0.75rem;
  color: #666;
  margin-top: 1px;
}

.segment-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.segment-compare {
  font-size: 0.65rem;
  font-weight: 600;
  color: #4a148c;
  text-decoration: none;
}

.segment-compare:hover {
  text-decoration: underline;
}

.segment-nightly-toggle {
  font-size: 0.65rem;
  font-weight: 600;
  color: #888;
  cursor: pointer;
}

.segment-nightly-toggle:hover {
  color: #4a148c;
}

.segment-block .summary-nightly {
  margin-top: 4px;
  padding-top: 0;
  border-top: none;
}

.summary-add-segment {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: none;
  border: 2px dashed #4a148c;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #4a148c;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}

.summary-add-segment:hover {
  background: rgba(74, 20, 140, 0.06);
  border-color: #6a1b9a;
}

.summary-save-itinerary {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: #2e7d32;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}

.summary-save-itinerary:hover {
  background: #256428;
}

.itinerary-save-form {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.itinerary-save-form input {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.8rem;
}

.itinerary-save-form input:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.15);
}

.itinerary-save-confirm {
  padding: 7px 12px;
  background: #2e7d32;
  border: none;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  white-space: nowrap;
}

.itinerary-save-confirm:hover { background: #256428; }
.itinerary-save-confirm:disabled { background: #9ccc9f; cursor: default; }

.itinerary-save-cancel {
  padding: 7px 10px;
  background: none;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.9rem;
  color: #666;
  cursor: pointer;
}

.itinerary-save-cancel:hover { border-color: #b71c1c; color: #b71c1c; }

.itinerary-save-error {
  margin-top: 6px;
  font-size: 0.75rem;
  color: #b71c1c;
}

/* ---- Responsive ---- */
@media (max-width: 800px) {
  /* Scoped to narrow viewports only -- overflow-x: auto here pairs with
     .calendar-grid's min-width below to let the grid scroll horizontally
     instead of squeezing cells illegibly. Applying it unconditionally
     (as this used to) triggers a CSS Overflow Module interop rule: when
     overflow-x is anything other than visible, a not-visible overflow-y
     computes to auto too, and visible overflow-y computes to auto as
     well (a visible/non-visible pairing isn't allowed) -- so even before
     this was scoped, overflow-y was never actually visible on desktop,
     it silently became a second auto scrollbar clipping the grid to a
     shorter-than-content height for no reason, since desktop never
     needed horizontal scroll at all. */
  .calendar-grid-scroll {
    overflow-x: auto;
  }

  .site-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .site-nav-links {
    width: 100%;
  }

  .main-layout {
    flex-direction: column;
  }

  .calendar-side {
    width: 100%;
    min-width: 0;
  }

  .summary-side {
    width: 100%;
    position: static;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .month-nav {
    margin-left: 0;
    justify-content: center;
  }

  .custom-select {
    min-width: unset;
    width: 100%;
  }

  .searchable-select {
    min-width: unset;
    width: 100%;
  }

  /* Cells never shrink below a legible size — the grid scrolls
     horizontally on narrow phones instead of squeezing content. */
  .calendar-grid {
    min-width: 420px;
  }

  .day-cell {
    min-height: 58px;
  }

  .day-cell .day-points {
    font-size: 0.85rem;
  }

  .day-cell .day-number {
    font-size: 0.65rem;
  }

  /* Stack cash + crowd instead of side-by-side — at this cell width they
     don't have room to sit next to each other without overlapping. */
  .day-cell .day-topline {
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    top: 2px;
    right: 2px;
    left: auto;
  }

  .day-cell .day-cash {
    font-size: 0.48rem;
  }

  .day-cell .day-crowd {
    font-size: 0.48rem;
    padding: 1px 3px;
  }
}

/* ---- Availability Outlook ---- */
.availability-outlook {
}

.availability-outlook h3 {
  border-bottom: none !important;
  margin-bottom: 6px !important;
  padding-bottom: 0 !important;
}

.avail-stay-length {
  font-weight: 400;
  color: #999;
  font-size: 0.7rem;
  margin-left: 4px;
}

.avail-dot-row {
  display: flex;
  gap: 8px;
  margin: 6px 0 4px;
}

.avail-dot-col {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.avail-dot-label {
  font-size: 0.55rem;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.avail-dot {
  width: 100%;
  max-width: 34px;
  height: 22px;
  border-radius: 6px;
}

.avail-dot-excellent { background: #2e7d32; }
.avail-dot-good { background: #f9a825; }
.avail-dot-fair { background: #ef6c00; }
.avail-dot-low { background: #d84315; }
.avail-dot-very-low { background: #b71c1c; }

.avail-dot-tooltip {
  width: 160px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: #333;
}

.avail-note {
  font-size: 0.6rem;
  color: #aaa;
  margin-top: 4px;
}

.avail-note a {
  color: #aaa;
  text-decoration: underline;
}

.avail-segment {
  margin-bottom: 8px;
}

.avail-segment:last-of-type {
  margin-bottom: 0;
}

.avail-segment-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 3px;
}
