:root {
  --fs: 16px;
  --blue: #1d4ed8;
  --blue-soft: #eff4ff;
  --line: #e5e7eb;
  --txt: #111827;
  --muted: #6b7280;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: #f4f5f7; color: var(--txt); }
body { font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif; font-size: var(--fs); }
#root { max-width: 560px; margin: 0 auto; min-height: 100vh; background: #fff; }
button { font: inherit; cursor: pointer; }
a { color: var(--blue); }

/* 로그인 */
.login { padding: 28px 20px; }
.login h1 { font-size: 1.35em; margin: 40px 0 4px; }
.login .cong { color: var(--muted); margin: 0 0 28px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .85em; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=tel], input[type=search] {
  width: 100%; padding: 14px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 1em; background: #fff; color: var(--txt);
}
button.primary { width: 100%; padding: 15px; border: 0; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 600; font-size: 1.02em; }
button.primary:disabled { opacity: .5; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9em; margin: 10px 0 18px; }
.err { color: var(--red); font-size: .9em; margin: 10px 0 0; }

/* 키패드 */
.keypad { position: fixed; inset: 0; background: rgba(17,24,39,.45); display: flex; align-items: flex-end; z-index: 40; }
.keypad .sheet { background: #fff; width: 100%; max-width: 560px; margin: 0 auto; border-radius: 16px 16px 0 0; padding: 18px 18px 26px; }
.keypad .dots { display: flex; gap: 10px; justify-content: center; margin: 6px 0 16px; }
.keypad .dots span { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.keypad .dots span.on { background: var(--blue); }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keys button { padding: 14px 0; border: 1px solid var(--line); background: #fff; border-radius: 10px; font-size: 1.15em; }
.keys button.wide { grid-column: span 3; background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }

/* 헤더 */
.topbar { position: sticky; top: 0; background: #fff; border-bottom: 1px solid var(--line); z-index: 20; }
.topbar .row1 { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.topbar .who { font-weight: 600; flex: 1; }
.topbar .row2 { display: flex; gap: 4px; overflow-x: auto; padding: 0 10px 10px; }
.topbar .row2 button { border: 1px solid var(--line); background: #fff; padding: 7px 12px; border-radius: 999px; white-space: nowrap; color: var(--muted); }
.topbar .row2 button.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.iconbtn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 10px; color: var(--muted); }

.search { display: flex; gap: 8px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--line); }
.search input { flex: 1; }

/* 구역 목록 */
.cards { padding: 12px 12px 80px; display: grid; gap: 10px; }
.tcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; display: flex; align-items: center; gap: 12px; }
.tcard .num { font-weight: 700; font-size: 1.05em; min-width: 3.4em; }
.tcard .tinfo { flex: 1; min-width: 0; }
.tcard .tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard .meta { color: var(--muted); font-size: .82em; margin-top: 3px; }
.badge { background: var(--blue-soft); color: var(--blue); border-radius: 999px; padding: 3px 9px; font-size: .78em; font-weight: 600; white-space: nowrap; }
.badge.done { background: #eafaf0; color: var(--green); }
.badge.warn { background: #fff7e6; color: var(--amber); }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); }
.more { margin: 0 12px 90px; }

/* 구역 카드 */
.detail { padding-bottom: 90px; }
.dhead { padding: 12px 14px 6px; }
.dhead h2 { margin: 0; font-size: 1.15em; }
.dhead .sub { color: var(--muted); font-size: .85em; margin-top: 5px; }
.hist { padding: 0 14px 10px; color: var(--muted); font-size: .82em; }
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; position: sticky; top: 0; background: #fff; z-index: 10; }
.tabs button { flex: 1; min-width: 82px; border: 0; background: #fff; padding: 12px 4px; color: var(--muted); border-bottom: 2px solid transparent; }
.tabs button.on { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.alist { padding: 8px 12px 12px; display: grid; gap: 6px; }
.arow { display: flex; align-items: center; gap: 10px; padding: 12px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.arow .ano { color: var(--muted); min-width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; }
.arow .aname { flex: 1; min-width: 0; }
.arow .aname .sub2 { color: var(--muted); font-size: .8em; margin-top: 2px; }
.arow.dnc { background: #fff5f5; border-color: #fecaca; }
.st { font-size: .78em; padding: 3px 8px; border-radius: 999px; background: #f3f4f6; color: var(--muted); white-space: nowrap; }
.st.호별 { background: #eafaf0; color: var(--green); }
.st.재방1 { background: #fff7e6; color: var(--amber); }
.st.재방2 { background: #eef2ff; color: #4338ca; }

/* 시트 */
.sheetwrap { position: fixed; inset: 0; background: rgba(17,24,39,.45); display: flex; align-items: flex-end; z-index: 50; }
.sheetwrap .sheet { background: #fff; width: 100%; max-width: 560px; margin: 0 auto; border-radius: 16px 16px 0 0; padding: 16px 16px 24px; }
.sheet h3 { margin: 2px 0 4px; font-size: 1.05em; }
.sheet .sub3 { color: var(--muted); font-size: .85em; margin-bottom: 14px; }
.statusrow { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.statusrow button { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.statusrow button.on { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.sheet textarea { width: 100%; min-height: 76px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; resize: vertical; }
.sheet .actions { display: flex; gap: 8px; margin-top: 12px; }
.sheet .actions button { flex: 1; padding: 13px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.sheet .actions button.primary { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }
.memo { color: var(--muted); font-size: .8em; margin-top: 4px; white-space: pre-wrap; }

/* 설정 */
.page { padding: 16px 16px 80px; }
.page h2 { font-size: 1.15em; margin: 8px 0 16px; }
.setrow { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; border-bottom: 1px solid var(--line); }
.setrow .lbl { color: var(--muted); }
.seg { display: flex; gap: 6px; }
.seg.wrap { flex-wrap: wrap; }
.seg button { border: 1px solid var(--line); background: #fff; padding: 8px 12px; border-radius: 8px; }
.seg button.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.maplink { display: block; margin: 14px 0 10px; font-size: .92em; text-decoration: none; }

/* 주소 종류 배지 · 배정 */
.kbadge { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 6px; font-size: .72em; border: 1px solid var(--line); color: #4b5563; }
.k-biz { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.k-unit { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.k-road { background: #ecfdf5; border-color: #bbf7d0; color: #166534; }
.k-etc { background: #f3f4f6; }
.k-ex { background: #f9fafb; color: #9ca3af; }
.dispinput { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0 10px; font-size: 1em; }
button.danger { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.roundbar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.rstat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; }
.rstat .k { font-size: .72em; color: #6b7280; }
.rstat .v { font-size: 1.25em; font-weight: 700; }
.round { display: inline-block; min-width: 34px; text-align: center; padding: 3px 6px; border-radius: 8px; font-size: .82em; background: #f3f4f6; }
.round.r1 { background: #fef3c7; color: #92400e; }
.round.r2 { background: #dbeafe; color: #1e40af; }
.round.r3 { background: #dcfce7; color: #166534; }
button.vbtn { margin-left: 8px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.cycbox { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 10px 0; background: #fcfcfd; }
.cychead { font-size: .84em; color: #374151; margin-bottom: 6px; }
.cycrow { display: flex; align-items: flex-start; gap: 8px; padding: 4px 0; }
.cycrow .aname { font-size: .9em; }

/* 관리자 · 역할 · 일괄 */
.rolebadge { margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: .72em; background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe; }
h3.sec { margin: 20px 0 8px; font-size: 1.02em; }
.ok { background: #ecfdf5; border: 1px solid #bbf7d0; color: #166534; padding: 8px 10px; border-radius: 8px; margin: 8px 0; font-size: .88em; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.filters input, .filters select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: .92em; background: #fff; }
.filters input { flex: 1 1 180px; }
.btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.reqbox { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 10px 0; background: #fffdf7; }
.reqrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: #fff; }
.editbox { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 10px 0; background: #fcfcfd; }
.editbox select, .editbox textarea { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; font-size: .95em; }
.cycedit { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 10px 0; background: #fbfbfe; }
.cycedit summary { cursor: pointer; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.grid2 label { display: block; font-size: .8em; color: var(--muted); }
.grid2 input { width: 100%; box-sizing: border-box; padding: 8px; border: 1px solid var(--line); border-radius: 8px; }
table select { padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; font-size: .9em; background: #fff; }
table td.detail { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85em; color: #4b5563; }
button:disabled { opacity: .45; }
.arow { cursor: pointer; }

/* 통계 · 그래프 · 보고서 */
.chartgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.chartcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff; }
.chartcard.wide { grid-column: 1 / -1; }
.ctitle { font-size: .88em; color: var(--muted); margin-bottom: 10px; }
.chartempty { color: #9ca3af; font-size: .88em; padding: 18px 0; text-align: center; }
.vbars { display: flex; align-items: flex-end; gap: 6px; overflow-x: auto; }
.vcol { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 34px; flex: 1; height: 100%; }
.vval { font-size: .7em; color: #6b7280; }
.vtrack { flex: 1; display: flex; align-items: flex-end; }
.vfill { display: block; border-radius: 4px 4px 0 0; }
.vx { font-size: .68em; color: #6b7280; margin-top: 3px; }
.hbars { display: flex; flex-direction: column; gap: 5px; }
.hrow { display: flex; align-items: center; gap: 8px; font-size: .82em; }
.hlabel { width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #374151; }
.htrack { flex: 1; display: flex; height: 14px; background: #f6f6f7; border-radius: 4px; overflow: hidden; }
.hfill { display: block; height: 14px; border-radius: 4px; min-width: 2px; }
.hseg { height: 14px; }
.hval { width: 58px; text-align: right; color: #111; font-variant-numeric: tabular-nums; }
.donutwrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.legend { display: flex; flex-direction: column; gap: 4px; font-size: .8em; }
.lrow { display: flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lname { min-width: 62px; color: #374151; }
.lval { color: #6b7280; }
.tablewrap { overflow-x: auto; }
.roundbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.rstat { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 96px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.stat .k { color: var(--muted); font-size: .82em; }
.stat .v { font-size: 1.5em; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; font-size: .9em; }
th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; }
td.n { text-align: right; font-variant-numeric: tabular-nums; }
.foot { text-align: center; color: var(--muted); font-size: .78em; padding: 18px 0 30px; }

/* 신청·사용자 분석 보조 */
td.ok, td.no { background: transparent; border: none; padding: 6px 8px; margin: 0; border-radius: 0; }
td.ok { color: #166534; font-weight: 600; }
td.no { color: #9ca3af; }
.okmsg { background: #ecfdf5; border: 1px solid #bbf7d0; color: #166534; padding: 8px 10px; border-radius: 8px; margin: 8px 0; font-size: .88em; }
.actcell { white-space: nowrap; }
.actcell .vbtn { margin-left: 4px; }
.sheetbox { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 8px 0 14px; background: #fff; }
.sheetbox .setrow { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.sheetbox .lbl { min-width: 84px; color: var(--muted); font-size: .88em; }
.sheetbox input { flex: 1; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-size: 1em; }
table td.n, table th.n { text-align: right; font-variant-numeric: tabular-nums; }
.hrow.clickable { cursor: pointer; }
.hrow.clickable:hover .hlabel { text-decoration: underline; }

/* 탭: 줄바꿈 대신 가로 스크롤 */
.tabs { flex-wrap: nowrap; }
.tabs button { flex: 0 0 auto; min-width: 0; padding: 12px 10px; white-space: nowrap; }
/* 버튼 강조(승인 등) — 흰 배경 규칙보다 우선 */
button.vbtn.primary, .vbtn.primary { background: var(--blue); color: #fff; border-color: var(--blue); font-weight: 600; }

/* 짝·카드 배정 */
.sec2 { font-size: 1em; margin: 14px 0 6px; color: #111; }
.pairgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.paircard { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; }
.phead { font-weight: 700; margin-bottom: 6px; color: #1d4ed8; }
.prow { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: #eef2ff; color: #1e3a8a; border-radius: 999px; padding: 4px 10px; font-size: .84em; }
.chip.gray { background: #f3f4f6; color: #374151; }
.chip.link { border: 1px solid var(--line); cursor: pointer; }
.chip .x { border: 0; background: transparent; color: #9ca3af; cursor: pointer; font-size: 1em; line-height: 1; padding: 0 0 0 2px; }
.chip .x:hover { color: #dc2626; }
.todaypair { border: 2px solid var(--blue); border-radius: 12px; padding: 10px 12px; margin: 10px 0; background: #f8fafc; }
.tphead { font-weight: 700; color: var(--blue); margin-bottom: 6px; }

/* 방문 직후 되돌리기 안내 (실수 방지) */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 60;
  display: flex; align-items: center; gap: 10px; background: #111827; color: #fff; padding: 10px 14px;
  border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.25); font-size: 14px; max-width: 92vw; }
.toast button { background: #F96B20; color: #fff; border: 0; border-radius: 999px; padding: 6px 12px; font-weight: 700; }
.toast button.x { background: transparent; color: #cbd5e1; padding: 2px 6px; font-weight: 400; }
.vbtn.ghost { background: #fff; color: #374151; border: 1px solid #d1d5db; padding: 6px 10px; margin-left: 6px; }
.vbtn.ghost.off, .vbtn.ghost:disabled { opacity: .35; }

/* 방문 체크 / 해제 버튼 (전도인 현장용) */
.chk { min-width: 74px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid #d1d5db; background: #fff;
  color: #6b7280; font-weight: 700; font-size: 14px; cursor: pointer; }
.chk.on { background: #16a34a; border-color: #16a34a; color: #fff; }
.chk:disabled { opacity: .5; }

/* 전도인 구역 화면 안내 */
.pubmeta { padding: 10px 14px; background: #f8fafc; border-bottom: 1px solid #e5e7eb; font-size: 14px; color: #374151; }
.pubmeta b { color: #111827; }

/* 방문금지 요청 검토 중 — 잠금 */
.chk.lock { background: #fef3c7; border-color: #f59e0b; color: #92400e; cursor: not-allowed; }

/* 방문금지 1년 도래 — 방문 필요 (잠금 해제) */
.chk.due { background: #fff7ed; border-color: #F96B20; color: #b45309; }

/* ============================================================
   모바일 우선 개선 (2026-10-01)
   ============================================================ */
:root { --maxw: 560px; }
#root { width: 100%; max-width: var(--maxw); }
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; }
img, svg { max-width: 100%; }

/* 입력 요소는 iOS 확대 방지를 위해 최소 16px, 터치 영역 44px */
input, select, textarea { font-size: max(16px, 1em); }
input[type=text], input[type=password], input[type=tel], input[type=search],
input[type=date], input[type=number], select, textarea { min-height: 44px; }
button { min-height: 40px; }
button.iconbtn { min-height: 40px; padding: 8px 12px; }

/* 가로 오버플로 방지 — 그리드 트랙이 내용에 밀려 늘어나지 않게 */
.cards, .alist, .pairgrid { grid-template-columns: minmax(0, 1fr); }
.tcard, .arow, .paircard, .chartcard, .reqrow { min-width: 0; }
.tcard .tinfo, .arow .aname, .tname { min-width: 0; }
.tname, .arow .aname { overflow-wrap: anywhere; }

/* 헤더: 이름과 버튼이 서로를 밀어내지 않게 (좁으면 다음 줄로) */
.topbar .row1 { flex-wrap: wrap; row-gap: 8px; }
.topbar .row1 .who { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .row1 button, .topbar .row1 a { flex: 0 0 auto; }

/* 화면 이동 버튼 줄 (구역 목록 상단) */
.topbar .row2.navrow { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; padding-bottom: 10px; overflow-x: visible; }
.topbar .row2.navrow button {
  border: 1px solid var(--line); background: #fff; border-radius: 10px; color: #374151;
  padding: 10px 6px; min-height: 44px; font-size: .95em; white-space: nowrap;
}

/* 탭: 손가락으로 누르기 좋게, 스크롤바는 감춘다 */
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { min-height: 46px; padding: 12px 14px; }

/* 하단 안전영역(iOS 홈바) */
.cards, .page, .detail, .alist { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(18px + env(safe-area-inset-bottom)); }
.sheetwrap { padding-bottom: env(safe-area-inset-bottom); }
.sheetwrap .sheet, .keypad .sheet { max-height: 88dvh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet .actions { position: sticky; bottom: 0; background: #fff; padding-top: 8px; }

/* 로그인 */
.login { padding: 0 20px calc(28px + env(safe-area-inset-bottom)); min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
.login .brand { margin-bottom: 26px; }
.login .brand .logo {
  display: inline-block; background: #F96B20; color: #fff; font-weight: 800; letter-spacing: -.3px;
  border-radius: 12px; padding: 8px 14px; font-size: .95em; margin-bottom: 12px;
}
.login h1 { font-size: 1.5em; margin: 0 0 4px; letter-spacing: -.4px; }
.login .cong { color: var(--muted); margin: 0; }
.login input { padding: 16px 14px; font-size: max(16px, 1em); border-radius: 12px; }
.login button.primary { padding: 17px; border-radius: 12px; font-size: 1.05em; margin-top: 4px; }
.login .footnote { color: var(--muted); font-size: .82em; text-align: center; margin: 18px 0 0; }

/* 관리자 ID/PW 폼 */
.adminform { padding: 18px 16px 40px; }
.adminform.full { padding-top: 28px; }
.adminform h2 { font-size: 1.15em; margin: 0 0 6px; }
.adminform .sub3 { color: var(--muted); font-size: .86em; margin: 0 0 16px; }
.adminform.compact { padding: 6px 0 0; }
.adminform input { padding: 15px 13px; border-radius: 11px; }
.adminform button.primary { margin-top: 8px; padding: 16px; border-radius: 11px; }

/* 좁은 화면: 목록 행을 2줄로 (번호·상태·버튼 / 이름) */
@media (max-width: 520px) {
  .arow { flex-wrap: wrap; row-gap: 6px; }
  .arow .aname { flex: 1 1 100%; order: 3; }
  .arow .ano { order: 1; }
  .arow .round { order: 2; }
  .arow .chk { order: 2; margin-left: auto; min-height: 44px; min-width: 88px; font-size: 15px; }
  .arow .aname .sub2 { display: block; }
  .tcard { flex-wrap: nowrap; }
  .tcard .badge { align-self: center; }
}

/* 관리자 표: 좁은 화면에서 가로 스크롤 */
@media (max-width: 760px) {
  .page table, .tablewrap table { display: block; width: 100%; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .page table td.detail { max-width: 200px; }
  .grid2 { grid-template-columns: 1fr; }
  .chartgrid { grid-template-columns: 1fr; }
  .statusrow { grid-template-columns: repeat(2, 1fr); }
  .roundbar { gap: 6px; }
  .rstat { min-width: 0; flex: 1 1 88px; padding: 8px 10px; }
  .setrow { flex-wrap: wrap; row-gap: 8px; }
  .setrow .lbl { flex: 1 1 100%; }
  .seg { flex-wrap: wrap; }
  .filters input, .filters select { flex: 1 1 100%; }
  table th, table td { padding: 10px 8px; }
}

/* 데스크톱(관리자) 화면은 넓게 */
@media (min-width: 900px) {
  .page .topbar .row1 { padding: 12px 16px 8px; }
}

