/* ===== pages/plan.css ===== */

/* Google Places Autocomplete Fix for Mobile */
.pac-container {
  z-index: 99999 !important;
  pointer-events: auto !important;
}

.pac-item {
  cursor: pointer;
  -webkit-touch-callout: none;
}



/* Plan Hero Section */
#plan-section .plan-hero-section {
  text-align: center;
  margin-top: 60px;
  margin-bottom: 40px;
}

#plan-section .plan-hero-title {
  font-size: 32px;
  margin: 0 0 30px;
  text-align: center;
  font-weight: 800;
  word-break: keep-all;
  color: #111;
}

#plan-section .dates-hero-wrapper {
  display: flex;
  justify-content: center;
}

#plan-section .dates-vertical {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 0 auto;
  width: 100%;
  max-width: 360px;
}

#plan-section .date-box {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

#plan-section .date-box label {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

#plan-section .date-box .input-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#plan-section .date-box input {
  font-size: 20px;
  font-weight: 700;
  color: #111;
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  cursor: pointer;
  padding: 0;
}

#plan-section .date-box input::placeholder {
  color: #aaa;
  opacity: 1;
  /* Fix for iOS opacity */
  -webkit-text-fill-color: #aaa;
}

/* Next Button - Blue block */
#plan-section .next-step-btn {
  width: 100%;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 16px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s;
}

#plan-section .next-step-btn:hover {
  background: #1d4ed8;
}

#staySearchInputArea {
  display: none;
  margin-top: 15px;
  border-top: none;
  padding-top: 15px;
}

#plan-section .dates {
  display: flex;
  justify-content: center;
  /* Ensure items inside are centered */
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 auto;
  max-width: 400px;
  /* Limit width for centered look */
  width: 100%;
}

#staySearchInputArea {
  display: none;
  margin-top: 15px;
  border-top: none;
  padding-top: 15px;
}

#plan-section .topbar {
  background: #fff;
  border-bottom: 1px solid #eee;
}

#plan-section .meta {
  color: rgba(0, 0, 0, 0.60);
  font-size: 14px;
}

#plan-section .search-box {
  display: flex;
  gap: 10px;
  margin: 10px 0 14px;
  width: 100%;
  /* Ensure full width */
}

#plan-section .search-box input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
}

.page-index .search-tab-btn,
.page-plan .search-tab-btn,
.page-index #buildBasketBtn,
.page-index #autoPlanBtn,
.page-plan #buildBasketBtn,
.page-plan #autoPlanBtn {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #2563eb;
  background: #eff6ff;
  color: #1e40af;
  border-radius: 999px;
  font-weight: 600;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.page-index .search-tab-btn:hover,
.page-plan .search-tab-btn:hover,
.page-index #buildBasketBtn:hover,
.page-index #autoPlanBtn:hover,
.page-plan #buildBasketBtn:hover,
.page-plan #autoPlanBtn:hover {
  background: #dbeafe;
}

.page-index .search-tab-btn.active,
.page-plan .search-tab-btn.active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.page-index #buildBasketBtn,
.page-index #autoPlanBtn,
.page-plan #buildBasketBtn,
.page-plan #autoPlanBtn {
  width: 100%;
}

@media (max-width: 640px) {
  #plan-section .search-box {
    flex-direction: column;
  }

  #plan-section .search-box input {
    width: 100%;
  }

  #plan-section .primary {
    width: 100%;
  }
}

/* Dates (web/mobile overlap fix) */
#plan-section .dates {
  /* Inherits flex from above, but make sure it doesn't conflict */
}

#plan-section .date-col {
  flex: 1 1 140px;
  min-width: 0;
  text-align: left;
  /* Keep labels left aligned inside the inputs if preferred, or center? User said "center the buttons". Usually inputs are text-left. */
}

#plan-section .date-col label {
  display: block;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.75);
  margin-bottom: 6px;
}

#plan-section .date-col input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #ddd;
}

@media (max-width: 640px) {
  #plan-section .date-col {
    flex-basis: 100%;
  }
}

/* iOS flatpickr mobile input layout fix */
#plan-section .date-col input,
#plan-section .date-col .flatpickr-input,
#plan-section .date-col .flatpickr-mobile {
  width: 100% !important;
  min-width: 0 !important;
  padding: 10px 12px !important;
  border-radius: 10px !important;
  border: 1px solid #ddd !important;
  background: #fff !important;
  box-sizing: border-box !important;
}

#plan-section .flatpickr-calendar {
  z-index: 9999 !important;
}

/* 선택 사항: 지도가 나타날 때 페이드 인 효과 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#plan-section .card:has(#cityMap) {
  display: none;
}

/* Map
   NOTE:
   The page no longer wraps planner content with #plan-section.
   Keep selectors anchored to .page-plan / #plannerMain so map height is not 0. */
.page-plan #plannerMain .city-map,
.page-plan .city-map {
  width: 100%;
  height: clamp(260px, 42vh, 420px);
  min-height: 260px;
  border-radius: 12px;
  overflow: hidden;
  background: #eee;
  margin-bottom: 16px;
}

@supports (aspect-ratio: 1 / 1) {
  .page-plan #plannerMain .city-map,
  .page-plan .city-map {
    height: auto;
    min-height: 260px;
    aspect-ratio: 1 / 0.5;
  }
}

@media (max-width: 640px) {
  .page-plan #plannerMain .city-map,
  .page-plan .city-map {
    min-height: 240px;
    border-radius: 16px;
  }
}

/* plan page chip colors (black/white) */
#plan-section .chip {
  border: 1px solid #ddd;
  background: #fff;
  font-weight: 600;
}

#plan-section .chip:hover {
  background: #f6f6f6;
}

#plan-section .chip.active {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* Basket cards */
#plan-section .basket-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

#plan-section .basket-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 12px;
  background: #fff;
}

#plan-section .basket-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

#plan-section .basket-day {
  font-weight: 700;
}

#plan-section .basket-date {
  color: rgba(0, 0, 0, 0.55);
  font-size: 12px;
}

#plan-section .basket-actions {
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  #plan-section .basket-actions button {
    width: 100%;
  }
}

/* Day cards strip */
#plan-section .day-cards {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

#plan-section .day-card {
  scroll-snap-align: start;
}

@media (max-width: 640px) {
  #plan-section .day-card {
    flex: 0 0 82vw;
    height: 62vh;
    max-height: 520px;
  }
}

/* Saved stays: vertical cards */
#plan-section .stay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

#plan-section .stay-card {
  position: relative;
  border: 1px solid #eee;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.04);
}

#plan-section .stay-thumb {
  width: 100%;
  height: 150px;
  background: #f1f1f1;
  overflow: hidden;
}

#plan-section .stay-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#plan-section .stay-thumb-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 0, 0, 0.45);
  font-size: 13px;
}

#plan-section .stay-body {
  padding: 12px;
}

#plan-section .stay-title {
  font-weight: 800;
  font-size: 15px;
  line-height: 1.2;
  margin-bottom: 6px;
}

#plan-section .stay-dates {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.65);
  margin-bottom: 6px;
}

#plan-section .stay-addr {
  font-size: 12px;
  color: rgba(0, 0, 0, 0.55);
}

#plan-section .stay-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 1px solid rgba(0, 0, 0, 0.10);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 6px 10px;
  cursor: pointer;
}

@media (max-width: 640px) {
  #plan-section .stay-grid {
    grid-template-columns: 1fr;
  }
}

/* Hotpepper tiny thumbnail list (plan only override)
   - components.css의 .suggest-item(텍스트 리스트)을
     plan 페이지에서만 "썸네일 + flex"로 바꿔치기 */
#plan-section #foodResults .suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  border-bottom: none;
  /* components의 border-bottom 제거 */
  transform: none;
  /* components hover transform 제거 */
}

#plan-section #foodResults .suggest-item:hover {
  background: rgba(0, 0, 0, 0.04);
}

#plan-section .suggest-main {
  flex: 1;
  min-width: 0;
}

#plan-section .suggest-thumb {
  width: 70px;
  height: 70px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
}

#plan-section .card-header-flex {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

#plan-section .card-header-flex h3 {
  margin: 0;
}

#plan-section .text-btn {
  background: none;
  border: none;
  color: #2563eb;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
}

#plan-section .text-btn:hover {
  background: rgba(37, 99, 235, 0.08);
}

/* Add-to-basket toast */
.spot-added-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 12px);
  width: min(92vw, 360px);
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.96);
  color: #fff;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.35);
  z-index: 1300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.spot-added-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.spot-added-toast-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.spot-added-toast-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
}

.spot-added-toast-close {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
}

.spot-added-toast-mute {
  margin-top: 9px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  text-decoration: underline;
  padding: 0;
}

@media (max-width: 640px) {
  .spot-added-toast {
    width: min(94vw, 340px);
    bottom: 16px;
    border-radius: 12px;
  }
}

/* Route review confirm popup */
.route-review-confirm-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
  z-index: 1400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.route-review-confirm-popup.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.route-review-confirm-card {
  width: min(92vw, 420px);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.25);
  padding: 18px 16px 14px;
}

.route-review-confirm-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.5;
}

.route-review-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.route-review-confirm-yes,
.route-review-confirm-check {
  border-radius: 10px;
  border: 0;
  min-height: 42px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.route-review-confirm-yes {
  background: #2563eb;
  color: #fff;
}

.route-review-confirm-check {
  background: #f1f5f9;
  color: #0f172a;
}

/* Incomplete basket confirm popup */
.incomplete-basket-confirm-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
  z-index: 1400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.incomplete-basket-confirm-popup.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.incomplete-basket-confirm-card {
  width: min(92vw, 420px);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.25);
  padding: 18px 16px 14px;
}

.incomplete-basket-confirm-title {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.5;
}

.incomplete-basket-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.incomplete-basket-confirm-proceed,
.incomplete-basket-confirm-back {
  border-radius: 10px;
  border: 0;
  min-height: 42px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.incomplete-basket-confirm-proceed {
  background: #2563eb;
  color: #fff;
}

.incomplete-basket-confirm-back {
  background: #f1f5f9;
  color: #0f172a;
}

/* Summary Header Actions */
.summary-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.summary-header-left {
  display: flex;
  align-items: center;
  min-height: 40px;
}

.summary-shared-badge {
  background: #eef2f7;
  color: #4b5563;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.summary-shared-badge.is-editing {
  background: #e8f0fe;
  color: #1a73e8;
}

.summary-header-right {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.summary-action-btn {
  appearance: none;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  border-radius: 999px;
  padding: 10px 14px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
}

.summary-action-btn:hover {
  background: #f8fafc;
}

.summary-action-btn-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.summary-action-btn-primary:hover {
  background: #1d4ed8;
}

.summary-action-btn-kakao {
  background: #fee500;
  border-color: #e5d000;
  color: #111;
}

.summary-action-btn-kakao:hover {
  background: #f9e11f;
}

@media (max-width: 640px) {
  .summary-header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .summary-header-left {
    min-height: auto;
  }

  .summary-header-right {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .summary-action-btn {
    width: 100%;
    min-width: 0;
    text-align: center;
    white-space: normal;
    padding: 10px 12px;
  }
}

@media (max-width: 420px) {
  .summary-header-right {
    grid-template-columns: 1fr;
  }
}

.summary-raw-json-panel {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #f8fafc;
}

.summary-inline-result-panel {
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.summary-raw-json-title {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
}

.summary-raw-json-file {
  margin-bottom: 8px;
  color: #475569;
  font-size: 12px;
}

.summary-raw-json-pre {
  margin: 0;
  padding: 12px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
  overflow: auto;
  max-height: 420px;
  white-space: pre;
}

.summary-ai-box {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.summary-ai-title {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
}

.summary-ai-desc {
  margin: 0 0 10px;
  font-size: 12px;
  color: #475569;
}

.summary-ai-prompt {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  font-size: 13px;
  line-height: 1.45;
  background: #fff;
  color: #111827;
  box-sizing: border-box;
}

.summary-ai-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-ai-generate-btn {
  appearance: none;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.summary-footer-actions {
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.summary-ai-export-wrap {
  margin-top: 10px;
  display: flex;
  justify-content: center;
}

.summary-ai-export-wrap .secondary {
  min-width: 180px;
}

.summary-ai-generate-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.summary-ai-model {
  color: #334155;
  font-size: 12px;
}

.summary-ai-error {
  min-height: 18px;
  margin-top: 8px;
  font-size: 12px;
  color: #b91c1c;
}

.summary-ai-result {
  margin: 8px 0 0;
  padding: 0;
  background: linear-gradient(150deg, #ffffff 0%, #f8fbff 100%);
  color: #111827;
  border: 1px solid #cfd9e5;
  border-radius: 12px;
  overflow: visible;
  max-height: none;
}

.summary-ai-result.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.summary-ai-empty {
  text-align: center;
  padding: 26px 18px;
}

.summary-ai-empty-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.summary-ai-empty-sub {
  margin-top: 6px;
  font-size: 12px;
  color: #475569;
}

.summary-ai-loading {
  position: relative;
  padding: 22px 18px 16px;
}

.summary-ai-loading-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(255, 255, 255, 0) 20%, rgba(219, 234, 254, 0.45) 50%, rgba(255, 255, 255, 0) 80%);
  transform: translateX(-100%);
  animation: summaryShimmer 1.25s linear infinite;
  pointer-events: none;
}

.summary-ai-loading-line {
  height: 11px;
  border-radius: 99px;
  background: #dbe7f5;
  margin-top: 10px;
}

.summary-ai-loading-line.w-100 {
  width: 100%;
}

.summary-ai-loading-line.w-90 {
  width: 90%;
}

.summary-ai-loading-line.w-80 {
  width: 80%;
}

.summary-ai-progress {
  margin-top: 14px;
  padding: 10px 10px 8px;
  border: 1px solid #d8e4f2;
  border-radius: 10px;
  background: #ffffff;
}

.summary-ai-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #334155;
  font-weight: 700;
}

.summary-ai-progress-track {
  margin-top: 7px;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.summary-ai-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 100%);
  transition: width 0.25s ease;
}

.summary-ai-progress-eta {
  margin-top: 6px;
  font-size: 11px;
  color: #64748b;
}

.summary-ai-article {
  padding: 14px 14px 12px;
  font-family: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.summary-ai-article-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 10px;
  margin-bottom: 12px;
}

.summary-ai-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  letter-spacing: 0.05em;
  font-weight: 800;
  color: #1d4ed8;
  background: #dbeafe;
}

.summary-ai-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-ai-model-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
  background: #e2e8f0;
}

.summary-ai-time {
  font-size: 11px;
  color: #64748b;
}

.summary-ai-article-body {
  color: #0f172a;
}

.summary-ai-h1,
.summary-ai-h2,
.summary-ai-h3 {
  margin: 14px 0 8px;
  font-weight: 800;
  line-height: 1.35;
  color: #0b3b7a;
}

.summary-ai-day-title {
  margin: 18px 0 10px;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
  color: #0a2d63;
  letter-spacing: 0.01em;
}

.summary-generated-preface {
  margin-bottom: 14px;
}

.summary-generated-day-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  background: #fff;
}

.summary-generated-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}

.summary-generated-day-title {
  margin: 0;
  color: #4285f4;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.2;
}

.summary-generated-day-meta {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.summary-generated-day-inline-comment {
  margin: 0;
  text-align: right;
  font-size: 14px;
  color: #1f2937;
  line-height: 1.45;
  font-weight: 700;
}

.summary-generated-day-distance {
  margin: 0;
  text-align: right;
  font-size: 12px;
  color: #1d4ed8;
  line-height: 1.4;
  font-weight: 800;
}

.summary-generated-stay-box {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fbff;
  margin-top: 12px;
}

.summary-generated-stay-label {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}

.summary-generated-stay-name {
  font-weight: 700;
  color: #111827;
}

.summary-generated-stay-address {
  font-size: 12px;
  color: #4b5563;
  margin-top: 2px;
}

.summary-generated-stay-date {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.summary-generated-day-notes {
  margin-top: 8px;
}

.summary-generated-route-list {
  margin-top: 10px;
}

.summary-day-details {
  margin: 14px 0;
  border: 1px solid #d6e2f1;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.summary-day-summary {
  list-style: none;
  margin: 0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  background: linear-gradient(145deg, #eef4ff 0%, #f8fbff 100%);
  border-bottom: 1px solid #dfe8f5;
}

.summary-day-summary::-webkit-details-marker {
  display: none;
}

.summary-day-summary-title {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.25;
  color: #0a2d63;
  letter-spacing: 0.01em;
}

.summary-day-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}

.summary-day-summary-hint-open {
  display: none;
}

.summary-day-summary-arrow {
  font-size: 12px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.summary-day-details[open] .summary-day-summary-hint-open {
  display: inline;
}

.summary-day-details[open] .summary-day-summary-hint-closed {
  display: none;
}

.summary-day-details[open] .summary-day-summary-arrow {
  transform: rotate(180deg);
}

.summary-day-details-body {
  padding: 2px 14px 10px;
}

.summary-day-details-body .summary-ai-paragraph:first-child,
.summary-day-details-body .summary-ai-list:first-child,
.summary-day-details-body .summary-ai-h1:first-child,
.summary-day-details-body .summary-ai-h2:first-child,
.summary-day-details-body .summary-ai-h3:first-child {
  margin-top: 10px;
}

.summary-route-title {
  margin: 12px 0 8px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.35;
  color: #114a8a;
}

.summary-route-details {
  margin: 10px 0;
  border: 1px solid #d6e2f1;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.summary-route-summary {
  list-style: none;
  margin: 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  background: #f8fbff;
  border-bottom: 1px solid #e6edf7;
}

.summary-route-summary::-webkit-details-marker {
  display: none;
}

.summary-route-summary-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.summary-route-summary-badge {
  background: #4285f4;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.summary-route-summary-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.35;
  color: #114a8a;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.summary-route-summary-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.summary-route-summary-hint-open {
  display: none;
}

.summary-route-summary-arrow {
  font-size: 11px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.summary-route-details[open] .summary-route-summary-hint-open {
  display: inline;
}

.summary-route-details[open] .summary-route-summary-hint-closed {
  display: none;
}

.summary-route-details[open] .summary-route-summary-arrow {
  transform: rotate(180deg);
}

.summary-route-details-body {
  padding: 2px 12px 8px;
}

.summary-generated-route-static {
  margin: 10px 0;
  border: 1px solid #d6e2f1;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.summary-generated-route-static .summary-route-summary-title {
  margin: 0;
}

.summary-generated-route-static .summary-route-summary {
  cursor: default;
}

.summary-generated-route-static .summary-route-summary-meta {
  display: none;
}

.summary-generated-route-static .summary-route-summary {
  background: #f8fbff;
  border-bottom: 1px solid #e6edf7;
}

.summary-route-transition {
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #dbe7f5;
  background: #f7fbff;
  color: #0b3b7a;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.summary-route-transition-text {
  min-width: 0;
  flex: 1;
}

.summary-route-distance-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 8px;
  white-space: nowrap;
}

.summary-route-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #4285f4;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  margin: 0 4px 0 2px;
  vertical-align: middle;
}

.summary-route-details-body .summary-ai-paragraph:first-child,
.summary-route-details-body .summary-ai-list:first-child,
.summary-route-details-body .summary-ai-h1:first-child,
.summary-route-details-body .summary-ai-h2:first-child,
.summary-route-details-body .summary-ai-h3:first-child {
  margin-top: 8px;
}

.summary-ai-h1 {
  font-size: 17px;
}

.summary-ai-h2 {
  font-size: 16px;
}

.summary-ai-h3 {
  font-size: 15px;
}

.summary-ai-paragraph {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.62;
  color: #1e293b;
}

.summary-ai-list {
  margin: 8px 0;
  padding-left: 20px;
}

.summary-ai-list li {
  margin: 6px 0;
  font-size: 14px;
  line-height: 1.58;
  color: #1e293b;
}

.summary-ai-list-ordered {
  list-style: decimal;
}

.summary-ai-code {
  padding: 1px 6px;
  border-radius: 6px;
  background: #e2e8f0;
  color: #0f172a;
  font-size: 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.summary-ai-divider {
  margin: 12px 0;
  border: 0;
  border-top: 1px dashed #cbd5e1;
}

@keyframes summaryShimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 640px) {
  .summary-ai-article {
    padding: 12px 10px;
  }

  .summary-generated-day-card {
    padding: 14px 12px;
    margin-bottom: 14px;
  }

  .summary-generated-day-title {
    font-size: 21px;
  }

  .summary-generated-day-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .summary-generated-day-meta {
    margin-left: 0;
    align-items: flex-start;
    width: 100%;
  }

  .summary-generated-day-inline-comment {
    text-align: left;
    font-size: 13px;
    width: 100%;
  }

  .summary-generated-day-distance {
    text-align: left;
  }

  .summary-ai-paragraph,
  .summary-ai-list li {
    font-size: 13px;
  }
  .summary-ai-day-title {
    font-size: 20px;
  }
  .summary-route-title {
    font-size: 15px;
  }
  .summary-day-summary-title {
    font-size: 18px;
  }
  .summary-route-summary-title {
    font-size: 14px;
  }
  .summary-footer-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .summary-ai-export-wrap .secondary {
    width: 100%;
    min-width: 0;
  }
}

/* Sticky Bottom Bar */
/* Sticky Bottom Bar - Global */
.sticky-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fff;
  border-top: 1px solid #eee;
  padding: 16px 20px;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  display: flex;
  justify-content: center;
}

.sticky-bottom-bar .full-width {
  width: 100%;
  max-width: 600px;
  /* Optional constraint */
  font-size: 16px;
  padding: 14px;
  border-radius: 12px;
}

/* Add padding to body or main to prevent content being hidden behind bar? 
   Or just add margin-bottom to last card? */
.page-plan {
  padding-bottom: 80px;
  /* Space for the bar */
}

/* Stay Selector Widget */
.stay-select-widget {
  position: relative;
  width: 100%;
  margin-top: 8px;
  user-select: none;
  overflow: visible !important;
  /* Allow tooltip to show */
}


.stay-select-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  transition: all 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.stay-select-trigger:hover {
  background: #fdfdfd;
  border-color: #d0d0d0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.stay-select-trigger.empty {
  border: 1px dashed #ccc;
  color: #888;
  justify-content: center;
  background: rgba(255, 255, 255, 0.5);
}

.stay-select-trigger:focus,
.stay-select-trigger.empty:focus {
  outline: none;
  box-shadow: none;
  border-color: #e0e0e0;
}

.stay-select-trigger.empty:hover {
  background: #fff;
  border-color: #bbb;
  color: #555;
}

.stay-select-trigger .trigger-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stay-select-trigger .trigger-thumb {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  background: #eee;
  flex-shrink: 0;
}

.stay-select-trigger .trigger-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.stay-select-trigger .trigger-name {
  font-weight: 700;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stay-select-trigger .trigger-addr {
  font-size: 11px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stay-select-arrow {
  margin-left: auto;
  font-size: 10px;
  color: #999;
  transition: transform 0.2s;
}

.stay-select-widget.open .stay-select-arrow {
  transform: rotate(180deg);
}

/* Dropdown */
.stay-select-dropdown {
  display: none;
  position: relative;
  /* Changed from absolute to avoid clipping in overflow container */
  width: 100%;
  margin-top: 6px;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  animation: slideDown 0.2s ease-out;
}

.stay-select-widget.open .stay-select-dropdown {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stay-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #f5f5f5;
  transition: background 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

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

.stay-option:hover {
  background: #f7f9fc;
}

.stay-option.selected {
  background: #eef4ff;
}

.stay-option .opt-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  background: #eee;
  flex-shrink: 0;
}

.stay-option .opt-info {
  flex: 1;
  min-width: 0;
}

.stay-option .opt-name {
  font-weight: 600;
  font-size: 13px;
  color: #333;
  margin-bottom: 2px;
}

.stay-option .opt-addr {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stay-option.reset-option {
  color: #d9534f;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
}

/* Mobile responsive tweak */
@media (max-width: 640px) {
  .stay-select-dropdown {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 50vh;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  }
}

/* Sidebar Spot Item Text Polish */
.sidebar-spot-item .spot-name {
  font-size: 14px;
  /* Increased from default */
  font-weight: 700;
  /* Bold */
  color: #111;
}

/* Stay Selection Layout */
.selected-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

#selectedStayBox {
  flex: 1;
  min-width: 0;
}

#addStayBtn {
  white-space: nowrap;
  margin-left: 12px;
  /* Increased spacing */
}

@media (max-width: 640px) {
  .selected-box {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  #selectedStayBox {
    margin-bottom: 12px;
    /* Increased space between text and button */
  }

  #addStayBtn {
    width: 100%;
    margin-left: 0;
    /* Reset margin for mobile */
  }
}

/* Sticky Bottom Bar Buttons */
.sticky-buttons-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
}






/* Sticky Button Refinements */
.sticky-bottom-bar {
  /* Ensure parent allows centering */
  justify-content: center;
  align-items: center;
}

/* Consolidated Sticky Button Styles */
.sticky-buttons-container {
  margin-top: 0 !important;
  gap: 16px !important;
  display: flex !important;
  width: 100% !important;
  max-width: 800px !important;
  justify-content: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
  margin-bottom: 0 !important;
}

#stayListCard .sticky-buttons-container {
  margin-top: 32px !important;
}

.sticky-btn {
  flex: 1 !important;
  text-align: center !important;
  justify-content: center !important;
  display: flex !important;
  align-items: center !important;
  width: auto !important;
  padding: 14px 10px !important;
  background-color: #2563eb !important;
  color: #fff !important;
}

.sticky-btn:disabled {
  background-color: #9db8f7 !important;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .sticky-buttons-container {
    flex-direction: row !important;
    gap: 8px !important;
    padding: 0 16px;
    margin-top: 0 !important;
  }

  #stayListCard .sticky-buttons-container {
    margin-top: 24px !important;
  }

  .sticky-btn {
    width: auto !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    min-height: 52px;
    font-size: 13px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    margin-bottom: 0 !important;
  }

  /* Robust fallback for browsers with partial flex-gap support */
  .sticky-buttons-container>.sticky-btn:not(:last-child) {
    margin-bottom: 0 !important;
  }
}

.stay-plan-style-note {
  text-align: center;
  margin: 18px 0 8px;
}

@media (max-width: 640px) {
  .stay-plan-style-note {
    margin: 14px 0 6px;
  }
}

.stay-image-notice {
  margin: 0 0 10px;
  font-size: 10px;
  line-height: 1.4;
  color: rgba(100, 116, 139, 0.78);
}

#stayListCard .card-header-flex + .stay-image-notice {
  margin-top: -6px;
}

/* Mobile Line Break Helper */
.mobile-newline-text {
  display: inline;
}

@media (max-width: 640px) {
  .mobile-newline-text {
    display: block;
    margin-top: 4px;
    font-size: 0.9em;
  }
}

/* Basket Button Group for tight spacing */
.basket-btn-group {
  display: flex;
  flex-direction: row;
  gap: 8px;
  margin-bottom: 8px;
}

.basket-btn-group>button {
  flex: 1 1 0;
  min-width: 0;
}

@media (max-width: 640px) {
  .basket-btn-group {
    flex-direction: row !important;
    gap: 8px !important;
  }

  .basket-btn-group>button {
    width: auto !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    font-size: 13px !important;
    line-height: 1.25 !important;
    white-space: normal !important;
    margin: 0 !important;
  }
}

/* Onboarding Guidance */
@keyframes twinkle-gold {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.7);
    border-color: #ffd700;
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 25px 10px rgba(255, 215, 0, 0);
    /* Increased shadow */
    border-color: #ffaa00;
    transform: scale(1.08);
    /* Increased scale from 1.02 to 1.08 */
  }

  100% {
    box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
    border-color: #ffd700;
    transform: scale(1);
  }
}

.onboarding-twinkle {
  animation: twinkle-gold 1.2s infinite !important;
  /* Faster animation */
  z-index: 2000 !important;
  position: relative;
}

.guidance-bubble {
  position: fixed;
  left: 0;
  top: 0;
  transform: none;
  background: rgba(17, 24, 39, 0.96);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  max-width: min(320px, calc(100vw - 16px));
  pointer-events: none;
  opacity: 0;
  animation: fadeIn 0.2s forwards;
  z-index: 3000;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

/* Mobile specific tweaks */
@media (max-width: 1023px) {

  /* Fix Stay Dropdown Clipping in Drawer */
  .basket-drawer .stay-select-dropdown {
    position: static !important;
    /* Flow layout */
    box-shadow: none !important;
    border: 1px solid #eee !important;
    margin-top: 10px;
    max-height: none !important;
    /* Let it expand fully */
    overflow: visible !important;
  }

  .basket-drawer .stay-select-widget {
    overflow: visible !important;
  }
}

@media (max-width: 1023px) {
  .page-index .search-box input,
  .page-plan .search-box input,
  .page-index input[type="text"],
  .page-index input[type="search"],
  .page-plan input[type="text"],
  .page-plan input[type="search"],
  .page-index textarea,
  .page-plan textarea {
    font-size: 16px !important;
  }
}
