:root {
  --primary: #1a7a5e;
  --primary-dark: #145e48;
  --bg: #f7f8f6;
  --card-bg: #ffffff;
  --text: #1e2321;
  --text-muted: #66716c;
  --border: #e1e5e2;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo { margin: 0; font-size: 1.25rem; }

.lang-toggle {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 999px;
  padding: 6px 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.panel {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.field-row {
  display: flex;
  gap: 12px;
}

.field {
  flex: 1;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }

select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 0.95rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  padding: 4px 0 16px;
  cursor: pointer;
  font-size: 0.9rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  user-select: none;
}

.chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.primary-btn {
  width: 100%;
  margin-top: 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.primary-btn:disabled { opacity: 0.6; cursor: default; }
.primary-btn:hover:not(:disabled) { background: var(--primary-dark); }

.summary {
  margin-top: 20px;
  padding: 14px 18px;
  background: #eaf5f0;
  border-radius: var(--radius);
  color: var(--primary-dark);
  font-weight: 600;
}

.results {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.card-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #dfe4e0;
}

.card-img.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.card-body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.card-title { font-weight: 700; font-size: 1rem; }
.card-addr { font-size: 0.78rem; color: var(--text-muted); }
.card-blurb { font-size: 0.85rem; color: var(--text); line-height: 1.4; }

.state {
  margin-top: 30px;
  text-align: center;
  color: var(--text-muted);
}

.hidden { display: none !important; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal-content {
  background: #fff;
  width: 100%;
  max-width: 720px;
  border-radius: 20px 20px 0 0;
  padding: 24px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}

@media (min-width: 760px) {
  .modal { align-items: center; }
  .modal-content { border-radius: var(--radius); }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1rem;
}

.modal-img {
  width: 100%;
  border-radius: 12px;
  margin-bottom: 14px;
  max-height: 280px;
  object-fit: cover;
}

.modal-title { font-size: 1.2rem; font-weight: 700; margin: 0 0 6px; }
.modal-addr { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 14px; }
.modal-overview { line-height: 1.6; font-size: 0.95rem; white-space: pre-line; }
