:root {
  --ink: #211a16;
  --muted: #706760;
  --paper: #f7f2ea;
  --card: #fffdf9;
  --line: #e8dfd4;
  --accent: #c84c2f;
  --accent-dark: #8c2f1c;
  --gold: #e8b65e;
  --green: #496b55;
  --shadow: 0 18px 48px rgba(60, 39, 24, 0.11);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --safe-bottom: max(18px, env(safe-area-inset-bottom));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--paper); }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 8%, rgba(232, 182, 94, 0.16), transparent 27rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-150%);
  padding: 10px 14px;
  background: white;
  border-radius: 10px;
}
.skip-link:focus { transform: translateY(0); }

.hero-shell {
  color: white;
  background:
    radial-gradient(circle at 78% 24%, rgba(232, 182, 94, 0.22), transparent 22rem),
    linear-gradient(145deg, #17120f 0%, #2d1d17 55%, #54291d 100%);
  border-radius: 0 0 36px 36px;
  overflow: hidden;
  box-shadow: 0 20px 70px rgba(42, 25, 16, 0.22);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px clamp(18px, 4vw, 42px) 4px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: white;
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 15px;
  background: rgba(255,255,255,.09);
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
}
.brand strong, .brand small { display: block; }
.brand small { color: rgba(255,255,255,.64); font-size: .72rem; }
.top-actions { display: flex; gap: 8px; }
.icon-button, .install-button {
  min-height: 42px;
  border: 1px solid rgba(255,255,255,.19);
  color: white;
  background: rgba(255,255,255,.08);
  border-radius: 14px;
  cursor: pointer;
}
.icon-button { width: 42px; font-size: 1.25rem; }
.install-button { padding: 0 14px; font-weight: 750; }

.hero {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 46px clamp(18px, 4vw, 42px) 54px;
  text-align: center;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: .75rem;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.eyebrow.dark { color: var(--accent); }
.hero h1 {
  max-width: 820px;
  margin: 0 auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.45rem, 8vw, 5.6rem);
  line-height: .98;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.hero > p:not(.eyebrow) {
  max-width: 670px;
  margin: 20px auto 0;
  color: rgba(255,255,255,.72);
  font-size: clamp(1rem, 2vw, 1.15rem);
}
.search-box {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  max-width: 680px;
  margin: 30px auto 0;
  padding: 10px 12px 10px 17px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 19px;
  background: rgba(255,255,255,.1);
  backdrop-filter: blur(15px);
  box-shadow: 0 15px 42px rgba(0,0,0,.18);
}
.search-box:focus-within { border-color: rgba(232,182,94,.8); box-shadow: 0 0 0 4px rgba(232,182,94,.12); }
.search-box > span { color: var(--gold); font-size: 1.6rem; }
.search-box input {
  width: 100%;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  outline: 0;
  color: white;
  background: transparent;
  font-size: 1rem;
}
.search-box input::placeholder { color: rgba(255,255,255,.54); }
kbd {
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  color: rgba(255,255,255,.55);
  background: rgba(0,0,0,.14);
  font-family: inherit;
  font-size: .72rem;
}
.hero-stats {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.hero-stats span {
  padding: 8px 12px;
  border-radius: 999px;
  color: rgba(255,255,255,.69);
  background: rgba(255,255,255,.07);
  font-size: .78rem;
}
.hero-stats strong { color: white; }

main {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 34px 0 calc(108px + var(--safe-bottom));
}
.view { display: none; animation: rise .3s ease; }
.view.is-active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 0 2px 18px;
}
.section-heading.compact { margin-top: 30px; }
.section-heading h2, .subheading {
  margin: 0;
  font-family: Georgia, serif;
  font-size: clamp(1.8rem, 5vw, 2.7rem);
  line-height: 1;
  letter-spacing: -.035em;
}
.text-button {
  border: 0;
  color: var(--accent-dark);
  background: transparent;
  font-size: .82rem;
  font-weight: 800;
  cursor: pointer;
}
.text-button.danger { color: #9e2e2e; }
.section-intro { max-width: 720px; margin: -5px 2px 22px; color: var(--muted); }

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.category-card {
  position: relative;
  min-height: 160px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(33,26,22,.07);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: 0 9px 24px rgba(58, 38, 25, .06);
  text-align: left;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.category-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -38px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200,76,47,.14), transparent 70%);
}
.category-card:hover, .category-card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); }
.category-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200,76,47,.11); }
.category-icon { font-size: 1.75rem; }
.category-card h3 { margin: 26px 0 7px; font-size: 1rem; line-height: 1.12; }
.category-card p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.38; }
.category-count {
  position: absolute;
  top: 17px;
  right: 17px;
  color: var(--accent-dark);
  font-size: .72rem;
  font-weight: 850;
}

.filter-panel {
  margin-top: 26px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255,253,249,.72);
}
.filter-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.filter-title-row h2 { margin: 0; font-size: 1rem; }
.result-count { color: var(--muted); font-size: .78rem; }
.chip-row {
  display: flex;
  gap: 8px;
  margin-top: 13px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.chip-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: white;
  font-size: .8rem;
  font-weight: 750;
  cursor: pointer;
}
.filter-chip.is-active { border-color: var(--ink); color: white; background: var(--ink); }

.sort-control { color: var(--muted); font-size: .72rem; font-weight: 700; }
.sort-control select {
  display: block;
  margin-top: 4px;
  padding: 8px 30px 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: white;
}
.results-grid { display: grid; gap: 13px; }
.place-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: 0 8px 25px rgba(66, 44, 27, .055);
  transition: transform .2s ease, box-shadow .2s ease;
}
.place-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.place-main { min-width: 0; cursor: pointer; }
.place-topline { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.category-mini-icon { font-size: 1rem; }
.place-location { color: var(--accent-dark); font-size: .72rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place-card h3 { margin: 0; font-family: Georgia, serif; font-size: 1.26rem; line-height: 1.08; letter-spacing: -.02em; }
.place-card p { display: -webkit-box; margin: 9px 0 12px; overflow: hidden; color: var(--muted); font-size: .86rem; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.meta-row { display: flex; flex-wrap: wrap; gap: 7px; }
.meta-pill {
  padding: 5px 8px;
  border-radius: 999px;
  color: #594d45;
  background: #f2ebe2;
  font-size: .68rem;
  font-weight: 750;
}
.card-actions { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 8px; }
.favorite-button, .more-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
  cursor: pointer;
}
.favorite-button { font-size: 1.15rem; }
.favorite-button.is-active { border-color: rgba(200,76,47,.25); color: var(--accent); background: rgba(200,76,47,.08); }
.more-button { color: var(--accent-dark); font-size: 1.2rem; }
.load-more {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--accent-dark);
  background: transparent;
  font-weight: 850;
  cursor: pointer;
}
.load-more[hidden] { display: none; }

.empty-state {
  padding: 58px 24px;
  border: 1px dashed #cfc1b4;
  border-radius: var(--radius-lg);
  text-align: center;
  background: rgba(255,255,255,.45);
}
.empty-state > span { font-size: 3rem; color: var(--accent); }
.empty-state h3 { margin: 10px 0 4px; font-family: Georgia, serif; font-size: 1.6rem; }
.empty-state p { max-width: 480px; margin: 0 auto 20px; color: var(--muted); }
.primary-button {
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  color: white;
  background: var(--accent);
  font-weight: 850;
  cursor: pointer;
}

.planner-days { display: grid; gap: 13px; }
.day-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
}
.day-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.day-header h3 { margin: 0; font-family: Georgia, serif; font-size: 1.4rem; }
.day-header span { color: var(--muted); font-size: .75rem; }
.day-items { display: grid; gap: 8px; margin-top: 12px; }
.plan-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 14px;
  background: #f6efe7;
}
.plan-item-icon { font-size: 1.1rem; }
.plan-item strong, .plan-item small { display: block; }
.plan-item strong { font-size: .83rem; }
.plan-item small { color: var(--muted); font-size: .69rem; }
.remove-plan {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  color: #933;
  background: rgba(153,51,51,.08);
  cursor: pointer;
}
.day-empty { margin: 13px 0 2px; color: var(--muted); font-size: .82rem; }

.info-card, .disclaimer-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
}
.hero-info { grid-template-columns: auto 1fr; align-items: center; }
.hero-info a { grid-column: 1 / -1; color: var(--accent-dark); font-weight: 850; text-decoration: none; }
.info-icon { font-size: 2rem; }
.info-card h3, .info-card p { margin: 0; }
.info-card p { color: var(--muted); font-size: .83rem; }
.transport-grid { display: grid; gap: 10px; margin-top: 12px; }
.transport-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(255,255,255,.72);
}
.transport-card h3 { margin: 0; font-size: .95rem; }
.transport-card strong { color: var(--accent-dark); }
.transport-card p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: .78rem; }
.subheading { margin: 32px 2px 14px; font-size: 1.9rem; }
.tips-grid { display: grid; gap: 10px; }
.tip-card { padding: 16px; border: 1px solid var(--line); border-radius: 17px; background: var(--card); }
.tip-card h3 { margin: 0 0 6px; font-size: .95rem; }
.tip-card p { margin: 0; color: var(--muted); font-size: .82rem; }
.disclaimer-card { margin-top: 20px; color: white; background: var(--ink); }
.disclaimer-card p { margin: 0; color: rgba(255,255,255,.67); font-size: .82rem; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(540px, calc(100% - 20px));
  padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 24px;
  background: rgba(255,253,249,.86);
  box-shadow: 0 18px 60px rgba(36, 23, 15, .25);
  backdrop-filter: blur(22px);
}
.nav-item {
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px 4px;
  border: 0;
  border-radius: 17px;
  color: var(--muted);
  background: transparent;
  font-size: .68rem;
  font-weight: 800;
  cursor: pointer;
}
.nav-item span { font-size: 1.18rem; }
.nav-item.is-active { color: white; background: var(--ink); }

.place-dialog {
  width: min(680px, calc(100% - 18px));
  max-height: min(88vh, 820px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 28px 28px 0 0;
  color: var(--ink);
  background: var(--card);
  box-shadow: 0 -15px 70px rgba(30,19,13,.28);
}
.place-dialog[open] { animation: sheetUp .25s ease; }
.place-dialog::backdrop { background: rgba(20,13,9,.58); backdrop-filter: blur(3px); }
@keyframes sheetUp { from { transform: translateY(18px); opacity: 0; } }
.dialog-grabber { width: 50px; height: 5px; margin: 10px auto 0; border-radius: 999px; background: #d7cec5; }
.dialog-close {
  position: sticky;
  top: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 7px 12px -47px auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,253,249,.94);
  font-size: 1.5rem;
  cursor: pointer;
}
.dialog-body { padding: 48px 22px 28px; }
.dialog-kicker { color: var(--accent); font-size: .75rem; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; }
.dialog-body h2 { margin: 8px 0 10px; font-family: Georgia, serif; font-size: clamp(2rem, 8vw, 3rem); line-height: 1; letter-spacing: -.035em; }
.dialog-location { color: var(--muted); font-size: .85rem; }
.dialog-description { margin: 22px 0; font-size: 1rem; }
.dialog-meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.dialog-meta div { padding: 13px; border-radius: 15px; background: #f3ece4; }
.dialog-meta small, .dialog-meta strong { display: block; }
.dialog-meta small { color: var(--muted); font-size: .68rem; }
.dialog-meta strong { margin-top: 3px; font-size: .9rem; }
.tip-box { margin-top: 15px; padding: 14px; border-left: 4px solid var(--gold); border-radius: 12px; background: #fbf4e7; }
.tip-box strong, .tip-box p { margin: 0; }
.tip-box p { margin-top: 4px; color: var(--muted); font-size: .84rem; }
.dialog-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.dialog-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 22px; }
.dialog-actions a, .dialog-actions button, .day-selector button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: white;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}
.dialog-actions .primary-link { border-color: var(--accent); color: white; background: var(--accent); }
.plan-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.plan-section h3 { margin: 0 0 11px; font-family: Georgia, serif; font-size: 1.35rem; }
.day-selector { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.day-selector button { min-height: 42px; font-size: .78rem; }
.day-selector button.is-added { border-color: var(--green); color: white; background: var(--green); }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(94px + var(--safe-bottom));
  z-index: 80;
  max-width: calc(100% - 36px);
  padding: 11px 15px;
  transform: translate(-50%, 18px);
  border-radius: 999px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
  font-size: .82rem;
  font-weight: 750;
  text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .planner-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .transport-grid, .tips-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .place-dialog { border-radius: 28px; margin: auto; }
  .bottom-nav { bottom: 18px; }
}

@media (min-width: 1020px) {
  .category-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .category-card { min-height: 190px; }
  .results-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .planner-days { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .transport-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tips-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bottom-nav { top: 50%; left: auto; right: 18px; bottom: auto; width: 82px; transform: translateY(-50%); grid-template-columns: 1fr; }
  main { padding-bottom: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.login-form { display: flex; flex-direction: column; gap: 16px; margin-top: 24px; margin-bottom: 80px; max-width: 400px; }
.text-input { font-family: inherit; font-size: 1.1rem; padding: 14px 20px; border-radius: 12px; border: 1px solid var(--surface-3); background: var(--surface-2); color: var(--text-1); outline: none; transition: border-color .2s, box-shadow .2s; }
.text-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(230, 81, 0, 0.2); }
.summary-grid { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 16px; }
.summary-user { background: var(--surface-1); padding: 16px; border-radius: 16px; border: 1px solid var(--surface-2); }

body:has(#loginView.is-active) .bottom-nav { display: none; }
body:has(input:focus) .bottom-nav { display: none; }
