:root {
  --bg: #fbfaf7;
  --card: #ffffff;
  --ink: #1b1a17;
  --ink-2: #4a4740;
  --muted: #7a756b;
  --line: #e8e4da;
  --line-2: #f1eee6;
  --accent: #146c56;
  --accent-ink: #0d4a3b;
  --accent-soft: #e6f2ee;
  --warm: #a8541f;
  --warm-soft: #fbf0e6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 26, 23, .04), 0 6px 18px -10px rgba(27, 26, 23, .16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

h1, h2, h3, p { margin: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- header ---------- */
.hd {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 18px 20px 16px;
}

.hd-in { max-width: 1080px; margin: 0 auto; }

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--accent-ink);
}

.tagline {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.banner {
  max-width: 1080px;
  margin: 12px auto 0;
  padding: 10px 14px;
  background: var(--warm-soft);
  border: 1px solid #f0dcc8;
  border-radius: 10px;
  color: var(--warm);
  font-size: 13px;
}

/* ---------- layout ---------- */
.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 20px 40px;
  display: grid;
  gap: 22px;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .wrap {
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: start;
    gap: 28px;
  }
  .panel { position: sticky; top: 18px; }
}

/* ---------- filter panel ---------- */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.panel-head h2 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.link-btn {
  background: none;
  border: 0;
  padding: 4px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-btn:hover { color: var(--ink); }

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.field > label,
.field > .label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
  letter-spacing: .01em;
}

.opt {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  margin-left: 2px;
}

select, input[type="number"] {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  appearance: none;
  outline: none;
  transition: border-color .15s;
}

select {
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' fill='none' stroke='%237a756b' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
}

select:focus, input:focus { border-color: var(--accent); }

.input-wrap { position: relative; }

.input-wrap input { padding-right: 40px; }

.unit {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--muted);
  pointer-events: none;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: 6px;
}

.seg {
  display: flex;
  gap: 4px;
  background: var(--line-2);
  padding: 3px;
  border-radius: 10px;
}

.seg button {
  flex: 1;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.seg button.on {
  background: #fff;
  color: var(--accent-ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(27, 26, 23, .08);
}

/* ---------- results ---------- */
.res-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.res-head h2 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.res-meta {
  font-size: 12px;
  color: var(--muted);
}

.excluded {
  font-size: 12px;
  color: var(--warm);
  background: var(--warm-soft);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

@media (min-width: 640px) {
  .list { grid-template-columns: 1fr 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.4;
}

.card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.rec {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid #cfe5dd;
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
}

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

.chip {
  font-size: 11px;
  color: var(--ink-2);
  background: var(--line-2);
  border-radius: 999px;
  padding: 3px 8px;
  white-space: nowrap;
}

.chip.warn { background: var(--warm-soft); color: var(--warm); }

.reasons {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--line-2);
  padding-top: 10px;
}

.reasons li {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  padding-left: 13px;
  position: relative;
}

.reasons li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .55;
}

.actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}

.btn {
  flex: 1;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.btn:hover { border-color: var(--accent); color: var(--accent-ink); text-decoration: none; }

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover { background: var(--accent-ink); color: #fff; }

details.more {
  border-top: 1px solid var(--line-2);
  padding-top: 8px;
}

details.more summary {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  outline: none;
}

details.more summary::-webkit-details-marker { display: none; }

details.more summary::after {
  content: " +";
  color: var(--muted);
}

details.more[open] summary::after { content: " −"; }

.facts {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 4px 10px;
  margin-top: 10px;
  font-size: 12px;
}

.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--ink-2); }

.yes { color: var(--accent-ink); font-weight: 600; }
.no { color: var(--muted); }

.empty {
  text-align: center;
  padding: 48px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--ink-2);
}

/* ---------- footer ---------- */
.ft {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.ft-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.ft-note strong { color: var(--ink-2); font-weight: 600; }

.ft-copy {
  font-size: 11px;
  color: #9c968b;
  margin-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------------- 내 주변 놀이터 ---------------- */
.sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.nearby { margin-top: 32px; }

.near-controls {
  display: flex; gap: 8px; align-items: center;
  margin: 4px 0 8px; flex-wrap: wrap;
}
.near-controls select {
  padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg); color: inherit;
  font-size: 14px;
}
.near-controls .btn { padding: 9px 14px; }

.near-hint { margin: 0 0 12px; }

.card.pl .card-sub { margin-top: 2px; }
.card.pl .chip { align-self: flex-start; }

@media (max-width: 560px) {
  .near-controls { flex-direction: column; align-items: stretch; }
  .near-controls .btn, .near-controls select { width: 100%; }
}

/* ---------------- 정보 정정 시트 ---------------- */
.sheet {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  max-width: 420px;
  width: calc(100% - 32px);
  background: var(--bg);
  color: inherit;
}
.sheet::backdrop { background: rgba(20, 18, 14, .45); }
.sheet h3 { margin: 0 0 4px; font-size: 17px; }

.report-fields {
  border: 0; padding: 0; margin: 14px 0 10px;
  display: grid; gap: 6px;
}
.report-fields legend { margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.report-fields label {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; cursor: pointer;
}
.report-fields label:has(input:checked) {
  border-color: var(--accent); color: var(--accent-ink);
  background: var(--accent-soft, rgba(180, 120, 60, .08));
}

.report-note-label { display: block; font-size: 13px; color: var(--muted); margin: 6px 0 4px; }
.sheet textarea {
  width: 100%; box-sizing: border-box; resize: vertical;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: inherit; font-size: 14px; background: var(--bg); color: inherit;
}
.report-msg { margin: 10px 0 0; font-size: 13px; color: var(--accent-ink); }
.report-msg.err { color: #b4453a; }
.btn.ghost { background: transparent; }
