html, body { height: 100%; margin: 0; }

/* --- Layout: sidebar + map --- */
#app {
  display: grid;
  grid-template-columns: 340px 1fr;
  grid-template-rows: 100vh;
  width: 100vw;
  height: 100vh;
  background: #f6faf8;
}

/* Sidebar styling */
#sidebar {
  border-right: 1px solid #e5efe9;
  background: linear-gradient(180deg,#ffffff,#fbfdfc);
  font: 14px/1.35 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow: auto;
  position: relative;
}
#sidebar header {
  position: sticky; top: 0; z-index: 3;
  background: #f2f7f4;
  border-bottom: 1px solid #e5efe9;
  padding: 10px 12px;
  font-weight: 800;
  letter-spacing:.2px;
  display: flex; align-items: center; justify-content: space-between;
}
#results-count { color: #5a7468; font-weight: 700; }

#list {
  list-style: none; padding: 10px 10px 16px; margin: 0;
  display: grid; gap: 10px;
}
.list-item {
  padding: 10px 12px; cursor: pointer;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px;
  border: 1px solid #e7efe9; border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(16,46,33,.06);
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.list-item:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(16,46,33,.12); background:#fbfffd; }
.list-item.active { background: #eef7f2; border-color:#cfe3d9; box-shadow: 0 8px 20px rgba(16,46,33,.12) inset; }
.name { font-weight: 800; color: #0f1a14; }
.meta { color: #6b7a70; font-size: 12px; margin-top: 3px; }

/* Badges + website button */
.right-actions { display: flex; align-items: center; gap: 8px; }
.chip-mini {
  display:inline-block; padding:4px 8px; border-radius:999px; font-size:11px;
  background:#eef2ff; color:#3730a3; border:1px solid #c7d2fe; white-space: nowrap;
}
.chip-mini.outdoor { background:#eaffea; border-color:#cfeecf; color:#175d1a; }

/* ✅ moved from inline styles inside JS template */
.chip-mini--restaurant { background:#fff7ed; border-color:#fed7aa; color:#9a3412; }
.chip-mini--lodging { background:#eff6ff; border-color:#bfdbfe; color:#1d4ed8; }

.website-btn {
  appearance: none; border:1px solid #dfe6e1; background:#ffffff;
  color:#20543c; padding:6px 8px; border-radius:8px; font-weight:700; font-size:12px;
  display:inline-flex; align-items:center; gap:6px; text-decoration:none;
  transition: transform .06s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
}
.website-btn:hover { background:#f3fbf7; border-color:#cfe3d9; box-shadow: 0 6px 16px rgba(16,46,33,.10); transform: translateY(-1px); }
.website-btn[aria-disabled="true"] { opacity:.45; pointer-events:none; }

/* Map pane */
#map { height: 100%; width: 100%; display:block; min-height: 300px; }

/* Floating AI controls */
.notice {
  position: absolute; z-index: 9999; left: 12px; top: 12px;
  background: rgba(255,255,255,0.95); border: 1px solid #ddd; padding: 8px 10px; border-radius: 10px;
  font: 14px/1.3 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
#ai-controls {
  position: absolute; z-index: 10000; right: 12px; top: 12px;
  background: rgba(255,255,255,0.9); border: 1px solid #d7e5dd; padding: 10px 12px; border-radius: 12px;
  font: 14px/1.3 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; box-shadow: 0 10px 26px rgba(28,91,63,.18);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
#ai-controls button {
  padding: 10px 14px; border-radius: 12px; border: 1px solid #2f7d55; cursor: pointer;
  background: linear-gradient(180deg, #369765, #2f7d55);
  color: #fff; font-weight: 650; letter-spacing: .25px;
  box-shadow: 0 8px 18px rgba(47,125,85,.22);
  transition: transform .08s ease, box-shadow .12s ease, filter .2s ease;
  animation: pulse 1.8s ease-in-out infinite;
}
#ai-controls button:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(47,125,85,.28); filter: brightness(1.03); }
@keyframes pulse { 0%,100% { box-shadow: 0 8px 18px rgba(47,125,85,.22); } 50% { box-shadow: 0 14px 30px rgba(47,125,85,.30); } }
.spinner { display:none; }

/* InfoWindow base fonts */
.gm-iw { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; line-height: 1.25; }
.gm-iw .label { font-weight: 600; }

/* Itinerary modal */
dialog { border: none; border-radius: 14px; padding: 16px; width: min(860px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,0.35); }
.row { display:flex; gap:10px; flex-wrap:wrap; }
.muted { color:#666; }

/* Emphasized option toggles */
.opt-toggles { display:flex; gap:10px; flex-wrap:wrap; }
.opt-toggle {
  display:inline-flex; align-items:center; gap:10px;
  border:2px solid #2f7d55; border-radius:999px; padding:8px 12px;
  background:#e9fbf1; color:#12422e; font-weight:800; letter-spacing:.2px;
  box-shadow: 0 6px 14px rgba(36,107,71,.10);
}
.opt-toggle input[type="checkbox"] { width:18px; height:18px; accent-color:#2f7d55; }

/* Must-hit checklist */
.musthits {
  border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px; background:#f8fafc;
  max-height: 220px; overflow: auto; width: 100%;
  box-shadow: inset 0 2px 8px rgba(16,46,33,.06);
}
.musthits .rowline{
  display:grid; grid-template-columns: auto 1fr; align-items:center;
  gap:10px; padding:6px 6px; border-radius:8px;
}
.musthits .rowline:hover { background:#eef2f7; }
.musthits input[type="checkbox"] { width:16px; height:16px; accent-color:#2f7d55; }

/* Itinerary output */
#itinerary-title { margin:12px 12px 0; font-family: ui-rounded, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; letter-spacing:.2px; }
#itinerary-output { display:none; margin:12px; padding:0; border:none; background: transparent; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; color:#eef6f1; }

.itinerary-card {
  position: relative;
  padding: 18px 18px 16px 18px;
  border: 1px solid #1e2a23;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.35);
  background:
    radial-gradient(38rem 22rem at 100% -10%, rgba(84,130,110,.30), transparent 65%),
    radial-gradient(36rem 24rem at -10% 110%, rgba(47,125,85,.28), transparent 60%),
    linear-gradient(180deg, #0b0f0d, #0b0f0d);
}
.itinerary-card::after {
  content:"";
  position:absolute; inset:0;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 2px, transparent 2px 4px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.02) 0 2px, transparent 60% 62%);
  mix-blend-mode: screen; pointer-events: none;
}
.itinerary h4 { margin: 14px 0 6px; font-size: 18px; font-weight: 800; color:#cde9dc; border-bottom: 1px dashed #2a3b32; padding-bottom: 4px; }
.itinerary ul { margin: 8px 0 8px 18px; }
.itinerary li { margin: 8px 0; line-height:1.5; color:#f3faf6; }
.itinerary li.travel { list-style: none; margin-left: 26px; padding-left: 2px; opacity:.95; font-style: italic; }

.chips { display:inline-flex; gap:8px; margin-left:10px; flex-wrap:wrap; }
.chip { display:inline-block; padding:4px 8px; border-radius:999px; font-size:12px; background:#132019; color:#d1efe0; border:1px solid #325444; text-decoration:none; transition: transform .06s ease, box-shadow .12s ease, background .2s ease; }
.chip:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,.45); background:#17271f; }
.tip { margin-top:12px; padding:10px 12px; border-radius: 10px; background:#0f1713; border:1px solid #1e2a23; color:#bfe7d4; font-size: 14px; }

/* ✅ NEW: Suggest-a-place panel (bottom-left, on top of map) */
#suggest-panel {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 11000;
  width: min(520px, calc(100vw - 24px));
  background: rgba(255,255,255,0.92);
  border: 1px solid #d7e5dd;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(28,91,63,.18);
  font: 14px/1.3 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  overflow: hidden;
  backdrop-filter: blur(4px);
}
#suggest-panel header {
  padding: 10px 12px;
  background: rgba(242,247,244,0.95);
  border-bottom: 1px solid #e5efe9;
  display:flex; align-items:center; justify-content:space-between;
  gap: 10px;
}
#suggest-title { font-weight: 850; letter-spacing:.2px; }
#suggest-toggle {
  appearance:none; border:1px solid #1f3a2b;
  background: linear-gradient(180deg, #22362b, #0f1a14);
  color:#e7f2ec;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(16,46,33,.12);
}
#suggest-body { padding: 10px 12px 12px; }
#suggest-body.collapsed { display:none; }

.sg-grid {
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.sg-grid .full { grid-column: 1 / -1; }
.sg-grid input, .sg-grid textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border: 1px solid #dfe6e1;
  border-radius: 10px;
  background: rgba(255,255,255,0.95);
  font-size: 13px;
  outline: none;
}
.sg-grid textarea { min-height: 72px; resize: vertical; }
.sg-actions { display:flex; align-items:center; gap: 10px; flex-wrap:wrap; margin-top: 10px; }
#suggest-submit {
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid #2f7d55;
  cursor: pointer;
  background: linear-gradient(180deg, #369765, #2f7d55);
  color: #fff;
  font-weight: 750;
  letter-spacing: .2px;
  box-shadow: 0 8px 18px rgba(47,125,85,.18);
}
#suggest-submit:disabled { opacity:.6; cursor:not-allowed; box-shadow:none; }

.status-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  font-weight:750;
  border: 1px solid #dfe6e1;
  background: rgba(255,255,255,.7);
  color: #0f1a14;
  white-space: nowrap;
}
.status-ok{ border-color: rgba(34,197,94,.35); background: rgba(220,252,231,.7); }
.status-bad{ border-color: rgba(239,68,68,.35); background: rgba(254,226,226,.7); color:#7f1d1d; }

.sg-help { margin-top: 6px; color:#6b7a70; font-size:12px; }

@media (max-width: 900px) {
  #app { grid-template-columns: 1fr; }
  #sidebar { display: none; }
  #suggest-panel { width: min(560px, calc(100vw - 24px)); }
}
@media (max-width: 560px) {
  .sg-grid { grid-template-columns: 1fr; }
}
