:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --ink: #1a1a1a;
  --mute: #666;
  --line: #e5e3df;
  --accent: #ff385c;
  --accent-dark: #d8294b;
  --accent-soft: #ffe1e7;
  --good: #2f8a47;
  --warn: #b67e07;
  --bad: #bd3a3a;
  --good-bg: #e9f7ed;
  --warn-bg: #fff8e1;
  --bad-bg: #fdecec;
  --info-bg: #eaf3fe;
  --info-line: #88b6f0;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 6px 24px rgba(0,0,0,0.04);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Header */
header.top {
  background: linear-gradient(180deg, #fff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 36px 0 28px;
  margin-bottom: 32px;
}
header.top h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: -0.02em; }
header.top p.meta { margin: 0; color: var(--mute); font-size: 15px; }
header.top p.meta strong { color: var(--ink); }
.vote-status { font-size: 13px; margin-top: 12px !important; }
.link {
  background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0;
  font-size: inherit; font-family: inherit; text-decoration: underline;
}
.link:hover { color: var(--accent-dark); }

/* Sections */
main h2 { font-size: 22px; margin: 40px 0 16px; letter-spacing: -0.01em; }
main h2 .count { color: var(--mute); font-weight: 400; font-size: 15px; margin-left: 8px; }

/* Callouts */
.callout {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.callout.info { background: var(--info-bg); border-color: var(--info-line); }
.callout h3 { margin: 0 0 8px; font-size: 16px; }
.callout ol, .callout ul { margin: 0; padding-left: 22px; font-size: 14px; }
.callout li { margin: 6px 0; }

/* Controls */
.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  align-items: end;
}
.control { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.control label { font-size: 12px; color: var(--mute); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.control output { color: var(--ink); font-weight: 500; text-transform: none; letter-spacing: 0; }
.control select, .control input[type="range"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafafa;
  font-size: 14px;
  font-family: inherit;
}
.control input[type="range"] { padding: 0; height: 24px; }
.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; background: #f0f0f0;
  border: 1px solid var(--line); border-radius: 100px;
  font-size: 13px; cursor: pointer;
}
.chip input { margin: 0; }
.chip:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-dark); }

.btn {
  background: var(--accent); color: #fff;
  border: 0; padding: 10px 18px; border-radius: 8px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit;
}
.btn:hover { background: var(--accent-dark); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: #f0f0f0; }
.btn.primary { background: var(--accent); }

/* Map */
#map {
  height: 420px;
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 0;
}
.leaflet-popup-content-wrapper { border-radius: 10px; }
.leaflet-popup-content {
  margin: 10px 14px; font-family: inherit; font-size: 13px;
}
.leaflet-popup-content h4 { margin: 0 0 4px; font-size: 14px; }
.leaflet-popup-content p { margin: 2px 0; color: var(--mute); }
.leaflet-popup-content a { color: var(--accent); text-decoration: none; font-weight: 500; }

/* Listing list */
.listing-list { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 900px) { .listing-list { grid-template-columns: repeat(2, 1fr); } }

.listing {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}
.listing-hero {
  position: relative;
  aspect-ratio: 16/10;
  background: #ddd;
  cursor: zoom-in;
}
.hero-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.fit-badge {
  position: absolute;
  top: 14px; left: 14px;
  background: rgba(0,0,0,0.75); color: #fff;
  padding: 4px 10px; border-radius: 100px;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.fit-badge.best  { background: var(--good); }
.fit-badge.good  { background: rgba(0,0,0,0.75); }
.fit-badge.tight { background: var(--warn); }
.fit-badge.poor  { background: var(--bad); }

.vote-btn {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(255,255,255,0.95);
  border: 0;
  padding: 8px 12px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: all 0.15s ease;
  font-family: inherit;
}
.vote-btn:hover { transform: scale(1.05); }
.vote-btn .vote-icon { color: var(--mute); transition: color 0.15s; }
.vote-btn[aria-pressed="true"] { background: var(--accent); color: #fff; }
.vote-btn[aria-pressed="true"] .vote-icon { color: #fff; }
.vote-count { background: rgba(0,0,0,0.1); padding: 1px 7px; border-radius: 100px; font-size: 11px; min-width: 18px; text-align: center; }
.vote-btn[aria-pressed="true"] .vote-count { background: rgba(255,255,255,0.25); }

.listing-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }

.listing-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
}
.listing-header h3 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.listing-header .t-sub { margin: 2px 0 0; color: var(--mute); font-size: 13px; }
.price-block { text-align: right; flex-shrink: 0; }
.price-block .t-price { display: block; font-weight: 700; color: var(--accent); font-size: 20px; }
.price-block .t-pernight { display: block; color: var(--mute); font-size: 12px; }

.kv-grid dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  margin: 0; font-size: 13.5px;
}
.kv-grid dt { color: var(--mute); }
.kv-grid dd { margin: 0; }

.rooms-details summary {
  cursor: pointer; color: var(--mute); font-size: 13px; padding: 4px 0;
}
.rooms-details[open] summary { color: var(--ink); }
.rooms-list { margin: 6px 0 0; padding-left: 20px; font-size: 13px; }
.rooms-list li { margin: 3px 0; }
.rooms-list strong { font-weight: 600; }

.prosCons { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; font-size: 13px; }
.prosCons h4 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mute); }
.prosCons ul { margin: 0; padding-left: 0; list-style: none; }
.prosCons li { margin: 4px 0; padding-left: 16px; position: relative; }
.pros li::before { content: "✓"; color: var(--good); position: absolute; left: 0; font-weight: 700; }
.cons li::before { content: "!"; color: var(--warn); position: absolute; left: 4px; font-weight: 700; }

.thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.thumbs img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px;
  cursor: zoom-in; transition: opacity 0.15s;
  background: #ddd;
}
.thumbs img:hover { opacity: 0.85; }

.listing-actions { display: flex; gap: 10px; }

/* Comparison table */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.compare { width: 100%; border-collapse: collapse; font-size: 14px; }
table.compare th, table.compare td {
  padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.compare th { background: #fafafa; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mute); }
table.compare tr:last-child td { border-bottom: 0; }
table.compare a { color: var(--accent); text-decoration: none; font-weight: 500; }
table.compare a:hover { text-decoration: underline; }
table.compare td.highlight { background: var(--accent-soft); font-weight: 600; }

.pill { display: inline-block; padding: 2px 8px; border-radius: 100px; font-size: 11px; font-weight: 600; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad  { background: var(--bad-bg);  color: var(--bad); }

footer {
  margin-top: 60px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 12px;
  background: var(--card);
}

/* Lightbox */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from {opacity:0;} to {opacity:1;} }
.lightbox[hidden] { display: none; }
.lb-img { max-width: 92vw; max-height: 86vh; object-fit: contain; user-select: none; }
.lb-close, .lb-prev, .lb-next {
  position: absolute; background: rgba(255,255,255,0.12); color: #fff;
  border: 0; cursor: pointer; font-size: 32px; line-height: 1;
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.lb-close:hover, .lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,0.25); }
.lb-close { top: 20px; right: 20px; font-size: 36px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-counter { position: absolute; bottom: 24px; left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; opacity: 0.8; }

@media (max-width: 600px) {
  .lb-prev, .lb-next, .lb-close { width: 44px; height: 44px; font-size: 24px; }
  .lb-close { top: 14px; right: 14px; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}

/* Name dialog */
dialog#nameDialog {
  border: 0; border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: 0 20px 80px rgba(0,0,0,0.3);
  max-width: 90vw; width: 380px;
  font-family: inherit;
}
dialog#nameDialog::backdrop { background: rgba(0,0,0,0.4); }
dialog#nameDialog h3 { margin: 0 0 6px; font-size: 18px; }
dialog#nameDialog input {
  width: 100%; padding: 10px 12px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 8px; margin: 12px 0 16px;
  font-family: inherit;
}
dialog#nameDialog input:focus { border-color: var(--accent); outline: none; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Leaderboard */
.leaderboard {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
}
.leader-row {
  display: grid;
  grid-template-columns: 38px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s;
}
.leader-row:hover { background: #fafafa; }
.leader-rank { color: var(--mute); font-weight: 700; font-size: 13px; }
.leader-bar-wrap {
  position: relative;
  height: 30px;
  background: #f4f4f4;
  border-radius: 6px;
  overflow: hidden;
}
.leader-bar {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--accent-soft), #ffd0db);
  border-radius: 6px;
}
.leader-name {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leader-name small { font-weight: 400; color: var(--mute); margin-left: 6px; }
.leader-count {
  font-weight: 700;
  color: var(--accent);
  font-size: 15px;
  min-width: 50px;
  text-align: right;
}
.leader-voters {
  font-size: 12px;
  color: var(--mute);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 700px) {
  .leader-row { grid-template-columns: 28px 1fr auto; }
  .leader-voters { display: none; }
}

/* Vote tally pill on each listing */
.vote-tally-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.vote-tally-pill .vote-tally-num {
  background: var(--accent);
  color: #fff;
  padding: 0 6px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}
.vote-tally-pill .vote-tally-voters {
  font-weight: 400;
  color: var(--mute);
}

/* Vote hint toast */
.vote-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 6px 24px rgba(0,0,0,0.2);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 1100;
  max-width: 90vw;
  text-align: center;
}
.vote-hint.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Mobile */
@media (max-width: 700px) {
  .listing-header { flex-direction: column; gap: 6px; }
  .price-block { text-align: left; }
  .prosCons { grid-template-columns: 1fr; gap: 12px; }
  header.top h1 { font-size: 26px; }
  main h2 { font-size: 19px; }
}
