:root {
  --bg-page: #f1f5f9;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent: #0284c7;
  --accent-hover: #0369a1;
  --border-color: #e2e8f0;
  --danger-bg: #fef2f2;
  --danger-text: #b91c1c;
  --danger-border: #fecaca;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.site-header {
  background-color: #0f172a;
  color: #ffffff;
  border-bottom: 1px solid #1e293b;
  padding: 1rem 1.5rem;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
}

.brand { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.brand-icon { display: flex; flex-shrink: 0; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3)); }
.brand h1 { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.brand p { margin: 0; font-size: 0.825rem; color: #94a3b8; }

/* Intro */
.intro-banner { max-width: 1400px; margin: 1.25rem auto 0; padding: 0 1rem; }

.intro-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow-sm);
}

.intro-card h2 { margin: 0 0 0.35rem; font-size: 1.05rem; font-weight: 700; }
.intro-card p { margin: 0; font-size: 0.925rem; color: var(--text-secondary); line-height: 1.6; }

.intro-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.intro-step { display: flex; align-items: flex-start; gap: 0.45rem; }

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background-color: #e0f2fe;
  color: var(--accent-hover);
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Layout */
.container {
  max-width: 1400px;
  margin: 1.25rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 1.5rem;
  align-items: start;
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  min-width: 0;
}

/* Search */
.map-toolbar { padding: 1.25rem; border-bottom: 1px solid var(--border-color); }
.search-form { display: flex; gap: 0.5rem; max-width: 600px; }
.search-input-wrap { position: relative; flex: 1; min-width: 0; }

.search-input-wrap i {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

#address {
  width: 100%;
  padding: 0.65rem 0.9rem 0.65rem 2.4rem;
  font-family: inherit;
  font-size: 16px; /* stops iOS zooming on focus */
  color: var(--text-primary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

#address:focus {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.btn-search {
  padding: 0.65rem 1.25rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  background-color: var(--accent);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.15s, transform 0.05s;
  white-space: nowrap;
}

.btn-search:hover { background-color: var(--accent-hover); }
.btn-search:active { transform: translateY(1px); }

#permalink:not(:empty) { margin-top: 0.75rem; font-size: 0.9rem; }
#permalink a { color: var(--accent-hover); }
#permalink img { vertical-align: middle; margin-right: 0.35rem; }

#status:not(:empty) {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--danger-text);
  background-color: var(--danger-bg);
  border: 1px solid var(--danger-border);
  border-radius: 8px;
}

/* Map */
.map-wrapper { position: relative; background: #e2e8f0; }

#map {
  width: 100%;
  height: 68vh;
  min-height: 460px;
  max-height: 780px;
}

.camera-popup { min-width: 12em; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.sidebar-card { padding: 1.25rem; }

.hero-thumb {
  display: flex;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.hero-thumb img { max-width: 100%; height: auto; max-height: 140px; border-radius: 6px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.section-title i { color: var(--accent); font-size: 1rem; }

.legend-list, .related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.legend-list { gap: 0.6rem; }
.related-list { gap: 0.45rem; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem;
  background: var(--bg-subtle);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.legend-item img { width: 24px; height: 24px; object-fit: contain; flex-shrink: 0; }

.divider { border: 0; border-top: 1px solid var(--border-color); margin: 1.25rem 0; }

.related-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 8px;
  background: var(--bg-subtle);
  transition: background-color 0.15s, color 0.15s;
}

.related-list a:hover { background: #e0f2fe; color: var(--accent-hover); }
.related-list a i { font-size: 0.75rem; opacity: 0.6; }

.fb-like, .fb-like span, .fb-like iframe { max-width: 100% !important; }

/* Footer */
.site-footer {
  max-width: 1400px;
  margin: 2rem auto 1.5rem;
  padding: 1.25rem 1rem 0;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: var(--text-secondary); text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--accent); text-decoration: underline; }

@media (max-width: 960px) {
  .container { grid-template-columns: minmax(0, 1fr); }
  #map { height: 60vh; min-height: 380px; }
  .hero-thumb { display: none; }
}

@media (max-width: 480px) {
  .site-header { padding: 0.85rem 1rem; }
  .intro-banner { margin-top: 1rem; }
  .intro-card { padding: 1rem; }
  .container { margin: 1rem auto; gap: 1rem; }
  .map-toolbar { padding: 0.9rem; }
  .search-form { flex-direction: column; }
  .btn-search { width: 100%; }
  #map { height: 55vh; min-height: 340px; }
}
