.village-heading {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:40px;
  padding:58px 0 42px
}
.village-heading .page-title {
  font-size:clamp(36px,4.2vw,54px);
  line-height:1.24
}
.village-postcard {
  display:flex;
  flex-direction:column;
  gap:20px;
  border:1px solid #ddd7c7;
  background:#f0eee3;
  padding:26px 30px;
  transform:rotate(3deg);
  min-width:222px;
  box-shadow:5px 6px 0 #e7e3d6
}
.village-postcard span {
  font-size:10px;
  letter-spacing:1px
}
.village-postcard span:last-child {
  color:var(--accent);
  letter-spacing:0;
  font-size:12px
}
.village-postcard strong {
  font-size:21px;
  line-height:1.5
}
.village-town {
  border:1px solid #cbcbbd;
  border-radius:8px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 16px 40px #29292108
}
.town-top {
  background:#efeee5;
  border-bottom:1px solid #cbcbbd;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:15px 22px
}
.town-top>div {
  display:flex;
  align-items:center;
  gap:10px
}
.town-mark {
  background:var(--ink);
  color:white;
  padding:0 5px;
  font:bold 14px monospace
}
.town-en {
  font-size:9px;
  letter-spacing:1.4px;
  margin-left:5px
}
.town-top>[role=status] {
  font-size:11px;
  color:var(--good)
}
.town-workspace {
  display:grid;
  grid-template-columns:242px minmax(0,1fr)
}
.town-guide {
  background:#f7f6ef;
  padding:26px 22px;
  border-right:1px solid var(--line)
}
.town-guide .eyebrow {
  font-size:8px;
  margin-bottom:15px
}
.town-guide h2 {
  font-size:17px;
  letter-spacing:-.05em;
  margin:0
}
.town-guide>p:not(.eyebrow) {
  font-size:12px;
  color:var(--muted);
  margin:10px 0 22px
}
.town-stats {
  display:grid;
  grid-template-columns:1fr 1fr;
  border-top:1px solid var(--line);
  border-bottom:1px solid var(--line);
  padding:16px 0;
  margin-bottom:24px;
  gap:10px
}
.town-stats strong {
  font-size:27px;
  display:block;
  font-weight:600;
  line-height:1.2
}
.town-stats span {
  font-size:10px;
  color:var(--muted)
}
.town-guide label {
  display:block;
  font-size:11px;
  margin-bottom:7px
}
.town-guide select {
  width:100%;
  border:1px solid #cfcfc1;
  border-radius:4px;
  padding:11px 8px;
  background:#fffefa;
  color:var(--ink);
  font:inherit;
  font-size:12px
}
.district-step {
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-top:8px
}
.district-step span {
  font:10px monospace;
  letter-spacing:1px;
  color:var(--muted)
}
.district-step button,.resident-pagination button {
  border:1px solid var(--line);
  border-radius:4px;
  background:transparent;
  color:var(--ink);
  min-height:40px;
  min-width:40px
}
.village-town button:disabled,.resident-pagination button:disabled {
  opacity:.3;
  cursor:default
}
.guide-note {
  display:flex;
  gap:10px;
  margin-top:24px
}
.guide-symbol {
  font-size:25px;
  color:var(--accent)
}
.guide-note p {
  font-size:11px;
  color:var(--muted);
  margin:3px 0
}
.town-scene {
  min-width:0;
  display:flex;
  flex-direction:column
}
.scene-heading {
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:12px;
  padding:22px 24px 12px
}
.scene-heading button {
  justify-self:end;
  grid-column:3
}
/* 마을 전체 공지: 골목 이름과 같은 줄 가운데, 실선 테두리 — 캔버스를 가리지 않는다 */
.scene-heading .scene-notice {
  grid-column:2;
  margin:0;
  padding:7px 14px;
  border:1px solid var(--ink);
  border-radius:4px;
  background:var(--card);
  color:var(--ink);
  font-size:12px;
  white-space:nowrap
}
.scene-heading span {
  font:9px monospace;
  letter-spacing:1.5px;
  color:var(--muted)
}
.scene-heading h2 {
  font-size:21px;
  margin:4px 0 0
}
.scene-heading button {
  border:1px solid var(--line);
  background:transparent;
  border-radius:4px;
  padding:9px 11px;
  font-size:10px;
  min-height:40px;
  color:var(--muted)
}
/* 마을 그림은 액자처럼: 옅은 종이 바탕 위에 흰 매트·가는 테두리 두 겹·아래 그늘, 모서리는 둥글게.
   좌우 여백 12px은 village.js fit()의 (칸 폭 - 24)와 짝이다 — 여백을 바꾸면 fit()도 같이 바꾼다. 테(6px)는 여백 안에 들어간다. */
.village-canvas-wrap {
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f7f6ef;
  border-top:1px solid #ededdf;
  border-bottom:1px solid #ededdf;
  padding:14px 12px
}
.village-canvas-wrap canvas {
  display:block;
  max-width:100%;
  image-rendering:pixelated;
  border-radius:6px;
  box-shadow:0 0 0 1px #cbcbbd,0 0 0 5px #fff,0 0 0 6px #ddd7c7,0 14px 24px -18px rgba(33,48,57,.5)
}
.scene-caption {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin:0 24px;
  padding:14px 0;
  border-top:1px solid #ededdf;
  font-size:10px;
  color:var(--muted)
}
/* 이름표 왼쪽 끝 색 띠의 뜻 — 캔버스 이름표(village.js plateSprite)와 같은 색(C6 팔레트 MINT·GRAY·CORAL, 테두리 INK) */
.scene-legend {
  display:inline-flex;
  flex-wrap:wrap;
  align-items:center;
  gap:4px 14px
}
.scene-legend i {
  display:inline-block;
  width:16px;
  height:11px;
  margin-right:5px;
  vertical-align:-2px;
  border:1.5px solid #213039;
  border-radius:3px;
  background:#fff
}
.scene-legend .cap-on { box-shadow:inset 4px 0 #7bbea5 }
.scene-legend .cap-off { box-shadow:inset 4px 0 #adaaad }
.scene-legend .cap-keeper { box-shadow:inset 4px 0 #ff7573 }
.village-directory {
  padding-top:54px
}
.directory-heading {
  display:flex;
  justify-content:space-between;
  align-items:end;
  gap:24px
}
.directory-heading .eyebrow {
  margin-bottom:10px
}
.directory-heading h2 {
  font-size:30px;
  margin:0
}
.resident-search {
  width:300px
}
.resident-search span {
  font-size:11px;
  display:block;
  margin-bottom:6px
}
.resident-search input {
  width:100%;
  font-size:12px;
  background:#fffefa
}
.directory-tools {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin:22px 0
}
.directory-tools>div {
  display:flex;
  gap:6px
}
.directory-tools button {
  background:transparent;
  border:1px solid var(--line);
  border-radius:20px;
  color:var(--muted);
  padding:9px 15px;
  font-size:11px;
  min-height:40px
}
.directory-tools button[aria-pressed=true] {
  background:var(--ink);
  color:white;
  border-color:var(--ink)
}
.directory-tools>span {
  font-size:11px;
  color:var(--muted)
}
.resident-grid {
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px
}
.resident-grid li {
  min-width:0
}
.resident-card {
  width:100%;
  display:flex;
  align-items:center;
  gap:12px;
  text-align:left;
  background:#fffefa;
  border:1px solid var(--line);
  border-radius:5px;
  padding:16px;
  color:var(--ink);
  min-height:96px
}
.resident-card:hover {
  border-color:var(--accent);
  background:#fff9f0
}
.resident-card canvas {
  width:48px;
  height:48px;
  flex-shrink:0
}
.resident-card>span {
  min-width:0
}
.resident-card strong {
  display:block;
  font-size:15px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap
}
.resident-card small {
  display:block;
  font-size:10px;
  color:var(--muted);
  margin-top:3px
}
.resident-empty {
  grid-column:1/-1;
  padding:40px;
  text-align:center;
  border:1px dashed var(--line);
  color:var(--muted);
  font-size:13px
}
.resident-pagination {
  display:flex;
  justify-content:center;
  align-items:center;
  gap:20px;
  margin:22px 0
}
.resident-pagination span {
  font:11px monospace
}
.resident-pagination button {
  padding:5px 12px;
  font-size:12px
}
.village-footnote {
  border-top:1px solid var(--line);
  margin-top:46px;
  padding-top:26px;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px 20px
}
.village-footnote p {
  width:100%;
  font-size:18px;
  margin:0 0 4px
}
.village-footnote span {
  color:var(--muted);
  font-size:12px
}
.village-footnote a {
  margin-left:auto;
  font-size:12px;
  color:var(--accent)
}
@media(min-width:1500px) {
  .village-town {
    margin-left:-30px;
    margin-right:-30px
  }
  .town-workspace {
    grid-template-columns:242px minmax(0,1fr)
  }
}
@media(max-width:950px) {
  .town-workspace {
    grid-template-columns:200px minmax(0,1fr)
  }
  .town-guide {
    padding:22px 16px
  }
  .resident-grid {
    grid-template-columns:repeat(3,minmax(0,1fr))
  }
  .scene-caption>span:last-child {
    display:none
  }
  .village-postcard {
    min-width:190px;
    padding:22px
  }
}
@media(max-width:720px) {
  .village-heading {
    padding:34px 0 28px
  }
  .village-postcard {
    display:none
  }
  .town-en {
    display:none
  }
  .town-top {
    padding:12px 15px
  }
  .town-workspace {
    display:flex;
    flex-direction:column
  }
  .town-guide {
    border-right:0;
    border-bottom:1px solid var(--line);
    display:grid;
    grid-template-columns:1fr 110px;
    gap:8px 16px;
    padding:16px
  }
  .town-guide>.eyebrow,.town-guide>h2,.town-guide>p,.town-guide>label,.guide-note {
    display:none
  }
  .town-stats {
    border:0;
    padding:0;
    margin:0;
    grid-column:1/-1;
    display:flex;
    gap:28px
  }
  .town-stats>div {
    display:flex;
    gap:8px;
    align-items:baseline
  }
  .town-stats strong {
    font-size:22px
  }
  .town-guide select {
    align-self:center
  }
  .district-step {
    margin:0
  }
  .scene-heading {
    grid-template-columns:1fr auto;
    padding:17px 16px 8px
  }
  .scene-heading button {
    grid-column:2;
    grid-row:1
  }
  .scene-heading .scene-notice {
    grid-column:1 / -1;
    grid-row:2;
    justify-self:center;
    white-space:normal;
    text-align:center
  }
  .scene-heading h2 {
    font-size:19px
  }
  .village-canvas-wrap {
    padding:10px
  }
  .scene-caption {
    margin:0 16px;
    font-size:10px
  }
  .directory-heading {
    align-items:stretch;
    flex-direction:column;
    gap:16px
  }
  .directory-heading h2 {
    font-size:27px
  }
  .resident-search {
    width:100%
  }
  .village-directory {
    padding-top:34px
  }
  .directory-tools {
    align-items:start;
    flex-direction:column
  }
  .directory-tools button {
    padding:8px 12px
  }
  .resident-grid {
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:8px
  }
  .resident-card {
    padding:10px;
    gap:7px
  }
  .resident-card strong {
    font-size:13px
  }
  .resident-card canvas {
    width:40px;
    height:40px
  }
  .village-footnote a {
    margin:8px 0 0
  }
  .town-top>[role=status] {
    font-size:10px
  }
}
@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior:auto
  }
  .village-postcard {
    transform:none
  }
}
.resident-card small {
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
@media(max-width:720px) {
  .village-canvas-wrap {
    display:block;
    overflow-x:auto;
    overscroll-behavior-x:contain;
    scrollbar-color:#b9b9a5 #f2f1e9;
    scrollbar-width:thin
  }
  .village-canvas-wrap canvas {
    max-width:none
  }
  .scene-caption {
    flex-direction:column;
    gap:3px
  }
  .scene-caption::after {
    content:"← 지도를 옆으로 밀어 골목 끝까지 둘러보세요 →";
    color:var(--accent);
    font-size:10px
  }
  .village-town {
    scroll-margin-top:110px
  }
}

.village-care-panel {margin:12px 24px;padding:16px;background:#f7f6ef;border:1px solid var(--line);border-radius:5px;font-size:12px;}
.care-overview {display:flex;flex-wrap:wrap;justify-content:space-between;gap:8px;}.care-overview span{color:var(--muted);}
.care-bowls{display:flex;gap:24px;margin:12px 0;}.care-bowls strong{margin-left:8px;font-variant-numeric:tabular-nums;}
.village-care-panel>label{font-size:11px;margin-right:8px;}.village-care-panel select{font:inherit;max-width:100%;padding:8px;background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:4px;}
.care-needs{margin-top:12px;}.care-needs>div{display:grid;grid-template-columns:45px minmax(0,1fr) 40px;gap:10px;align-items:center;margin:5px 0;}.care-needs meter{width:100%;height:12px;}.care-needs strong{text-align:right;font-size:11px;}.care-needs p{color:var(--muted);font-size:11px;margin:0;}
@media(max-width:720px){.village-care-panel{margin:8px 12px 12px;padding:12px;}.care-overview{flex-direction:column;}}
.resident-card strong .sex { margin-left: 6px; padding: 1px 6px; font-size: 11px; vertical-align: 2px; }
.resident-card strong .sex b { font-size: 12px; }

/* v1.22 이름표 배지 — 주민 카드의 48px 초상화 규칙이 이름 옆 8×8 배지까지 키우지 않게 */
.resident-card strong canvas.badge-icon { width: 16px; height: 16px; margin-left: 6px; vertical-align: -2px; display: inline-block; }

/* v1.39 마을 거울 — 고른 친구의 "지금 고른 것"(돌봄 패널 안, 상태 막대 아래). 설명이지 대사가 아니다 */
.village-choice{margin-top:12px;padding-top:10px;border-top:1px dashed var(--line);}
.village-choice p{margin:4px 0 0;color:var(--muted);font-size:11px;overflow-wrap:anywhere;}
.village-choice .village-choice-title{display:block;font-size:11px;color:var(--muted);}
.village-choice .village-choice-main{color:var(--ink);font-size:14px;font-weight:700;font-variant-numeric:tabular-nums;}
.village-choice small{display:block;margin-top:6px;color:var(--muted);font-size:10px;line-height:1.5;}
