:root {
  --paper: #F5F1E8;
  --card: #FFFDF8;
  --ink: #1F1F1C;
  --ink2: #3D3D3D;
  --muted: #5E5E5E;
  --jade: #2F6B5F;
  --line: #D9D2C3;
  --line2: #E0D9CA;
  --chip: #E9E3D6;
  --grid: rgba(110, 90, 60, 0.07);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: #E8E2D4;
  color: var(--ink);
  font-family: 'Noto Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: var(--ink); }
button, input { font-family: inherit; }

/* PC에서는 휴대폰 폭 화면을 가운데에 */
.phone {
  position: relative;
  max-width: 440px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background-color: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 32px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 16px calc(14px + env(safe-area-inset-bottom));
}
@media (min-width: 480px) {
  .phone { box-shadow: 0 0 0 1px #D6CEBD, 0 8px 30px rgba(60, 50, 30, 0.12); }
}

.mugunghwa {
  position: absolute; right: -50px; top: 120px; width: 200px; height: 200px;
  opacity: 0.10; pointer-events: none;
}

.top { display: flex; justify-content: space-between; align-items: center; position: relative; }
.logo { display: block; line-height: 0; text-decoration: none; }
.logo img { display: block; height: 40px; width: auto; }
.toplink {
  display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 500;
  text-decoration: none; min-height: 40px; padding: 0 6px; color: var(--jade);
}

h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.3px; }
h1.lead { font-size: 17px; line-height: 1.4; position: relative; }
h2 { margin: 0; font-size: 16px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.pad { padding: 16px; }
section { display: flex; flex-direction: column; gap: 8px; position: relative; }

.notice {
  font-size: 12px; color: var(--ink2); background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; text-decoration: none; line-height: 1.6;
  display: flex; flex-direction: column; position: relative;
}
.notice b { color: var(--jade); font-weight: 500; }

.search { display: flex; gap: 8px; position: relative; }
.search input {
  flex: 1; min-width: 0; height: 44px; border: 1px solid #CFC7B6; border-radius: 10px;
  padding: 0 12px; font-size: 14px; background: var(--card); color: var(--ink);
}
.search button {
  width: 44px; height: 44px; border-radius: 10px; background: var(--jade); color: #fff;
  border: 0; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

.box {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 8px; display: flex; flex-direction: column; gap: 8px; position: relative;
}
.boxbar { display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: wrap; }
.boxbar .label { font-size: 11px; color: var(--muted); }
.seg { display: inline-flex; background: var(--chip); border-radius: 999px; padding: 2px; }
.seg button {
  border: 0; font-size: 12px; font-weight: 500; padding: 4px 11px; border-radius: 999px;
  min-height: 28px; background: transparent; color: var(--ink2); cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--jade); color: #fff; }

.grid { display: grid; gap: 6px; padding: 2px; }
.grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ghead { grid-column: 1 / -1; font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 2px 0; }
.btn {
  min-height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  color: var(--ink); font-size: 13px; font-weight: 500; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; padding: 5px 6px; text-decoration: none;
  text-align: center; line-height: 1.25; word-break: keep-all; overflow-wrap: anywhere;
}
.btn.tall { min-height: 64px; font-size: 15px; gap: 3px; }
.btn .sub { font-size: 11px; font-weight: 400; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.btn.wide { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; padding: 9px 12px; border-color: var(--jade); }
.vacant {
  grid-column: 1 / -1; border: 1px dashed #B8AE98; border-radius: 10px; background: #F7F3EA;
  padding: 9px 12px; font-size: 12px; color: var(--muted); line-height: 1.6;
}
.vacant .vt { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); margin-bottom: 2px; }
.vacant .tag { font-size: 11px; font-weight: 700; border: 1px solid #8A8270; border-radius: 4px; padding: 0 6px; color: var(--ink2); }
.vacant a { color: var(--ink2); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

.map { width: 100%; height: auto; display: block; }
.map .region { stroke-width: 0.8; stroke-linejoin: round; fill-rule: evenodd; cursor: pointer; }
.map a:hover .region, .map a:focus .region { fill: var(--jade) !important; }
.map .sep { fill: none; stroke: #7A6F5A; stroke-width: 1.6; stroke-dasharray: 5 4; stroke-linecap: round; pointer-events: none; }
.map .mlabel { font-size: 10.5px; font-weight: 700; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.map .mlabel.sm { font-size: 8.5px; }
.map .mlabel.xs { font-size: 7.5px; font-weight: 500; fill: var(--muted) !important; }
.map .dokdo { stroke: #7A6F5A; stroke-width: 0.8; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; padding: 0 2px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.msg { font-size: 13px; background: #EDE6D8; border-radius: 10px; padding: 10px 12px; line-height: 1.5; }

.crumbs { display: flex; align-items: center; gap: 2px; font-size: 13px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; color: var(--jade); padding: 8px 4px; }
.crumbs .sep { color: #8A8270; }
.crumbs b { padding: 8px 4px; }
.back {
  display: inline-flex; align-items: center; gap: 2px; font-size: 14px; text-decoration: none;
  min-height: 44px; color: var(--ink2); align-self: flex-start;
}

.foot {
  margin-top: auto; display: flex; gap: 14px; font-size: 12px; border-top: 1px solid #DDD5C5;
  padding-top: 10px; position: relative; flex-wrap: wrap;
}

/* 의원 상세 */
.who { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 68px; height: 68px; border-radius: 16px; background: #E6DFD1; color: #8A8A86;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.who .info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.who .line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.party {
  font-size: 12px; border: 1px solid #BDBDB9; border-radius: 999px; padding: 1px 8px;
  color: var(--ink2); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button {
  flex: 1; border: 0; background: transparent; font-size: 15px; color: var(--muted);
  padding: 12px 0; min-height: 46px; border-bottom: 3px solid transparent; cursor: pointer;
}
.tabs button[aria-selected="true"] { font-weight: 700; color: var(--ink); border-bottom-color: var(--jade); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat {
  background: var(--card); border: 1px solid var(--line2); border-radius: 12px;
  padding: 12px 10px; display: flex; flex-direction: column; gap: 4px;
}
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 21px; font-weight: 700; }
.stat .v small { font-size: 13px; font-weight: 500; margin-left: 1px; }
.stat .a { font-size: 11px; color: var(--muted); }

.card {
  background: var(--card); border: 1px solid var(--line2); border-radius: 12px; padding: 12px 14px;
  display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none;
}
.card .t { font-size: 15px; font-weight: 500; line-height: 1.4; }
.card .s { font-size: 12px; color: var(--muted); margin-top: 3px; }
.card .note { font-size: 12px; color: var(--ink2); background: #F1EBDF; border-radius: 8px; padding: 6px 8px; margin-top: 6px; line-height: 1.5; }
.card > div { min-width: 0; }
.vote {
  font-size: 13px; font-weight: 500; border: 1px solid #8A8A86; border-radius: 8px;
  padding: 4px 10px; flex-shrink: 0; white-space: nowrap;
}
.more {
  min-height: 44px; border: 1px solid #CFC7B6; border-radius: 12px; background: transparent;
  font-size: 14px; color: var(--ink2); cursor: pointer;
}
.contact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.cbtn {
  min-height: 48px; border: 1px solid #CFC7B6; border-radius: 12px; background: var(--card);
  font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; padding: 6px; text-align: center;
}
.linkcard {
  min-height: 48px; border: 1px solid #CFC7B6; border-radius: 12px; background: var(--card);
  padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  text-decoration: none;
}
.linkcard b { font-size: 14px; font-weight: 500; display: block; }
.linkcard span { font-size: 12px; color: var(--muted); }

dl.facts { margin: 0; background: var(--card); border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; }
dl.facts div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 10px 14px; border-top: 1px solid #ECE6DA; font-size: 14px; }
dl.facts div:first-child { border-top: 0; }
dl.facts dt { color: var(--muted); font-size: 13px; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }

.srcbar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: 12px; color: var(--muted); border-top: 1px solid #DDD5C5; padding-top: 10px; margin-top: auto;
}
.srcbar button {
  border: 0; background: transparent; font-size: 13px; color: var(--ink); text-decoration: underline;
  min-height: 44px; display: flex; align-items: center; gap: 4px; flex-shrink: 0; cursor: pointer;
}

/* 운영 원칙 */
.para { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 14px; line-height: 1.7; }
ol.rules { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.6; }
.table { background: var(--card); border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; font-size: 13px; }
.table .row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-top: 1px solid #ECE6DA; line-height: 1.5; }
.table .row:first-child { border-top: 0; }
.table .row > span:first-child { flex: 0 0 auto; max-width: 48%; word-break: keep-all; }
.table .row > span:last-child { color: var(--muted); text-align: right; word-break: keep-all; }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 10px;
  max-width: calc(100% - 32px); z-index: 10; line-height: 1.5;
}

a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--jade); outline-offset: 2px; }
