@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --primary: #d72d46;
  --primary-hover: #b92238;
  --bg-color: #4C658A;
  --text-dark: #0f172a;
  --text-body: #475569;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --bg-light: #f8fafc;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-color);
  color: var(--text-dark);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

.layout-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  width: 100%;
  height: 56px;
  background: #fff;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1100;
}
@media (min-width: 640px) { header { padding: 0 48px; } }

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.125rem;
  color: #1e293b;
  text-decoration: none;
  letter-spacing: -0.025em;
  transition: opacity 0.2s;
}
.brand:hover { opacity: 0.8; }
.brand-icon {
  width: 26px;
  height: 26px;
  display: block;
  border-radius: 7px;
}

.lang-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 4px 8px;
  border-radius: 4px;
  user-select: none;
}

.main-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  flex: 1;
}
@media (min-width: 640px) { .main-wrapper { padding: 24px; } }
@media (min-width: 1024px) { .main-wrapper { padding: 40px; } }

main {
  width: 100%;
  max-width: 896px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  padding: 24px;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
@media (min-width: 640px) { main { padding: 40px; } }
@media (min-width: 1024px) { main { padding: 56px; } }

/* Hero / Search Landing */
.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 16px 80px;
  min-height: 45vh;
}

.badge {
  display: inline-block;
  padding: 4px 12px;
  margin-bottom: 24px;
  border-radius: 9999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid #e2e8f0;
}

.hero-container h1 {
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 24px;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

.sm-block { display: none; }
@media (min-width: 640px) { .sm-block { display: block; } }

.hero-container .intro {
  color: var(--text-muted);
  margin: 0 0 48px;
  max-width: 32rem;
  font-size: 1.125rem;
  line-height: 1.625;
}

.search-container {
  width: 100%;
  max-width: 36rem;
  text-align: left;
}

.search-container label, .search-box-wrap label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
  padding: 0 4px;
}

.search-box-wrap {
  margin-bottom: 40px;
  padding: 20px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
}

.search {
  position: relative;
  width: 100%;
}

input {
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #fff;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-dark);
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
input::placeholder { color: #94a3b8; }
input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(215, 45, 70, 0.1);
}

#suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: white;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-top: 4px;
  z-index: 10;
  border: 1px solid var(--border-color);
}
#suggestions:empty { display: none; border: none; }

.suggestion {
  display: block;
  width: 100%;
  border: 0;
  background: white;
  text-align: left;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text-dark);
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}
.suggestion:last-child { border-bottom: none; }
.suggestion:hover, .suggestion:focus { background: #f8fafc; }

.try-links {
  margin-top: 64px;
  display: flex;
  gap: 16px;
  font-size: 0.875rem;
  color: #94a3b8;
  font-weight: 500;
}
.try-links a {
  color: #94a3b8;
  text-decoration: none;
  transition: color 0.2s;
}
.try-links a:hover {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.content-sections {
  margin-top: 72px;
  max-width: 48rem;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 48px;
}

.seo-section { margin-bottom: 52px; }
.seo-section h2 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 24px;
  letter-spacing: -0.025em;
}

.prose {
  color: var(--text-body);
  font-size: 1.125rem;
  line-height: 1.75;
}
.prose p { margin-top: 0; margin-bottom: 16px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text-dark); font-weight: 600; }
.prose a,
.result-meta a {
  color: #294f7d;
  font-weight: 600;
  text-decoration-color: rgba(41, 79, 125, 0.35);
  text-underline-offset: 3px;
}
.prose a:hover,
.result-meta a:hover { color: var(--primary); }

.accordion { width: 100%; }
.accordion details { border-bottom: 1px solid var(--border-color); }
.accordion details:first-child { border-top: 1px solid var(--border-color); }
.accordion summary {
  padding: 16px 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s;
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary:hover { color: var(--primary); }
.accordion summary:after {
  content: "+";
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-muted);
}
.accordion details[open] summary:after { content: "−"; }

.details-content {
  padding-bottom: 16px;
  color: var(--text-body);
  font-size: 1rem;
  line-height: 1.625;
}
.details-content p { margin: 0 0 12px; }
.details-content p:last-child { margin-bottom: 0; }

/* Result Page */
.result-header { margin-bottom: 24px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}
.back-link:hover { color: var(--text-dark); }

.result-title-section { margin-bottom: 32px; position: relative; }
.title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.title-row h1 {
  font-size: clamp(1.875rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
  letter-spacing: -0.025em;
  line-height: 1.25;
}
.share-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-body);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  transition: background 0.2s;
  font-family: inherit;
}
.share-btn:hover { background: var(--bg-light); }
@media (min-width: 640px) { .share-btn { display: flex; } }

.result-meta {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}
.star-icon {
  color: #facc15;
  flex-shrink: 0;
  margin-top: 4px;
}
.result-meta p {
  margin: 0;
  color: #334155;
  font-size: 1.125rem;
  line-height: 1.625;
  max-width: 46rem;
}
.result-meta strong {
  color: var(--text-dark);
  font-weight: 700;
}

.map-section { margin-bottom: 48px; }
.map-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.map-header h2 { margin: 0; font-size: 1.25rem; font-weight: 700; color: var(--text-dark); }
.map-hint { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); }

#map {
  height: 430px;
  background: var(--bg-light);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
@media (max-width: 640px) { #map { height: 300px; } }
.map-fallback { padding: 25px; color: var(--text-muted); text-align: center; }

.selected-city-marker {
  background: transparent;
  border: 0;
}
.selected-city-marker__dot {
  position: relative;
  display: block;
  width: 26px;
  height: 26px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: var(--primary);
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.38);
  transform: rotate(-45deg);
}
.selected-city-marker__dot::after {
  content: "";
  position: absolute;
  width: 7px;
  height: 7px;
  top: 6.5px;
  left: 6.5px;
  border-radius: 50%;
  background: #fff;
}
.leaflet-control-layers {
  border: 0 !important;
  border-radius: 8px !important;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.2) !important;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

.city-stats {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  background: var(--bg-light);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #f1f5f9;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text-muted);
}
.city-stats > span { display: flex; align-items: center; gap: 8px; }
.stat-label { color: #94a3b8; }

.table-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 16px;
}
.table-wrap {
  max-height: 520px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  scrollbar-gutter: stable;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}
th {
  padding: 12px 16px;
  background: var(--bg-light);
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  box-shadow: 0 1px 0 var(--border-color);
}
tbody th {
  background: transparent;
  font-weight: normal;
  color: var(--text-dark);
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
  white-space: nowrap;
}
tr:last-child td, tr:last-child th { border-bottom: none; }
th.right, td.right { text-align: right; }
td.font-mono, th.font-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.8125rem; }
th a {
  color: var(--text-dark);
  font-weight: 500;
  text-decoration: none;
}
th a:hover { text-decoration: underline; }

.border-top {
  border-top: 1px solid var(--border-color);
  margin-top: 52px;
  padding-top: 36px;
}
.result-about-section { margin-bottom: 48px; }
.result-about-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 20px;
  letter-spacing: -0.025em;
}
.result-about-section .prose { font-size: 1rem; }
.result-faq {
  margin-bottom: 0;
}
.result-faq h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
}

@media (max-width: 640px) {
  .hero-container { padding: 28px 4px 52px; }
  .content-sections { margin-top: 52px; padding-bottom: 24px; }
  .seo-section { margin-bottom: 42px; }
  .seo-section h2 { font-size: 1.55rem; margin-bottom: 18px; }
  .prose { font-size: 1rem; line-height: 1.7; }
  .result-title-section { margin-bottom: 28px; }
  .map-header { align-items: flex-start; gap: 12px; }
  .map-hint { text-align: right; max-width: 12rem; }
}

footer {
  text-align: center;
  padding: 0 0 24px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
}
footer a { color: white; text-decoration: underline; text-underline-offset: 4px; }
footer a:hover { color: #94c8ff; }
