:root {
  --green: #1f7a4d;
  --green-dark: #165c3a;
  --green-light: #e6f3ec;
  --orange: #e8772e;
  --text: #1d2521;
  --muted: #66716b;
  --line: #dde3df;
  --bg: #f5f7f6;
  --white: #fff;
  --danger: #c0392b;
  --danger-bg: #c0392b;
  --green-hover: #165c3a;
  --surface: #fff;
  --surface-2: #eef2f0;
  --hover: #f7faf8;
  --line-soft: #eef1ef;
  --btn-gray: #e9ecea;
  --btn-gray-hover: #dfe4e1;
  --tint-orange: #fdeee3;
  --tint-red: #fdecea;
  --tint-blue: #e8f1fb;
  --tint-purple: #f3e8fb;
  --tint-gray: #eef0ef;
  --tint-amber: #fff4ea;
  --tint-amber-line: #f3dcc8;
  --orange-text: #b5561a;
  --blue-text: #1d4f8a;
  --purple-text: #6b2f8a;
  --amber-text: #9a5a00;
  color-scheme: light;
}
/* 어두운 화면 (메뉴 옆 토글, 브라우저에 기억) */
:root[data-theme="dark"] {
  --green: #1d6b45;
  --green-dark: #7fd4a5;
  --green-light: #1e3a2c;
  --green-hover: #24804f;
  --text: #e4ebe7;
  --muted: #9aa8a0;
  --line: #34403a;
  --bg: #121815;
  --white: #1a221e;
  --danger: #ff7b6b;
  --danger-bg: #c0392b;
  --surface: #1a221e;
  --surface-2: #232d28;
  --hover: #222c27;
  --line-soft: #29332e;
  --btn-gray: #2b3530;
  --btn-gray-hover: #35413b;
  --tint-orange: #3d2a1c;
  --tint-red: #43231f;
  --tint-blue: #1d2c40;
  --tint-purple: #33233f;
  --tint-gray: #2a322e;
  --tint-amber: #3a2e1c;
  --tint-amber-line: #574326;
  --orange-text: #f2a46c;
  --blue-text: #8fb8ec;
  --purple-text: #cfa2ec;
  --amber-text: #e8b85c;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body:has(.app) { overflow: hidden; }
body {
  font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  color: var(--text); background: var(--bg); font-size: 15px;
}
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }

/* ---------- 상단바 ---------- */
.topbar {
  height: 56px; display: flex; align-items: center; gap: 12px; padding: 0 16px;
  background: var(--green); color: #fff;
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 700; white-space: nowrap; }
.topbar .spacer { flex: 1; }
.topbar .user { font-size: 13px; opacity: .9; white-space: nowrap; }
.topbar a, .topbar button.link {
  color: #fff; text-decoration: none; background: rgba(255,255,255,.15); border: 0;
  padding: 6px 12px; border-radius: 6px; font-size: 13px; white-space: nowrap;
}
.topbar a:hover, .topbar button.link:hover { background: rgba(255,255,255,.28); }

/* ---------- 로그인 · 회원가입 ---------- */
.auth-wrap { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--white); border-radius: 12px; padding: 32px 28px;
  box-shadow: 0 4px 24px rgba(0,0,0,.08);
}
.auth-card h1 { font-size: 20px; margin: 0 0 4px; color: var(--green-dark); }
.auth-card p.sub { margin: 0 0 24px; color: var(--muted); font-size: 13px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.field input, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
}
.field select { color: var(--text); }
.field input:focus, .field select:focus { outline: 2px solid var(--green-light); border-color: var(--green); }
.btn {
  display: inline-block; border: 0; border-radius: 8px; padding: 10px 16px; background: var(--green); color: #fff;
}
.btn:hover { background: var(--green-hover); }
.btn.block { width: 100%; padding: 12px; font-size: 15px; margin-top: 6px; }
.btn.sm { padding: 5px 10px; font-size: 13px; border-radius: 6px; }
.btn.gray { background: var(--btn-gray); color: var(--text); }
.btn.gray:hover { background: var(--btn-gray-hover); }
.btn.danger { background: var(--danger-bg); }
.btn.orange { background: var(--orange); }
.auth-card .alt { margin-top: 18px; text-align: center; font-size: 13px; color: var(--muted); }
.auth-card .alt a { color: var(--green-dark); font-weight: 600; }
.msg { font-size: 13px; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px; display: none; }
.msg.error { display: block; background: var(--tint-red); color: var(--danger); }
.msg.ok { display: block; background: var(--green-light); color: var(--green-dark); }

/* ---------- 메인(지도) 화면 ---------- */
.app { display: flex; flex-direction: column; height: 100%; }
.main { flex: 1; display: flex; min-height: 0; }
.sidebar {
  width: 360px; flex-shrink: 0; background: var(--white); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; min-height: 0;
}
/* 관리카드 검색 */
.tabs { display: flex; border-bottom: 1px solid var(--line); }
.tabs button {
  flex: 1; padding: 13px 0; background: none; border: 0; border-bottom: 3px solid transparent;
  color: var(--muted); font-weight: 600;
}
.tabs button.active { color: var(--green-dark); border-bottom-color: var(--green-dark); }
.panel { flex: 1; overflow-y: auto; display: none; }
.panel.active { display: block; }
.search { padding: 12px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.search-mode { display: flex; gap: 4px; background: var(--surface-2); border-radius: 8px; padding: 3px; margin-bottom: 8px; }
.search-mode button { flex: 1; border: 0; background: none; padding: 6px 0; border-radius: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.search-mode button.on { background: var(--surface); color: var(--green-dark); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.search-row { display: flex; gap: 6px; }
.search-row input { flex: 1; min-width: 0; }
.list .name .badge.blue { display: inline-block; margin: 3px 0 2px; }
.list .name .badge.blue + small { display: block; }
.summary small { color: var(--muted); }
.search input:not([type=checkbox]) { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.summary { padding: 10px 14px; font-size: 13px; color: var(--muted); background: var(--bg); border-bottom: 1px solid var(--line); }
.summary b { color: var(--text); }

.list { list-style: none; margin: 0; padding: 0; }
.list li {
  padding: 11px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; display: flex;
  align-items: center; gap: 10px;
}
.list li:hover { background: var(--hover); }
.list li.selected { background: var(--green-light); }
.list .name { flex: 1; min-width: 0; }
.list .name strong { display: block; font-weight: 600; }
.list .name small { color: var(--muted); font-size: 12px; }
.badge {
  font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--green-light); color: var(--green-dark);
  white-space: nowrap; font-weight: 600;
}
.badge.orange { background: var(--tint-orange); color: var(--orange-text); }
.badge.gray { background: var(--tint-gray); color: var(--muted); }

/* 공원 상세 */
.detail { padding: 16px; }
.detail .back { background: none; border: 0; color: var(--green-dark); padding: 0; margin-bottom: 12px; font-size: 14px; }
.detail h2 { margin: 0 0 4px; font-size: 19px; }
.detail .addr { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.stat { background: var(--bg); border-radius: 10px; padding: 12px; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 22px; font-weight: 700; color: var(--green-dark); }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--muted); }
table.eq { width: 100%; border-collapse: collapse; font-size: 14px; }
table.eq th, table.eq td { padding: 8px 6px; border-bottom: 1px solid var(--line-soft); text-align: left; }
table.eq th { font-size: 12px; color: var(--muted); font-weight: 600; }
table.eq td.num, table.eq th.num { text-align: right; }
table.eq tr.hl td { background: var(--tint-amber); font-weight: 700; }
.meta { margin-top: 14px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.warn { margin-top: 10px; font-size: 12px; color: var(--amber-text); background: var(--tint-amber); padding: 8px 10px; border-radius: 8px; }
.admin-tools { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; gap: 8px; flex-wrap: wrap; }

.filter-head { padding: 12px 14px; background: var(--tint-amber); border-bottom: 1px solid var(--tint-amber-line); display: flex; align-items: center; gap: 8px; }
.filter-head .title { flex: 1; font-weight: 700; color: var(--orange-text); }

/* 지도 */
.map-wrap { flex: 1; position: relative; min-width: 0; overflow: hidden; }
#map { position: absolute; inset: 0; }
.map-notice {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 24px; color: var(--muted); line-height: 1.7; background: var(--surface-2);
}
.toast {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 10;
  background: rgba(29,37,33,.88); color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 13px; display: none;
  max-width: calc(100% - 32px);
}
.legend {
  position: absolute; right: 12px; bottom: 24px; z-index: 5; background: var(--surface); border-radius: 8px; padding: 8px 12px;
  font-size: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.15); color: var(--muted);
}

/* 지도 위 공원명 라벨 */
.park-label {
  position: relative; margin-bottom: 8px; background: var(--green); color: #fff; padding: 4px 9px; border-radius: 14px;
  font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.25);
  border: 2px solid #fff;
}
.park-label::after {
  content: ''; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--green);
}
.park-label.dim { opacity: .35; }
.park-label.hit { background: var(--orange); z-index: 3; }
.park-label.hit::after { border-top-color: var(--orange); }
.park-label.active { background: #0b3d26; transform: scale(1.12); }
.park-label.active::after { border-top-color: #0b3d26; }
.park-label .cnt { background: #fff; color: var(--orange); border-radius: 10px; padding: 0 6px; margin-left: 4px; }

/* 점검 상태 */
.badge.red { background: var(--tint-red); color: var(--danger); }
.badge.blue { background: var(--tint-blue); color: var(--blue-text); }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 8px; cursor: pointer; }
.park-label.warn { background: var(--danger-bg); }
.park-label.warn::after { border-top-color: var(--danger-bg); }
.park-label .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #fff; margin-right: 5px; vertical-align: 1px; }
.insp { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.insp h3 { font-size: 15px; margin: 0; flex: 1; }
.insp .head { display: flex; align-items: center; margin-bottom: 10px; }
.insp-form { background: var(--bg); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.insp-form .row { margin-bottom: 10px; }
.insp-form label.t { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.insp-form select, .insp-form input[type=date], .insp-form input[type=text], .insp-form textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font: inherit;
}
.insp-form textarea { min-height: 60px; resize: vertical; }
.insp-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status-pick { display: flex; gap: 6px; }
.status-pick label { flex: 1; text-align: center; padding: 8px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-size: 13px; }
.status-pick input { display: none; }
.status-pick input:checked + span { font-weight: 700; }
.status-pick label:has(input:checked) { border-color: var(--green); background: var(--green-light); }
.status-pick label.repair:has(input:checked) { border-color: var(--orange); background: var(--tint-orange); }
.status-pick label.unusable:has(input:checked) { border-color: var(--danger); background: var(--tint-red); }
.insp-list { list-style: none; margin: 0; padding: 0; }
.insp-list li { padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.insp-list .top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.insp-list .top b { font-size: 14px; }
.insp-list .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }
.insp-list .memo { margin-top: 4px; white-space: pre-wrap; }
.insp-list img { margin-top: 6px; max-width: 120px; max-height: 90px; border-radius: 6px; cursor: zoom-in; display: block; }
.insp-list .del { margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; }

/* 현황 수정(표 편집) */
.title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.title-row h2 { margin: 0; flex: 1; }
table.eq td.nos { color: var(--muted); font-size: 13px; }
.editor h2 { font-size: 18px; margin: 0 0 4px; }
.editor .help { font-size: 12px; color: var(--muted); margin: 0 0 12px; line-height: 1.6; }
.editor .pav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 14px; }
.editor .pav input { width: 80px; }
table.sheet { width: 100%; border-collapse: collapse; font-size: 13px; }
table.sheet th { background: var(--surface-2); color: var(--muted); font-weight: 600; padding: 6px 4px; border: 1px solid var(--line); text-align: left; }
table.sheet td { border: 1px solid var(--line); padding: 0; }
table.sheet td.idx { width: 26px; text-align: center; color: var(--muted); background: var(--surface-2); }
table.sheet input { width: 100%; border: 0; padding: 7px 6px; font: inherit; background: transparent; }
table.sheet input:focus { outline: 2px solid var(--green); outline-offset: -2px; background: var(--surface); }
table.sheet input.qty { text-align: right; }
table.sheet td.x { width: 28px; text-align: center; }
table.sheet td.x button { border: 0; background: none; color: var(--muted); font-size: 16px; padding: 4px; }
table.sheet td.x button:hover { color: var(--danger); }
table.sheet tr.err td { background: var(--tint-red); }
.editor .actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.editor .actions .spacer { flex: 1; }
.editor .total { font-size: 13px; color: var(--muted); margin-top: 8px; }
.history { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.history h3 { font-size: 14px; margin: 0 0 8px; }
.history li { font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); list-style: none; line-height: 1.6; }
.history ul { margin: 0; padding: 0; }
.history .sub { color: var(--muted); }

.modal-bg { position: fixed; inset: 0; background: rgba(20,30,25,.45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 12px; padding: 20px; width: 100%; max-width: 720px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.editor code { background: var(--bg); padding: 1px 5px; border-radius: 4px; }
@media (max-width: 760px) { .modal-bg { padding: 0; } .modal { border-radius: 0; min-height: 100%; } }

/* ---------- 관리자 화면 ---------- */
.page { max-width: 1000px; margin: 0 auto; padding: 24px 16px; }
.card { background: var(--surface); border-radius: 12px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.card h2 { margin: 0 0 14px; font-size: 17px; }
.card p.help { color: var(--muted); font-size: 13px; margin: -6px 0 14px; line-height: 1.6; }
.table-wrap { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
table.grid th, table.grid td { padding: 9px 8px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
table.grid th { font-size: 12px; color: var(--muted); }
table.grid td .btn { margin-right: 4px; }

/* ---------- 상단 메뉴 ---------- */
.topbar h1 .short { display: none; }
.menu-wrap { position: relative; }
.menu-btn {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.15); color: #fff; border: 0;
  padding: 7px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; min-height: 36px;
}
.menu-btn:hover, .menu-btn[aria-expanded=true] { background: rgba(255,255,255,.3); }
.burger, .burger::before, .burger::after { display: block; width: 16px; height: 2px; background: #fff; border-radius: 1px; position: relative; }
.burger::before, .burger::after { content: ''; position: absolute; left: 0; }
.burger::before { top: -5px; } .burger::after { top: 5px; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 200; list-style: none; margin: 0; padding: 6px;
  background: var(--surface); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.18); min-width: 220px;
}
.menu li button, .menu li a {
  display: block; width: 100%; text-align: left; background: none; border: 0; padding: 11px 12px; border-radius: 6px;
  color: var(--text); font-size: 14px; text-decoration: none;
}
.menu li button:hover, .menu li a:hover { background: var(--green-light); color: var(--green-dark); }
.menu .sep { height: 1px; background: var(--line); margin: 6px 4px; }
.menu-user { display: none; padding: 8px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* ---------- 메뉴 화면 (전체 현황 / 수리 현황) ---------- */
.main { position: relative; }
.view { position: absolute; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto; padding: 20px 24px 40px; }
.view-head { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 16px; }
.view-title h2 { margin: 2px 0 4px; font-size: 20px; }
.view-title p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.tiles.small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { background: var(--surface); border-radius: 10px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.tile span { font-size: 12px; color: var(--muted); }
.tile b { display: block; font-size: 22px; color: var(--green-dark); }
.tile b.red { color: var(--danger); }
.tile b small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.seg-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 12px; }
.seg-row .seg { margin-bottom: 0; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 8px; padding: 3px; margin-bottom: 12px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 6px; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--green-dark); font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.view .table-wrap, .matrix-wrap { background: var(--surface); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
table.grid.stock-type { min-width: 560px; }
table.grid td.num, table.grid th.num { text-align: right; }
table.grid tfoot th { border-top: 2px solid var(--line); }
.bar { height: 8px; background: var(--surface-2); border-radius: 4px; min-width: 80px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 4px; }
.linkish { background: none; border: 0; padding: 0; color: var(--green-dark); font-weight: 600; text-align: left; }
.linkish:hover { text-decoration: underline; }
.view-tools { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.view-tools input { flex: 1; min-width: 160px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; }
.matrix-wrap { overflow: auto; max-height: calc(100vh - 330px); min-height: 240px; }
table.matrix { border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.matrix th, table.matrix td { padding: 6px 8px; border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); white-space: nowrap; background: var(--surface); }
table.matrix thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--muted); font-weight: 600; vertical-align: bottom; }
table.matrix th.vert span { writing-mode: vertical-rl; display: inline-block; max-height: 120px; }
table.matrix .sticky { position: sticky; left: 0; z-index: 1; text-align: left; min-width: 140px; }
table.matrix thead .sticky { z-index: 3; }
table.matrix tfoot th, table.matrix tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 700; border-top: 2px solid var(--line); }
table.matrix td.num { text-align: right; color: var(--text); }
table.matrix tbody tr:hover td, table.matrix tbody tr:hover th { background: var(--hover); }
.hint { color: var(--muted); font-size: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; background: var(--surface); padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.05); font-size: 13px; color: var(--muted); }
.filters input, .filters select { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font: inherit; color: var(--text); background: var(--surface); }
.filters input[type=search] { flex: 1; min-width: 150px; }
.day { margin-bottom: 18px; }
.day h3 { font-size: 15px; margin: 0 0 8px; }
.day h3 span { font-size: 12px; color: var(--muted); font-weight: 500; margin-left: 6px; }
.day ul { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.rep { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); font-size: 13px; }
.rep:last-child { border-bottom: 0; }
.rep-main { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.rep-target { color: var(--text); }
.rep-status { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.rep-memo { grid-column: 1 / -1; white-space: pre-wrap; }
.rep-sub { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.rep-sub a { color: var(--green-dark); }
.picker .pick-q { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.picker .pick-list { max-height: 55vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.picker .help { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.picker .actions { display: flex; margin-top: 12px; }
.picker .actions .spacer { flex: 1; }

/* ---------- 반응형 ---------- */
/* 태블릿 */
@media (max-width: 1024px) {
  .sidebar { width: 310px; }
  .view { padding: 16px; }
}
/* 휴대폰 */
@media (max-width: 760px) {
  .topbar { height: 52px; padding: 0 12px; gap: 8px; }
  .topbar h1 { font-size: 16px; }
  .topbar h1 .full { display: none; }
  .topbar h1 .short { display: inline; }
  .topbar .user { display: none; }
  .menu-user { display: block; }
  .menu { position: fixed; left: 8px; right: 8px; top: 56px; min-width: 0; }
  .menu li button, .menu li a { padding: 14px 12px; font-size: 15px; }
  .main { flex-direction: column-reverse; }
  .sidebar { width: 100%; height: 50%; border-right: 0; border-top: 1px solid var(--line); }
  .map-wrap { min-height: 50%; }
  .tabs button { padding: 11px 0; }
  .list li { padding: 12px; flex-wrap: wrap; }
  .list .name { flex-basis: 100%; }
  .stats { gap: 6px; }
  .legend { right: 8px; bottom: 8px; font-size: 11px; padding: 6px 9px; }
  .toast { top: 8px; font-size: 12px; }
  .view { padding: 12px 12px 32px; }
  .view-head { flex-direction: column; gap: 8px; }
  .view-title h2 { font-size: 18px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tiles.small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile { padding: 10px; }
  .tile b { font-size: 19px; }
  .matrix-wrap { max-height: calc(100vh - 290px); }
  .filters { flex-direction: column; align-items: stretch; }
  table.grid.stock-type { min-width: 0; width: 100%; }
  table.grid.stock-type .col-bar { display: none; }
  .filters label { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .filters label input[type=date] { flex: 1; min-width: 120px; }
  .rep { grid-template-columns: 1fr; }
  .rep-status { justify-content: flex-start; }
  table.sheet { font-size: 14px; }
  table.sheet input { padding: 9px 6px; }
  .editor .help { font-size: 11px; }
  .insp-form .two { grid-template-columns: 1fr; }
  .btn, .btn.sm { min-height: 36px; }
}
/* 아주 좁은 화면 */
@media (max-width: 380px) {
  .tiles.small { grid-template-columns: 1fr 1fr; }
  table.sheet th:nth-child(1), table.sheet td.idx { display: none; }
}

/* ---------- 제목 = 처음 화면 ---------- */
.topbar h1 a#homeLink { background: none; padding: 0; font-size: inherit; color: #fff; }
.topbar h1 a#homeLink:hover { background: none; opacity: .85; }

/* ---------- 기록 (점검 · 민원) ---------- */
.insp .head { gap: 6px; flex-wrap: wrap; }
.badge.kind-inspection { background: var(--tint-blue); color: var(--blue-text); }
.badge.kind-complaint { background: var(--tint-purple); color: var(--purple-text); }
.rec-seg { margin: 4px 0 6px; }
.rec-seg button { padding: 5px 12px; font-size: 13px; }
.insp-slot .form-title { margin: 0 0 6px; font-size: 14px; }
.insp-list li.rec-item { cursor: pointer; padding-left: 4px; padding-right: 4px; border-radius: 6px; }
.insp-list li.rec-item:hover, .insp-list li.rec-item:focus { background: var(--hover); outline: none; }
.insp-list .more, .rep .more { margin-left: auto; color: var(--muted); font-size: 12px; }
.insp-list .memo.fix, .rep-memo.fix { color: var(--green-dark); }
.keep-photo { margin: 0 0 6px; }
.rep { cursor: pointer; }
.rep:hover, .rep:focus { background: var(--hover); outline: none; }
.rep .more { float: right; }

.modal.record { max-width: 560px; }
.rec-head .badges { display: flex; gap: 4px; flex-wrap: wrap; }
.rec-head h2 { font-size: 18px; margin: 8px 0 4px; }
.rec-head h2 .linkish { font-size: inherit; }
.rec-sec { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.rec-sec h3 { font-size: 14px; margin: 0 0 8px; color: var(--green-dark); }
.rec-dl { display: grid; grid-template-columns: 84px 1fr; gap: 6px 10px; margin: 0 0 10px; font-size: 14px; }
.rec-dl dt { color: var(--muted); font-size: 13px; }
.rec-dl dd { margin: 0; }
.rec-dl dd.pre { white-space: pre-wrap; }
.rec-dl dd a { color: var(--green-dark); }
.thumb { max-width: 160px; max-height: 120px; border-radius: 6px; display: block; }
.modal.record .actions { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.modal.record .actions .spacer { flex: 1; }

/* ---------- 길찾기 ---------- */
.modal.route { max-width: 380px; }
.modal.route h2 { font-size: 18px; margin: 0 0 6px; }
.route-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 4px; }
.route-btn { display: block; text-align: center; padding: 14px 0; border-radius: 10px; font-weight: 700; text-decoration: none; font-size: 15px; }
.route-btn.kakao { background: #fee500; color: #191919; }
.route-btn.naver { background: #03c75a; color: #fff; }
.modal.route .actions { display: flex; margin-top: 12px; }
.modal.route .actions .spacer { flex: 1; }
@media (max-width: 760px) { .modal-bg:has(.modal.route) { align-items: flex-end; } .modal.route { min-height: 0; border-radius: 14px 14px 0 0; } }
.modal.route .help { color: var(--muted); font-size: 13px; margin: 0; line-height: 1.5; }

/* ---------- 화면 모드 토글 ---------- */
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 34px; background: rgba(255,255,255,.15);
  border: 0; border-radius: 8px; font-size: 18px; line-height: 1; padding: 0;
}
.theme-btn:hover { background: rgba(255,255,255,.3); }
.theme-btn { color: #fff; }
.theme-btn svg { display: block; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: inline; }
:root[data-theme="dark"] .toast { background: rgba(240,245,242,.92); color: #121815; }
:root[data-theme="dark"] .modal-bg { background: rgba(0,0,0,.6); }
:root[data-theme="dark"] input:not([type=checkbox]):not([type=radio]):not([type=file]), :root[data-theme="dark"] select, :root[data-theme="dark"] textarea { background: var(--surface); color: var(--text); border-color: var(--line); }

/* ---------- 운동기구 사진 ---------- */
table.eq .eq-name { font-weight: 500; color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
table.eq .eq-name:hover { color: var(--green-dark); }
table.eq .eq-name .cam { width: 15px; height: 15px; vertical-align: -2px; margin-left: 3px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linejoin: round; }
table.eq .eq-name:hover .cam { stroke: var(--green-dark); }
.modal.eq-photos { max-width: 640px; }
.modal.eq-photos h2 { font-size: 18px; margin: 0 0 4px; }
.modal.eq-photos .help { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
.eq-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.eq-photo { margin: 0; background: var(--surface-2); border-radius: 10px; overflow: hidden; }
.eq-photo img, .eq-photo .no-photo { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.eq-photo .no-photo { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.eq-photo figcaption { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 8px 10px; }
.eq-photo figcaption small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.eq-photo .photo-actions { width: 100%; display: flex; gap: 6px; justify-content: flex-end; }
.eq-photo .file-btn { cursor: pointer; }
.need-no, .eq-photo .badge.need { color: var(--muted); font-weight: 500; }
.eq-photo.busy { opacity: .5; pointer-events: none; }
.modal.eq-photos .actions { display: flex; margin-top: 14px; }
.modal.eq-photos .actions .spacer { flex: 1; }

/* 구역으로 나뉜 공원 */
.muted { color: var(--muted); font-weight: normal; }
.section-of { display: block; color: var(--muted); font-size: 12px; font-weight: normal; }
.sections { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 4px; font-size: 13px; }
.sections > span { color: var(--muted); margin-right: 2px; }
.sections .chip { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 4px 10px; border-radius: 999px; font-size: 13px; cursor: pointer; }
.sections .chip:hover { background: var(--hover); }
.sections .chip.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
/* 관리자 화면 상단: 휴대폰에서는 짧은 글자 */
.topbar .back-map .short { display: none; }
@media (max-width: 760px) {
  .topbar .back-map .full { display: none; }
  .topbar .back-map .short { display: inline; }
  .topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
}

/* 안내 문구 줄바꿈(\n) 그대로 표시 */
.msg { white-space: pre-line; }
table.grid select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--text); font-size: 13px; }

.modal.eq-photos .photo-req { margin: 10px 0 0; font-size: 12px; color: var(--muted); }

/* 비밀번호 변경 화면 */
.auth-card .alt button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--green-dark); font-weight: 600; cursor: pointer; }

/* 관리자 · 변경 이력 */
.chg-seg { flex-wrap: wrap; }
.chg-seg small { font-size: 12px; opacity: .75; margin-left: 2px; }
.chg-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chg-filters select, .chg-filters input { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: 14px; color: var(--text); background: var(--surface); }
.chg-filters input { flex: 1; min-width: 160px; }
.chg-list { border-top: 1px solid var(--line); }
.chg-day { font-size: 13px; font-weight: 700; color: var(--muted); padding: 14px 4px 6px; }
.chg-row { display: grid; grid-template-columns: 46px 92px minmax(120px, 190px) 1fr auto; gap: 10px; align-items: baseline; padding: 9px 4px; border-bottom: 1px solid var(--line); font-size: 14px; }
.chg-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.chg-cat { justify-self: start; white-space: nowrap; }
.chg-park { font-weight: 600; }
.chg-sub { font-weight: 400; color: var(--muted); font-size: 12px; }
.chg-sum { color: var(--text); word-break: keep-all; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.chg-row.long { cursor: pointer; }
.chg-row.long:hover { background: var(--hover); }
.chg-row.expanded .chg-sum { -webkit-line-clamp: unset; display: block; }
.chg-who { color: var(--muted); font-size: 13px; white-space: nowrap; }
.chg-empty { margin: 14px 4px; }
.chg-more { text-align: center; margin-top: 12px; }
@media (max-width: 760px) {
  .chg-row { grid-template-columns: auto auto 1fr auto; gap: 4px 8px; }
  .chg-sum { grid-column: 1 / -1; font-size: 13px; }
  .chg-filters select { flex: 1 1 40%; width: auto; min-width: 0; }
  .chg-filters input { flex-basis: 100%; }
}

/* 미조치 공원 현황 */
.op-park { background: var(--surface); border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.05); margin-bottom: 8px; overflow: hidden; }
.op-head { width: 100%; display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 0; background: none; text-align: left; font: inherit; color: var(--text); cursor: pointer; }
.op-head:hover { background: var(--hover); }
.op-name { font-weight: 700; font-size: 15px; }
.op-badges { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.op-wait { color: var(--muted); font-size: 13px; white-space: nowrap; }
.op-wait.late { color: var(--danger); font-weight: 700; }
.op-arrow { color: var(--muted); font-size: 18px; transition: transform .15s; }
.op-park.open .op-arrow { transform: rotate(90deg); }
.op-recs { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-soft); }
.rep-date { color: var(--muted); font-variant-numeric: tabular-nums; }
.op-foot { padding: 10px 14px; text-align: right; }
.op-empty { background: var(--surface); border-radius: 10px; padding: 24px; text-align: center; color: var(--muted); }
@media (max-width: 760px) {
  .op-head { flex-wrap: wrap; gap: 6px 8px; }
  .op-name { flex: 1 1 auto; }
  .op-badges { order: 3; flex-basis: 100%; }
}
