:root {
  --bg: #0b1020;
  --bg-2: #0f1630;
  --panel: #141c38;
  --panel-2: #1a2444;
  --line: #26304f;
  --line-soft: #1e2843;
  --text: #eef2fb;
  --muted: #9aa6c4;
  --dim: #6b7699;
  --accent: #3b82f6;
  --accent-2: #22d3ee;
  --good: #34d399;
  --star: #fbbf24;
  --radius: 16px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(59, 130, 246, .18), transparent 60%),
    radial-gradient(900px 500px at 0% 0%, rgba(34, 211, 238, .10), transparent 55%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.5;
}

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; backdrop-filter: blur(8px);
  background: rgba(11, 16, 32, .6); z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .04em; }
.brand-mark { color: var(--accent-2); font-size: 20px; }
.brand-name { font-size: 20px; }
.topbar-tag { color: var(--dim); font-size: 13px; }

main { max-width: 960px; margin: 0 auto; padding: 40px 20px 60px; }

/* ---- hero ---- */
.hero { text-align: center; margin-bottom: 30px; }
.hero h1 {
  font-size: clamp(28px, 5vw, 44px); font-weight: 800; margin: 0 0 12px;
  background: linear-gradient(120deg, #fff, #b8c6ee 60%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { color: var(--muted); max-width: 640px; margin: 0 auto; font-size: 16px; }

/* ---- form ---- */
.planner {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); display: grid; gap: 20px;
}
.field { display: grid; gap: 8px; }
.field > label { font-weight: 600; font-size: 14px; color: var(--text); }
.hint { color: var(--dim); font-weight: 400; font-size: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

select {
  appearance: none; width: 100%; padding: 12px 14px; border-radius: 12px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  font-size: 15px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa6c4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--muted); cursor: pointer; font-size: 14px;
  font-weight: 500; transition: all .15s ease; user-select: none;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.on {
  background: linear-gradient(120deg, var(--accent), #2563eb); color: #fff;
  border-color: transparent; box-shadow: 0 4px 14px rgba(59, 130, 246, .4);
}

.go {
  width: 100%; padding: 15px; border: none; border-radius: 12px; cursor: pointer;
  font-size: 16px; font-weight: 700; color: #fff;
  background: linear-gradient(120deg, var(--accent), #2563eb);
  box-shadow: 0 8px 24px rgba(59, 130, 246, .35); transition: transform .1s ease, filter .15s;
}
.go:hover { filter: brightness(1.08); }
.go:active { transform: translateY(1px); }
.go:disabled { opacity: .6; cursor: progress; }

.formerror {
  margin: 0; color: #fecaca; background: rgba(190, 40, 40, .18);
  border: 1px solid rgba(239, 68, 68, .4); padding: 10px 14px; border-radius: 10px; font-size: 14px;
}

/* ---- results ---- */
.results { margin-top: 34px; display: grid; gap: 22px; }
.results-head h2 { margin: 0 0 4px; font-size: 24px; }
.results-head .meta { color: var(--muted); font-size: 14px; }
.results-head .stay {
  margin-top: 12px; display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px; border-radius: 10px; text-decoration: none; font-size: 14px; font-weight: 600;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
}
.results-head .stay:hover { border-color: var(--good); }

.day { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.day-head {
  display: flex; align-items: center; gap: 12px; padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(90deg, rgba(59, 130, 246, .10), transparent);
}
.day-num {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 800; background: linear-gradient(120deg, var(--accent), #2563eb); color: #fff; font-size: 15px;
}
.day-head .day-title { font-weight: 700; font-size: 16px; }
.day-head .day-count { color: var(--dim); font-size: 13px; margin-left: auto; }

.place { display: grid; gap: 6px; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); }
.place:last-child { border-bottom: none; }
.place-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.place-name { font-weight: 600; font-size: 16px; }
.tag {
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
  padding: 3px 8px; border-radius: 6px; background: rgba(34, 211, 238, .14); color: var(--accent-2);
}
.rating { color: var(--star); font-weight: 600; font-size: 14px; margin-left: auto; white-space: nowrap; }
.why { color: var(--muted); font-size: 14px; }
.why.quote { font-style: italic; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.link {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 9px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); transition: all .15s;
}
.link:hover { border-color: var(--accent); transform: translateY(-1px); }
.link.maps { color: var(--muted); }
.link.book::before { content: "→"; color: var(--good); }

.empty { padding: 18px 20px; color: var(--dim); font-style: italic; }

/* ---- loading ---- */
.loading { display: grid; place-items: center; gap: 14px; padding: 40px; color: var(--muted); }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.foot {
  text-align: center; padding: 30px 20px; color: var(--dim); font-size: 13px;
  border-top: 1px solid var(--line-soft); display: grid; gap: 4px;
}
.foot-dim { color: #4b5474; }

@media (max-width: 560px) {
  .topbar-tag { display: none; }
  main { padding: 26px 14px 50px; }
  .rating { margin-left: 0; width: 100%; }
}
