/* ── 테마 토큰 ────────────────────────────────────────────────
   html[data-theme] 는 index.html 머리의 작은 스크립트가 CSS보다 먼저 정함
   (저장값 → 텔레그램 테마 → 기기 설정). 헤더의 ON 스위치로 바꿈.
   --accent / --accent-ink / --on-accent 는 사용자 지파색으로 JS가 대비를 맞춰 넣음 */
:root, html[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;            /* 카드·헤더 */
  --bg2: #f2f3f5;           /* 화면 바탕 */
  --text: #15171a;
  --hint: #6b7280;
  --line: color-mix(in srgb, var(--hint) 22%, transparent);
  --accent: #009651;
  --accent-ink: #00804a;
  --on-accent: #ffffff;
  --tag-go-bg: #e3f6ec;  --tag-go: #0b7a43;
  --tag-plan-bg: #e6f0fb; --tag-plan: #1f65b5;
  --tag-hold-bg: #f1f1f3; --tag-hold: #5f6570;
  --shadow: 0 1px 4px rgba(0,0,0,.18);
  /* 헤더 (시안 3 · 낮) */
  --hdr-bg: #ffffff; --hdr-top: #ffffff; --hdr-fg: #10142b; --hdr-line: #e6e8ef; --hdr-chip: #f1f2f7;
  /* ON 스위치 (시안 3 · 낮) */
  --sw-track: #f4f5fa; --sw-on: #10142b; --sw-on-glow: transparent; --sw-glow: .32;
  --sw-knob: radial-gradient(circle at 35% 30%, #ffffff, #eef0f6); --sw-knob-shadow: 0 1px 3px rgba(16,20,43,.28);
  --sw-icon: #e39300;
  --danger: #c62828;
  /* 분야 배지 (글자 대비 4.5:1 이상) */
  --fd-env-bg: #e3f4e8; --fd-env: #17703b;
  --fd-vet-bg: #e5ebf7; --fd-vet: #29468a;
  --fd-wel-bg: #fdebdc; --fd-wel: #a2470f;
  --fd-dis-bg: #efe6f7; --fd-dis: #6a3796;
  --fd-old-bg: #e1f1f1; --fd-old: #1d6a6a;
  --radius: 14px;
  --appbar-h: 60px;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1c21;            /* 카드·헤더: 다크 그레이 */
  --bg2: #0f1013;           /* 화면 바탕 */
  --text: #eceef1;
  --hint: #9aa1ab;
  --line: color-mix(in srgb, var(--hint) 20%, transparent);
  --accent-ink: #4fd39a;
  --tag-go-bg: #12372a;  --tag-go: #6ee7a8;
  --tag-plan-bg: #14294a; --tag-plan: #8ab8f5;
  --tag-hold-bg: #262a31; --tag-hold: #a7adb6;
  --shadow: 0 1px 6px rgba(0,0,0,.55);
  /* 헤더 (시안 3 · 밤) — 다크 그레이 */
  --hdr-bg: #1a1c21; --hdr-top: #1a1c21; --hdr-fg: #ffffff; --hdr-line: rgba(255,255,255,.06); --hdr-chip: rgba(255,255,255,.08);
  /* ON 스위치 (시안 3 · 밤) — 켜진 스위치 */
  --sw-track: #0f1013; --sw-on: #ffffff; --sw-on-glow: rgba(255,255,255,.55);
  --sw-knob: radial-gradient(circle at 35% 30%, #ffffff, #e6e9f5); --sw-knob-shadow: 0 0 10px rgba(255,255,255,.45), 0 1px 2px rgba(0,0,0,.4);
  --sw-icon: #10142b;
  --danger: #ff8f8a;
  --fd-env-bg: #12382a; --fd-env: #7fe0a6;
  --fd-vet-bg: #1b2d55; --fd-vet: #a9c1f5;
  --fd-wel-bg: #3e2615; --fd-wel: #ffbf8f;
  --fd-dis-bg: #33204a; --fd-dis: #d4b1f3;
  --fd-old-bg: #133838; --fd-old: #8fdcdc; --sw-glow: .55;
}
/* 12지파 색 (공식 순서) — 스위치 테두리·뒤쪽 빛 번짐에만 은은하게 (시안 3: 천천히 회전) */
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
:root {
  --tribes: #009651, #00a0e9, #1d2088, #59c3e1, #eb6120, #d7005b,
            #fdd000, #86cab6, #e39300, #6FBA2C, #005dac, #7f1084;
  --tribe-ring: conic-gradient(from var(--ang), var(--tribes), #009651);
  --tribe-ring-still: conic-gradient(from 200deg, var(--tribes), #009651);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg2); color: var(--text); transition: background-color .2s, color .2s;
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", sans-serif;
  font-size: 15px; line-height: 1.45; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── 헤더 60px · 시안 3 「ON 토글 스위치 & 글로우」 ─────────────
   밤 = 다크 그레이 + 켜진 스위치, 낮 = 같은 구조의 밝은 판. ON 스위치 = 낮/밤 전환 */
.appbar { position: sticky; top: 0; z-index: 50; height: var(--appbar-h);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 12px 0 16px; background: var(--hdr-bg); color: var(--hdr-fg); border-bottom: 1px solid var(--hdr-line);
  transition: background .25s, color .25s, border-color .25s; }
.appbar-left { display: flex; align-items: center; gap: 2px; min-width: 0; flex: 0 0 auto; }
.appbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; min-width: 0; flex: 1 1 auto; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* 웹 모드 전용: 뒤로(미니앱은 텔레그램 뒤로가기 사용), 로그아웃 */
.nav-back { width: 40px; height: 44px; margin-left: -8px; display: grid; place-items: center; border-radius: 12px; color: var(--hdr-fg); }
.nav-back svg { width: 22px; height: 22px; }
.nav-back:active { background: var(--hdr-chip); }
.nav-back[hidden], .logout-btn[hidden] { display: none; }
.logout-btn { flex: 0 0 auto; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--hdr-line);
  background: var(--hdr-chip); font-size: 13px; font-weight: 700; color: var(--hdr-fg); white-space: nowrap; }
.logout-btn:hover { filter: brightness(.97); }
.logout-btn:focus-visible, .nav-back:focus-visible { outline: 2px solid var(--hdr-fg); outline-offset: 2px; }
.wm { margin: 0; font-size: 23px; font-weight: 800; letter-spacing: -.035em; line-height: 1; color: var(--hdr-fg); white-space: nowrap; }
.appbar .chip { margin: 0; min-width: 0; flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--hdr-chip); }
html:not([data-auth="in"]) .appbar .chip { color: var(--hint); }   /* 로그인 전 중립 */
@media (max-width: 400px) { .appbar-right:has(.logout-btn:not([hidden])) .chip { display: none; } }

/* ── 웹 로그인 ─────────────────────────────────────────────── */
.login-card { max-width: 400px; margin: min(8vh, 64px) auto 0; background: var(--bg); border-radius: 18px;
  padding: 28px 22px 22px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.login-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.login-desc { margin: 0 0 4px; color: var(--hint); font-size: 15px; line-height: 1.5; }
.login-desc b { color: var(--text); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.login-code { width: 100%; height: 64px; box-sizing: border-box; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--bg2); color: var(--text); text-align: center; font: inherit; font-size: 30px; font-weight: 800;
  letter-spacing: .38em; padding-left: .38em; font-variant-numeric: tabular-nums; outline: none; }
.login-code::placeholder { color: color-mix(in srgb, var(--hint) 45%, transparent); }
.login-code:focus { border-color: var(--text); }
.login-code[aria-invalid="true"] { border-color: var(--danger); }
.login-error { margin: 0; min-height: 20px; color: var(--danger); font-size: 14px; font-weight: 600; }
.login-btn { height: 52px; border-radius: 14px; background: var(--text); color: var(--bg);   /* 로그인 전엔 지파색을 모름 → 글자색 잉크 */
  font-size: 16px; font-weight: 800; }
.login-btn:disabled { opacity: .55; cursor: default; }
.login-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.login-form { display: flex; flex-direction: column; gap: 12px; }
.login-form[hidden], .pw-block[hidden] { display: none; }
.pw-block { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.login-link { align-self: center; min-height: 44px; padding: 0 12px; font-size: 14px; font-weight: 700; color: var(--hint);
  text-decoration: underline; text-underline-offset: 3px; }
.login-link:hover { color: var(--text); }
.login-link:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 8px; }
.login-pw { width: 100%; height: 52px; box-sizing: border-box; border-radius: 14px; border: 1.5px solid var(--line);
  background: var(--bg2); color: var(--text); font: inherit; font-size: 16px; padding: 0 16px; outline: none; }
.login-pw:focus { border-color: var(--text); }
.login-pw[aria-invalid="true"] { border-color: var(--danger); }
.login-help { margin: 6px 0 0; padding: 12px 0 0 18px; border-top: 1px solid var(--line); color: var(--hint); font-size: 13px; line-height: 1.7; }
.lock-msg { font-size: 15px !important; color: var(--text) !important; line-height: 1.6; }

/* ON 스위치 56×30 (누르는 영역은 64×44) — 왼쪽=낮, 오른쪽=밤 */
.onsw { position: relative; isolation: isolate; width: 64px; height: 44px; display: grid; place-items: center; padding: 0; border-radius: 999px; }
.onsw:focus { outline: none; }
.onsw:focus-visible .onsw-track { outline: 2px solid var(--hdr-fg); outline-offset: 3px; }
.onsw-glow { position: absolute; z-index: -1; width: 64px; height: 36px; border-radius: 999px; background: var(--tribe-ring);
  filter: blur(9px); opacity: var(--sw-glow); pointer-events: none; transition: opacity .3s; animation: onsw-spin 9s linear infinite; }
.onsw-track { position: relative; display: block; width: 56px; height: 30px; box-sizing: border-box; border-radius: 999px;
  border: 1.5px solid transparent;
  background: linear-gradient(var(--sw-track), var(--sw-track)) padding-box, var(--tribe-ring) border-box;
  animation: onsw-spin 9s linear infinite; transition: background .25s; }
.onsw-on { position: absolute; top: 0; left: 0; width: 28px; height: 27px; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 800; letter-spacing: .07em; color: var(--sw-on); text-shadow: 0 0 8px var(--sw-on-glow);
  transform: translateX(25px); transition: transform .25s ease, color .25s, text-shadow .25s; }
.onsw-knob { position: absolute; top: 2.5px; left: 2.5px; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--sw-knob); color: var(--sw-icon);
  box-shadow: var(--sw-knob-shadow); transition: transform .25s cubic-bezier(.3,.7,.4,1.2), box-shadow .25s; }
.onsw-knob > * { grid-area: 1 / 1; transition: opacity .2s, transform .25s; }
.onsw-knob svg { width: 13px; height: 13px; }
.onsw-dot { width: 7px; height: 7px; border-radius: 50%; background: conic-gradient(var(--tribes), #009651); opacity: 0; transform: scale(.4); }
html[data-theme="dark"] .onsw-knob { transform: translateX(26px); }
html[data-theme="dark"] .onsw-on { transform: translateX(0); }
html[data-theme="dark"] .ic-sun { opacity: 0; transform: rotate(40deg) scale(.6); }
html[data-theme="dark"] .onsw-dot { opacity: 1; transform: none; }
.onsw:active .onsw-knob { width: 26px; }
html[data-theme="dark"] .onsw:active .onsw-knob { transform: translateX(22px); }
@keyframes onsw-spin { to { --ang: 360deg; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.view { display: none; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); min-height: calc(100vh - var(--appbar-h)); }
.view.active { display: block; animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }
h2 { font-size: 20px; margin: 4px 0 14px; letter-spacing: -.02em; }

/* 홈 */
.chip { display: inline-block; margin: 8px 0 0; padding: 5px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg)); color: var(--accent-ink); font-size: 13px; font-weight: 600; }

.search { position: relative; margin-bottom: 14px; }
.search input { width: 100%; height: 46px; padding: 0 42px 0 16px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; outline: none; }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search input:focus { border-color: var(--accent); }
.icon-btn { position: absolute; right: 6px; top: 6px; width: 34px; height: 34px; color: var(--hint); }

.menu { background: var(--bg); border-radius: var(--radius); overflow: hidden; }
.menu-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  text-align: left; border-bottom: 1px solid var(--line); }
.menu-item:last-child { border-bottom: 0; }
.menu-item:active { background: var(--bg2); }
.mi-icon { font-size: 20px; width: 26px; text-align: center; }
.mi-label { flex: 1; font-weight: 600; }
.mi-label small { display: block; font-weight: 400; font-size: 12px; color: var(--hint); }
.mi-val { font-size: 20px; font-weight: 800; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.menu-item.accent { background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.foot { text-align: center; color: var(--hint); font-size: 12px; margin-top: 14px; }

/* ── 분야 필터 바 (가로 스크롤 칩) ─────────────────────────── */
.fieldbar { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  margin: 0 -16px 12px; padding: 2px 16px; scroll-padding: 0 16px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%); }
.fieldbar::-webkit-scrollbar { display: none; }
.fchip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 14px;
  border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--text);
  font-size: 14px; font-weight: 700; white-space: nowrap; transition: background-color .15s, color .15s, border-color .15s; }
.fchip small { font-size: 11.5px; font-weight: 600; color: var(--hint); font-variant-numeric: tabular-nums; }
.fchip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.fchip.on small { color: inherit; opacity: .8; }
.fchip:active { transform: scale(.97); }
.fchip:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
#view-map .fieldbar { flex: 0 0 auto; margin-bottom: 10px; }
@media (min-width: 760px) { .fieldbar { flex-wrap: wrap; overflow: visible; margin: 0 0 12px; padding: 2px 0; -webkit-mask-image: none; mask-image: none; } }

/* 분야 배지 (목록·상세) */
.fb { display: inline-block; padding: 1px 7px; margin-right: 4px; border-radius: 6px; font-size: 11.5px; font-weight: 700;
  line-height: 1.5; vertical-align: 1px; background: var(--tag-hold-bg); color: var(--tag-hold); }
.fb[data-f="환경"] { background: var(--fd-env-bg); color: var(--fd-env); }
.fb[data-f="보훈"] { background: var(--fd-vet-bg); color: var(--fd-vet); }
.fb[data-f="복지"] { background: var(--fd-wel-bg); color: var(--fd-wel); }
.fb[data-f="장애인"] { background: var(--fd-dis-bg); color: var(--fd-dis); }
.fb[data-f="노인"] { background: var(--fd-old-bg); color: var(--fd-old); }
.detail .row .fb { margin: 0; }

/* 큰 숫자 */
.big { background: var(--bg); border-radius: var(--radius); padding: 18px; margin-bottom: 12px; }
.big .num { font-size: 40px; font-weight: 800; color: var(--accent-ink); line-height: 1.1; }
.big .num small { font-size: 16px; font-weight: 600; color: var(--hint); margin-left: 4px; }
.big .sub { color: var(--hint); font-size: 13px; margin-top: 4px; }

/* 세그먼트 */
.seg { display: flex; gap: 6px; background: var(--bg); padding: 4px; border-radius: 12px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 8px 4px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--hint); }
.seg button.on { background: var(--accent); color: var(--on-accent); }

/* 단일 막대 (누적막대 사용 안 함) */
.bars { background: var(--bg); border-radius: var(--radius); padding: 6px 14px; margin-bottom: 12px; }
.bar-row { display: grid; grid-template-columns: 86px 1fr auto; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.bar-row:last-child { border-bottom: 0; }
.bar-row.me { font-weight: 800; }
.bar-row .lbl { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .track { display: block; height: 10px; background: var(--bg2); border-radius: 6px; overflow: hidden; }
.bar-row .fill { display: block; height: 100%; border-radius: 6px; background: var(--accent); }
.bar-row .val { font-variant-numeric: tabular-nums; text-align: right; min-width: 54px; }
.bar-row .val b { font-size: 17px; }
.bar-row .val small { display: block; color: var(--hint); font-size: 11px; font-weight: 400; }
.bar-row .desc { grid-column: 1 / -1; margin-top: -4px; font-size: 12px; color: var(--hint); font-weight: 400; }
.group-title { font-size: 12px; color: var(--hint); font-weight: 700; padding: 12px 0 2px; display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* 인사 카드 목록 */
.list { display: flex; flex-direction: column; gap: 8px; }
.list:empty { display: none; }
.list[hidden] { display: none; }               /* 검색 지운 뒤 지난 결과가 남던 문제 */
.vip { background: var(--bg); border-radius: 12px; padding: 12px 14px; text-align: left; width: 100%;
  display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; }
.vip:active { background: color-mix(in srgb, var(--accent) 8%, var(--bg)); }
.vip .nm { font-weight: 700; }
.vip .nm .id { font-weight: 500; color: var(--hint); font-size: 12px; margin-left: 6px; }
.vip .meta { grid-column: 1; color: var(--hint); font-size: 13px; }
.vip .tag { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.tag.진행 { background: var(--tag-go-bg); color: var(--tag-go); }
.tag.예정 { background: var(--tag-plan-bg); color: var(--tag-plan); }
.tag.보류 { background: var(--tag-hold-bg); color: var(--tag-hold); }
.empty { text-align: center; color: var(--hint); padding: 28px 0; }

/* ── 지경 인사 분포도 ──────────────────────────────────────────
   화면 높이 고정: 지도(위) + 선택 지경 명단(아래, 자체 스크롤) → 서로 겹치지 않음
   텔레그램은 --tg-viewport-stable-height 를 넣어 줌 (키보드·확장 애니메이션에도 안정) */
#view-map.active { display: flex; flex-direction: column; min-height: 0;
  height: calc(100vh - var(--appbar-h)); height: calc(var(--tg-viewport-stable-height, 100dvh) - var(--appbar-h));
  padding-bottom: 0; overflow: hidden; }
#view-map h2 { margin-bottom: 10px; }
#view-map .seg { flex: 0 0 auto; margin-bottom: 10px; }
.map-body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.map-card { position: relative; flex: 0 0 auto; height: clamp(230px, 50%, 560px);
  background: var(--bg); border-radius: var(--radius); overflow: hidden; }
#map { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
#map:active { cursor: grabbing; }
.map-tools { position: absolute; right: 8px; top: 8px; display: flex; flex-direction: column; gap: 6px; }
.map-tools button { width: 44px; height: 44px; border-radius: 12px; background: var(--bg); color: var(--text);
  box-shadow: var(--shadow); font-size: 22px; font-weight: 700; line-height: 1; }
.map-tools button.txt { font-size: 11px; font-weight: 700; line-height: 1.15; }
.map-tools button:active { background: var(--bg2); }
.map-legend { position: absolute; left: 8px; bottom: 8px; margin: 0; display: flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 8px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  color: var(--hint); font-size: 11px; pointer-events: none; }
.lg-ramp { width: 40px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 25%, var(--bg)), var(--accent)); }
.map-loading { position: absolute; inset: 0; margin: 0; display: flex; align-items: center; justify-content: center;
  color: var(--hint); font-size: 14px; background: var(--bg); }
.map-loading[hidden] { display: none; }

.region-panel { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.region-head { position: sticky; top: 0; z-index: 2; background: var(--bg2);
  display: flex; align-items: center; gap: 10px; padding: 2px 0 10px; min-height: 52px; }
.region-head .pin { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.region-head .rt { flex: 1; min-width: 0; }
.region-head .rn { font-size: 18px; font-weight: 800; letter-spacing: -.02em; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.region-head .rs { font-size: 12px; color: var(--hint); }
.region-head .rc { font-size: 22px; font-weight: 800; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.region-head .rc small { font-size: 12px; color: var(--hint); font-weight: 600; margin-left: 2px; }
.region-head .x { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; background: var(--bg); color: var(--hint); font-size: 16px; }
.rrows { background: var(--bg); border-radius: var(--radius); padding: 2px 14px; }
.rrow { width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 0; text-align: left;
  border-bottom: 1px solid var(--line); min-height: 44px; }
.rrow:last-child { border-bottom: 0; }
.rrow .nm { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rrow .home { color: var(--accent-ink); font-size: 12px; font-weight: 700; }
.rrow b { color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.rrow:active { background: var(--bg2); }

/* SVG 지도 요소 */
.rg { stroke: var(--bg); stroke-width: .6; vector-effect: non-scaling-stroke; cursor: pointer; transition: opacity .2s; }
.rg.zero { fill: color-mix(in srgb, var(--hint) 16%, var(--bg)); }
#map.has-sel .rg:not(.sel) { opacity: .42; }
.rg:focus { outline: none; }
.rg:focus-visible { stroke: var(--text); stroke-width: 2; }
.pv { fill: none; stroke: color-mix(in srgb, var(--text) 50%, transparent); stroke-width: 1.1;
  vector-effect: non-scaling-stroke; pointer-events: none; stroke-linejoin: round; }
.hl { fill: none; stroke: var(--text); stroke-width: 3; vector-effect: non-scaling-stroke; pointer-events: none; stroke-linejoin: round; }
.hl-glow { fill: none; stroke: var(--bg); stroke-width: 7; vector-effect: non-scaling-stroke; pointer-events: none; stroke-linejoin: round; }
.rl { fill: var(--text); paint-order: stroke; stroke: var(--bg); stroke-linejoin: round; font-weight: 600;
  text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.bd { cursor: pointer; }
.bd circle { stroke: var(--bg); }
.bd text { font-weight: 800; text-anchor: middle; dominant-baseline: central; pointer-events: none; font-variant-numeric: tabular-nums; }
.bd.sel circle { stroke: var(--text); }
.star { fill: var(--text); stroke: var(--bg); stroke-linejoin: round; pointer-events: none; }

/* 넓은 화면(텔레그램 데스크톱 확장·PC 미리보기): 지도 왼쪽, 명단 오른쪽 */
@media (min-width: 760px) {
  .map-body { flex-direction: row; }
  .map-card { flex: 1 1 auto; height: auto; }
  .region-panel { flex: 0 0 340px; }
}

/* 바텀시트 */
.sheet { position: fixed; inset: 0; z-index: 1000; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); animation: fade .15s; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; overflow: auto;
  background: var(--bg2); border-radius: 18px 18px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  animation: up .2s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet h3 { margin: 0 0 12px; font-size: 18px; }
.detail { background: var(--bg); border-radius: 12px; padding: 4px 14px; }
.detail .row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.detail .row:last-child { border-bottom: 0; }
.detail .row span:first-child { color: var(--hint); }
.detail .row span:last-child { text-align: right; font-weight: 600; }

html[data-theme="dark"] .toast { background: rgba(236,238,241,.94); color: #15171a; }
html[data-theme="dark"] .sheet-backdrop { background: rgba(0,0,0,.6); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: rgba(20,22,26,.9);
  color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 2000; max-width: 90vw; }

/* ═══════════════════ 추가: + 버튼 · 신규 인사 등록 · 인사만남일지 (기존 스타일 토큰만 사용) ═══════════════════ */
:root, html[data-theme="light"] { --adm-bg: #fff1d9; --adm: #8a4600; --ok-bg: #e3f6ec; --ok: #0b7a43; }
html[data-theme="dark"] { --adm-bg: #3b2a12; --adm: #ffcf8a; --ok-bg: #103a35; --ok: #6ee7b7; }

/* + 버튼이 마지막 내용을 가리지 않게 아래 여백만 늘림 */
.view { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
.region-panel { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* 우측 하단 + 버튼 */
.fab-wrap { position: fixed; right: calc(18px + env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 1500; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; pointer-events: none;
  transition: opacity .18s, transform .18s; }
.fab-wrap > * { pointer-events: auto; }
.fab-wrap.is-hidden { opacity: 0; transform: scale(.85); }
.fab-wrap.is-hidden > * { pointer-events: none; }
html:not([data-auth="in"]) .fab-wrap, html:not([data-auth="in"]) .fab-backdrop { display: none; }
.fab-btn { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent), 0 2px 6px rgba(0,0,0,.22);
  transition: transform .2s cubic-bezier(.3,.7,.4,1.2), background-color .2s; }
.fab-btn svg { width: 30px; height: 30px; transition: transform .22s cubic-bezier(.3,.7,.4,1.2); }
.fab-wrap.open .fab-btn svg { transform: rotate(45deg); }
.fab-btn:active { transform: scale(.94); }
.fab-btn:focus-visible { outline: 3px solid var(--text); outline-offset: 3px; }
.fab-menu { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab-menu[hidden] { display: none; }
.fab-item { display: inline-flex; align-items: center; gap: 10px; height: 54px; padding: 0 20px 0 8px; border-radius: 999px;
  background: var(--bg); color: var(--text); box-shadow: 0 4px 14px rgba(0,0,0,.2);
  font-size: 15px; font-weight: 800; white-space: nowrap; animation: fabIn .2s ease backwards; }
.fab-item:nth-child(2) { animation-delay: .04s; }
.fab-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 19px;
  background: color-mix(in srgb, var(--accent) 14%, var(--bg)); }
.fab-item:active { transform: scale(.97); }
.fab-item:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
@keyframes fabIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
.fab-backdrop { position: fixed; inset: 0; z-index: 1490; background: rgba(0,0,0,.32); animation: fade .15s; }
.fab-backdrop[hidden] { display: none; }
html[data-theme="dark"] .fab-backdrop { background: rgba(0,0,0,.6); }
html[data-theme="dark"] .fab-item { box-shadow: 0 4px 16px rgba(0,0,0,.55); }
@media (min-width: 760px) { .fab-wrap { right: 28px; bottom: 28px; } .fab-btn { width: 66px; height: 66px; } }

/* 인사 상세 바텀시트 하단 버튼 2개 */
.dact { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.dact-btn { min-height: 52px; padding: 8px 10px; border-radius: 12px; font-size: 14px; font-weight: 800; line-height: 1.3; text-align: center; }
.dact-btn.lock { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.dact-btn.write { background: var(--accent); color: var(--on-accent); }
.dact-btn:active { transform: scale(.98); }
.dact-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* 등록·일지 모달 (모바일=바텀시트, PC=가운데 창) */
.sheet--form { z-index: 1100; }
.sheet--form .fm-panel { display: flex; flex-direction: column; overflow: hidden; padding: 0; max-height: 92vh; max-height: 92dvh; outline: none; }
.fm-head { flex: 0 0 auto; padding: 8px 16px 12px; border-bottom: 1px solid var(--line); }
.fm-titlebar { display: flex; align-items: center; gap: 10px; }
.fm-titlebar h3 { flex: 1; min-width: 0; margin: 0; font-size: 19px; letter-spacing: -.02em; line-height: 1.3; }
.fm-x { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; background: var(--bg); color: var(--hint); font-size: 15px; }
.fm-x:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
#fm-sub { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#fm-sub:empty { display: none; }
.fm-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px 16px 18px; }
.fm-foot { flex: 0 0 auto; display: flex; gap: 8px; padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--bg2); }
.fm-foot:empty { display: none; }
.fm-btn { flex: 1; height: 52px; border-radius: 14px; font-size: 16px; font-weight: 800; background: var(--bg); border: 1px solid var(--line); }
.fm-btn.primary { flex: 1.7; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.fm-btn:disabled { opacity: .55; cursor: default; }
.fm-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
@media (min-width: 760px) {
  .sheet--form { display: flex; align-items: center; justify-content: center; padding: 24px; }
  .sheet--form[hidden] { display: none; }
  .sheet--form .fm-panel { position: relative; inset: auto; width: min(680px, 100%); max-height: min(88vh, 920px);
    border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
  .sheet--form .sheet-grip { display: none; }
  .fm-head { padding-top: 16px; }
}

.adm-badge { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px; border-radius: 999px;
  background: var(--adm-bg); color: var(--adm); font-size: 12.5px; font-weight: 800; }
.mini-badge { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; background: var(--bg);
  border: 1px solid var(--line); color: var(--hint); font-size: 12px; font-weight: 700; white-space: nowrap; }

/* 입력 폼 */
.fm-idline { display: flex; align-items: center; gap: 8px; margin: 0 2px 10px; font-size: 13px; color: var(--hint); }
.fm-idline b { color: var(--text); font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.fm-card { background: var(--bg); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 16px; }
.fm-sec { font-size: 13px; font-weight: 800; color: var(--hint); margin: 4px 2px 8px; }
.fm-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 560px) { .fm-grid.two { grid-template-columns: 1fr 1fr; } }
.fm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset.fm-field { display: block; }
fieldset.fm-field > legend { padding: 0; margin-bottom: 6px; }
fieldset.fm-field > .fm-err { margin-top: 6px; }
.fm-lbl { font-size: 13px; font-weight: 700; color: var(--hint); }
.fm-lbl i { font-style: normal; color: var(--danger); margin-left: 2px; }
.fm-lbl small { font-size: 12px; font-weight: 500; }
.fm-input, .fm-select, .fm-ta { width: 100%; box-sizing: border-box; border-radius: 12px; border: 1px solid var(--line);
  background-color: var(--bg2); color: var(--text); font: inherit; font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s; }
.fm-input, .fm-select { height: 48px; padding: 0 14px; }
.fm-input[type="date"] { -webkit-appearance: none; appearance: none; display: flex; align-items: center; }
.fm-input[type="date"]::-webkit-date-and-time-value { text-align: left; }
.fm-select { -webkit-appearance: none; appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--hint) 50%), linear-gradient(135deg, var(--hint) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.fm-ta { display: block; padding: 12px 14px; line-height: 1.6; resize: vertical; min-height: 76px; }
.fm-ta.lg { min-height: 236px; }
.fm-input:focus, .fm-select:focus, .fm-ta:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.fm-input[aria-invalid="true"], .fm-select[aria-invalid="true"], .fm-ta[aria-invalid="true"] { border-color: var(--danger); }
.fm-err { margin: 0; font-size: 12.5px; font-weight: 600; color: var(--danger); }
.fm-err:empty { display: none; }
.fm-inline { display: flex; gap: 8px; align-items: center; }
.fm-inline .fm-input { flex: 1; min-width: 0; }
.fm-check { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 48px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--line); font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.fm-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.fm-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.fm-opt { position: relative; display: inline-flex; }
.fm-opt input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.fm-opt span { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); font-size: 14px; font-weight: 700; white-space: nowrap;
  transition: background-color .15s, color .15s, border-color .15s; }
.fm-opt input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.fm-opt input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }
fieldset[aria-invalid="true"] .fm-opt span { border-color: var(--danger); }
.fm-count { margin: 0; font-size: 12px; color: var(--hint); text-align: right; font-variant-numeric: tabular-nums; }

/* 대상 인사 선택 */
.pk-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 264px; overflow-y: auto; overscroll-behavior: contain; }
.pk-list:empty { display: none; }
.pk-hint { font-size: 12.5px; color: var(--hint); padding: 2px; }
.pk-item { display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 10px 12px; border-radius: 12px; background: var(--bg2); text-align: left; }
.pk-item:hover, .pk-item:active { background: color-mix(in srgb, var(--accent) 10%, var(--bg2)); }
.pk-item:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.pk-item .nm { font-weight: 700; }
.pk-item .id, .pk-card .id { font-weight: 500; color: var(--hint); font-size: 12px; margin-left: 6px; }
.pk-item .meta { font-size: 12.5px; color: var(--hint); }
.pk-card { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 9%, var(--bg)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.pk-card > div { flex: 1; min-width: 0; }
.pk-card b { font-weight: 800; }
.pk-card small { display: block; margin-top: 1px; color: var(--hint); font-size: 12.5px; }
.pk-card button { flex: 0 0 auto; height: 36px; padding: 0 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; font-weight: 700; }

/* 인사만남일지: 작성 모드 탭 · 녹음 자동 등록 */
.jr-tabs button { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 9px 6px; line-height: 1.25; font-weight: 800; }
.jr-tabs button small { font-size: 11px; font-weight: 600; opacity: .85; }
.jr-pane { margin-bottom: 14px; }
.jr-pane[hidden] { display: none; }
.jr-drop { border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--bg));
  border-radius: var(--radius); padding: 16px 14px; text-align: center; transition: background-color .15s, border-color .15s; }
.jr-drop.drag { background: color-mix(in srgb, var(--accent) 15%, var(--bg)); border-color: var(--accent); }
.jr-drop-ic { font-size: 28px; line-height: 1; }
.jr-drop-t { margin-top: 6px; font-weight: 800; }
.jr-drop-s { margin-top: 2px; font-size: 12.5px; color: var(--hint); }
.jr-drop-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.jr-btn { min-height: 48px; padding: 6px 10px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); font-size: 14px; font-weight: 800; line-height: 1.3; }
.jr-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.jr-btn:disabled { opacity: .55; cursor: default; }
.jr-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.jr-src { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--hint); word-break: break-all; }
.jr-src[hidden] { display: none; }
.jr-src b { color: var(--text); font-weight: 700; word-break: break-all; }
.jr-steps { list-style: none; margin: 10px 0 0; padding: 4px 14px; background: var(--bg); border-radius: var(--radius); }
.jr-steps li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.jr-steps li:last-child { border-bottom: 0; }
.jr-steps .st { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--line); color: var(--hint); font-size: 12px; font-weight: 800; }
.jr-steps .lb { flex: 1; min-width: 0; font-weight: 600; color: var(--hint); }
.jr-steps .nt { flex: 0 0 auto; font-size: 12px; color: var(--hint); text-align: right; }
.jr-steps li.run .st { border-color: var(--accent); border-top-color: transparent; color: transparent; animation: spin .8s linear infinite; }
.jr-steps li.done .st { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.jr-steps li.err .st { background: var(--danger); border-color: var(--danger); color: #fff; }
.jr-steps li.run .lb, .jr-steps li.done .lb { color: var(--text); }
.jr-steps li.err .nt { color: var(--danger); font-weight: 700; }
@keyframes spin { to { transform: rotate(360deg); } }
.jr-raw { margin-top: 8px; background: var(--bg); border-radius: 12px; padding: 10px 14px; font-size: 13px; }
.jr-raw[hidden] { display: none; }
.jr-raw summary { cursor: pointer; font-weight: 700; color: var(--hint); }
.jr-raw pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; font: inherit; color: var(--hint); line-height: 1.6; }
.jr-note { margin: 8px 2px 0; font-size: 12.5px; color: var(--hint); }
.jr-manual { background: var(--bg); border-radius: var(--radius); padding: 14px; font-size: 14px; line-height: 1.6; color: var(--hint); }
.jr-manual b { display: block; margin-bottom: 2px; font-size: 15px; color: var(--text); }

/* ✨ 자동 맞춤법 교정 (6하원칙·발언 칸 위에 붙어 다님) */
.jr-tool { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 -16px 8px; padding: 10px 16px; background: var(--bg2); }
.jr-tool .fm-sec { flex: 1 1 auto; margin: 0; }
.spell-btn { height: 40px; padding: 0 15px; border-radius: 999px; font-size: 14px; font-weight: 800; color: var(--text);
  border: 1.5px solid transparent; background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--tribe-ring-still) border-box; }
.spell-btn:disabled { opacity: .6; cursor: default; }
.spell-btn:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.spell-badge { display: inline-flex; align-items: center; padding: 5px 11px; border-radius: 999px; background: var(--ok-bg); color: var(--ok);
  font-size: 12.5px; font-weight: 800; animation: fade .2s ease; }
.spell-badge[hidden] { display: none; }
.fm-ta.fixed { animation: fixedFlash 1.6s ease; }
@keyframes fixedFlash { 0%, 45% { border-color: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 28%, transparent); } }

/* 만남일지 보기 */
.lg-list { display: flex; flex-direction: column; gap: 10px; }
.lg { background: var(--bg); border-radius: var(--radius); padding: 12px 14px; }
.lg-h { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.lg-date { margin-right: 2px; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.lg-src, .lg-ok { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.lg-src.rec { background: var(--tag-plan-bg); color: var(--tag-plan); }
.lg-src.man { background: var(--tag-hold-bg); color: var(--tag-hold); }
.lg-ok { background: var(--ok-bg); color: var(--ok); font-weight: 700; }
.lg-6 { margin: 0; display: grid; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
.lg-6 > div { display: grid; grid-template-columns: 76px 1fr; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lg-6 dt { color: var(--hint); font-size: 13px; font-weight: 700; }
.lg-6 dd { margin: 0; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
@media (min-width: 760px) { .lg-6 { grid-template-columns: 1fr 1fr; column-gap: 18px; } }
.lg-rem { margin-top: 10px; }
.lg-rem-t { margin-bottom: 4px; font-size: 13px; font-weight: 800; color: var(--hint); }
.lg-rem p { margin: 0; padding: 12px; border-radius: 10px; background: var(--bg2); font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.lg-f { margin-top: 8px; font-size: 11.5px; color: var(--hint); word-break: break-all; }
.lg-empty { padding: 32px 12px; border-radius: var(--radius); background: var(--bg); text-align: center; color: var(--hint); line-height: 1.6; }
.lg-warn { margin: 0 2px 10px; font-size: 13px; font-weight: 700; color: var(--danger); }

/* 모달·상세 시트가 열려 있을 때 알림이 아래쪽 버튼을 가리지 않게 위로 */
html:has(#fm-sheet:not([hidden])) .toast, html:has(#sheet:not([hidden])) .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }


/* ═══════════════════ 웹 로그인 (텔레그램 위젯 + /web 코드) · 접근 신청 · 승인 대기 ═══════════════════ */
.login-tg { display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 48px; }
.login-tg-slot { display: flex; justify-content: center; min-height: 40px; }
.login-tg-note { margin: 0; font-size: 12.5px; color: var(--hint); text-align: center; }
.login-or { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; color: var(--hint); font-size: 13px; font-weight: 700; }
.login-or::before, .login-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-sub { margin: 0; font-size: 14px; font-weight: 800; }
.apply-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.apply-grid button { height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2);
  font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.apply-grid button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.apply-grid button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.apply-churches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wait-card { text-align: center; align-items: center; }
.wait-ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px;
  background: var(--bg2); position: relative; }
.wait-ic::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid transparent;
  border-top-color: var(--text); animation: spin 1.1s linear infinite; }
.wait-meta { margin: 0; font-size: 13px; color: var(--hint); }
.wait-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ═══════════════════ 일지: ① 수기 우선 → ② 음성 보고(사후 독백) ═══════════════════ */
.jr-legal { background: var(--adm-bg); color: var(--adm); border-radius: var(--radius); padding: 12px 14px; font-size: 13.5px; line-height: 1.6; margin-bottom: 10px; }
.jr-legal b { display: block; font-size: 14.5px; margin-bottom: 2px; }
.jr-legal ul { margin: 6px 0 0; padding-left: 18px; }
.jr-agree { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin-bottom: 10px; border-radius: var(--radius);
  background: var(--bg); border: 1.5px solid var(--line); font-size: 14px; font-weight: 700; line-height: 1.5; cursor: pointer; }
.jr-agree input { flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); }
.jr-agree:has(input:checked) { border-color: var(--accent); }
.jr-drop[aria-disabled="true"] { opacity: .5; }
.jr-btn.rec-on { background: var(--danger); border-color: var(--danger); color: #fff; }
.lg-src.voi { background: var(--tag-plan-bg); color: var(--tag-plan); }
