:root {
  --navy: #2B3A8C; --navy-2: #3F51A3; --ink: #262B36; --muted: #6B7380; --line: #E2E5EC;
  --bg: #ECEEF2; --card: #FFFFFF; --orange: #D9822B; --hl: #E3E7F5;
  --up: #2E9E6B; --down: #D64545;
  --d-jeondo: #2E9E6B; --d-sinhak: #C9922E; --d-naemu: #3A7CC0;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Pretendard, "Malgun Gothic", sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; }
a { color: var(--navy-2); }
.muted { color: var(--muted); } .small { font-size: 12px; }
.pill { display: inline-block; background: var(--orange); color: #fff; border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 600; }
.kicker { color: var(--orange); font-size: 13px; font-weight: 600; }
h2 { margin: 4px 0 2px; font-size: 22px; } h3 { margin: 0 0 8px; font-size: 15px; }

/* 상단 */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--navy); color: #fff; padding: 12px 24px; }
.brand { display: flex; align-items: center; gap: 12px; } .brand strong { font-size: 17px; }
.top-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.top-right form { margin: 0; }
.who { font-size: 13px; color: #C3CAE8; }
.month { font-size: 13px; color: #C3CAE8; } .month select { margin-left: 6px; }
.btn { border: 1px solid transparent; border-radius: 8px; padding: 7px 14px; font: inherit; cursor: pointer; text-decoration: none; display: inline-block; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn.tiny { padding: 3px 8px; font-size: 12px; background: #fff; border-color: var(--line); color: var(--ink); }
.btn.danger { color: var(--down); }
select, input { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }

/* 탭 */
.tabs { display: flex; gap: 4px; padding: 0 24px; background: #fff; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 14px 16px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--navy); }
.page { padding: 20px 24px 48px; max-width: 1440px; margin: 0 auto; }
.view { display: none; } .view.on { display: block; }
.sec-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.sec-head p { margin: 2px 0 0; }

/* 홈 카드 1×5 */
.cards5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; }
.card .no { color: #8E9BC4; font-weight: 700; font-size: 13px; }
.card .nm { font-size: 22px; font-weight: 800; color: var(--navy); margin: 0 0 12px; letter-spacing: -0.3px; }
.card .rank { font-size: 46px; font-weight: 800; color: var(--navy); line-height: 1; }
.card .rank small { font-size: 18px; font-weight: 700; margin-left: 2px; }
.card .val { font-size: 15px; margin-top: 6px; }
.card .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin: 10px 0 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.card .dept { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 2px 8px; align-self: flex-start; background: var(--hl); color: var(--navy-2); }
.card button.more { margin-top: 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px; font: inherit; font-size: 12px; cursor: pointer; color: var(--navy-2); }
.up { color: var(--up); } .down { color: var(--down); }
.rk { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.rk li { display: grid; grid-template-columns: 34px 1fr auto; gap: 4px; padding: 5px 8px; border-radius: 6px; }
.rk li:nth-child(odd) { background: #F4F6F9; }
.rk li.me { background: var(--hl); font-weight: 700; color: var(--navy); }
.rk .r { color: var(--muted); } .rk li.me .r { color: var(--navy); }
.rk .v { font-variant-numeric: tabular-nums; color: var(--muted); }

/* 상세 */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpis.mini { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.kpi .l { font-size: 12px; color: var(--muted); } .kpi .v { font-size: 26px; font-weight: 800; color: var(--navy); margin-top: 2px; }
.kpi .s { font-size: 12px; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.grid2 > .panel { margin-bottom: 14px; }
.chart { position: relative; height: 260px; } .chart.tall { height: 340px; }
.chart .empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; pointer-events: none; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); padding: 7px 6px; background: #F4F6F9; }
.tbl td { border-bottom: 1px solid #F0F2F6; padding: 7px 6px; }
.tbl td.n, .tbl th.n { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tr.me td { background: var(--hl); font-weight: 700; }
.tbl.small { font-size: 12px; margin-top: 12px; }
.formula { background: var(--hl); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-top: 12px; color: var(--navy); }

/* 관리자 */
.form { display: grid; gap: 10px; margin: 8px 0; } .form label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.form.inline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.files { margin: 0 0 16px; padding-left: 18px; line-height: 1.9; }
.actions { display: flex; gap: 4px; flex-wrap: wrap; } .actions form { display: flex; gap: 4px; margin: 0; }
.tiny-in { width: 120px; padding: 3px 6px; font-size: 12px; }
.flash { max-width: 1440px; margin: 12px auto 0; padding: 0 24px; }
.flash div { background: #FFF4E5; border: 1px solid #F5C99A; color: #8A4B12; border-radius: 10px; padding: 10px 14px; margin-bottom: 6px; }

/* 로그인 */
.login-page { background: var(--navy); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: #fff; border-radius: 16px; padding: 32px; width: 100%; max-width: 380px; display: grid; gap: 12px; }
.login-card h1 { margin: 4px 0 0; font-size: 22px; } .login-card label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.login-card .btn { padding: 10px; }

@media (max-width: 1100px) {
  .cards5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .cards5 { grid-template-columns: 1fr; }
  .page, .top, .tabs { padding-left: 16px; padding-right: 16px; }
}

/* 관리자 탭 */
.tabs button.admin-tab { margin-left: auto; color: var(--orange); }
.tabs button.admin-tab.on { color: var(--orange); border-bottom-color: var(--orange); }
.admin-grid { grid-template-columns: 1.6fr 1fr; }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #EEF0F4; color: var(--muted); }
.tag.admin { background: #FFF1E6; color: #B5651F; }
.tbl tr.off td { color: #A0A6B1; }
.umsg { font-size: 13px; margin: 10px 0; min-height: 18px; }
.umsg.ok { color: var(--up); } .umsg.bad { color: var(--down); }

/* 교회 · 기관 · 부서 내려보기 */
.drill-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.drill-head h3 { margin: 0; }
.drill { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0 8px; }
.drill select { padding: 4px 8px; font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 5px 12px; font: inherit; font-size: 12px; color: var(--muted); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--navy); color: #fff; font-weight: 600; }

/* ③ 하위 탭 · 센터 기수별 현황 */
.subtabs { display: flex; gap: 6px; padding: 10px 24px; background: #F9FAFC; border-bottom: 1px solid var(--line); }
.subtabs[hidden] { display: none; }
.subtabs button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.subtabs button.on { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.kpis.seven { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.scroll-x { overflow-x: auto; }
.scroll-x .tbl td, .scroll-x .tbl th { white-space: nowrap; }
.mix { display: flex; width: 120px; height: 10px; border-radius: 5px; overflow: hidden; background: #EEF0F4; }
.mix i { display: block; height: 100%; }
.mix .p { background: #2E9E6B; } .mix .m { background: #D9A73A; } .mix .a { background: #D64545; }
@media (max-width: 1100px) { .kpis.seven { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 센터 수강 현황 — 강조 · 주 몇 회 */
.kpi.hl { border-color: #F2B98D; background: #FFF9F4; }
.kpi.hl .v { color: #B5651F; }
.tbl th.hl, .tbl td.hl { background: #FFF9F4; }
.tbl tr.me td.hl { background: var(--hl); }
.kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.kpi.wk .v small { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi.wk .s b { color: var(--navy); font-size: 14px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.week-grid { grid-template-columns: 1fr 1.2fr; align-items: center; }
.chart.short { height: 190px; }
.tbl td .sub { display: block; font-size: 11px; color: var(--muted); }

.extra2 { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px; }

/* 제목 · 홈 정리 */
.brand-sub { font-weight: 600; color: #C3CAE8; }
.login-sub { margin: -4px 0 4px; color: var(--orange); font-weight: 700; }
.home-note { text-align: right; margin: -4px 0 12px; min-height: 16px; }
.formula .f-main { font-weight: 700; margin-bottom: 6px; }
.formula .f-note { font-size: 12.5px; line-height: 1.7; color: #3F51A3; }
.formula .f-note::before { content: "· "; }

.kpis.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.settings-form { display: grid; grid-template-columns: 2fr 1.4fr 1.4fr auto; gap: 10px; align-items: end; margin-top: 8px; }
.settings-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
@media (max-width: 1100px) { .settings-form { grid-template-columns: 1fr; } }

/* 재적 현황 표 정렬 */
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--navy); background: #EEF1F8; }
.tbl th.sorted { color: var(--navy); }
.rk-no { display: inline-block; min-width: 22px; color: var(--muted); font-size: 11px; }

/* 임의(가상) 데이터 표시 */
.dummy-tag { display: inline-block; background: #FFE8D6; color: #B5651F; border: 1px dashed #D9822B; border-radius: 6px; padding: 1px 8px; font-size: 11.5px; font-weight: 700; margin-right: 4px; }
.dummy-mini { display: inline-block; background: #FFE8D6; color: #B5651F; border-radius: 4px; padding: 0 4px; font-size: 10px; font-weight: 700; vertical-align: 1px; }
.dummy-note { color: #8A4B12; margin: -2px 0 8px; min-height: 0; }
#lead-panel.is-dummy { border: 1.5px dashed #D9822B; background: #FFFCF9; }
#lead-panel.is-dummy #lead-tbl td.n, #lead-panel.is-dummy .kpi .v { color: #B5651F; font-style: italic; }

/* 12지파 누적 현황 */
.ch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.ch-card { margin-bottom: 0; }
.ch-me { font-size: 13px; color: var(--muted); margin: -2px 0 8px; }
.ch-me b { font-size: 22px; color: var(--navy); margin: 0 4px; }
.ch-me span { font-weight: 700; color: var(--navy); }
.tbl tr.ch-total td { font-weight: 700; color: #2B3A8C; border-top: 2px solid var(--line); background: #F4F6FB; }

/* 예측 적중 기록 */
.hit { color: var(--up); font-weight: 800; }
.miss { color: var(--down); font-weight: 800; }
#track-sum b { color: var(--navy); }


/* 지표 추이 + 구성 항목 카드 */
.chart.short2 { height: 220px; }
.sparks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.spark { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 4px; background: #FBFCFE; }
.spark .l { font-size: 11.5px; color: var(--muted); }
.spark .v { font-size: 19px; font-weight: 800; color: var(--navy); line-height: 1.3; }
.spark .s { font-size: 11px; color: var(--muted); }
.spark .sp { height: 34px; margin-top: 2px; }

/* ───────── 화면 최적화 */
/* 격자 안 차트 · 표가 칸을 밀어내지 않게 */
.grid2 > *, .kpis > *, .cards5 > *, .ch-grid > *, .sparks > * { min-width: 0; }
.page { overflow-x: clip; }
canvas { max-width: 100%; }
/* 긴 표: 높이 고정 상자 안에서 스크롤 → 가로 스크롤바가 항상 화면 안에 보임, 머리글 고정 */
.tbl-box { max-height: 70vh; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.tbl-box .tbl th { position: sticky; top: 0; z-index: 2; box-shadow: 0 1px 0 var(--line); }
.tbl-box .tbl td, .tbl-box .tbl th { white-space: nowrap; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* 센터 기수별 표 */
.tbl.compact { font-size: 12.5px; }
.tbl.compact td { vertical-align: top; padding: 8px 8px; }
.tbl.compact td.c1, .tbl.compact th:first-child { position: sticky; left: 0; background: #fff; z-index: 1; box-shadow: 1px 0 0 var(--line); }
.tbl.compact th:first-child { z-index: 3; background: #F4F6F9; }
.tbl.compact .coh { color: var(--navy-2); font-weight: 600; }
.tbl.compact td.ev { white-space: normal; min-width: 150px; max-width: 230px; }
.tbl.compact tbody tr:hover td, .tbl.compact tr:hover td { background: #F7F9FD; }
.tbl.compact .mix { margin-top: 3px; }
#c-q { width: 230px; padding: 5px 10px; font-size: 13px; }

@media (max-width: 1280px) {
  .kpis.seven { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cards5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card .rank { font-size: 38px; }
}
@media (max-width: 1100px) {
  .week-grid, .admin-grid, .extra2 { grid-template-columns: 1fr; }
  .kpis.seven { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpis.six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabs button { padding: 12px 12px; }
}
@media (max-width: 640px) {
  body { font-size: 13px; }
  h2 { font-size: 19px; }
  .kpis, .kpis.seven, .kpis.six, .kpis.three, .kpis.mini { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi .v { font-size: 21px; }
  .cards5 { grid-template-columns: 1fr; }
  .panel { padding: 12px; }
  .chart { height: 220px; } .chart.tall { height: 280px; }
  .subtabs { padding-left: 16px; padding-right: 16px; overflow-x: auto; }
  .sec-head { align-items: stretch; }
  .drill, .drill select, #c-q { width: 100%; }
  .tbl-box { max-height: 75vh; }
  .top { padding-top: 10px; padding-bottom: 10px; }
  .brand strong { font-size: 15px; }
}

/* 월례회 역산 */
.wl-head { margin-top: 26px; }
.tbl.wl td b { font-weight: 700; color: var(--ink); }
.tbl.wl tr.me td b { color: var(--navy); }
.wl-grid { grid-template-columns: 1fr; }
.card .asof { align-self: flex-start; font-size: 11px; font-weight: 700; color: #B5651F; background: #FFF1E6; border-radius: 6px; padding: 2px 8px; margin: 2px 0 4px; }

/* ───────── 한눈에 보는 상세 */
.story { background: var(--navy); color: #fff; border-radius: 14px; padding: 16px 20px; font-size: 16.5px; line-height: 1.7; margin-bottom: 14px; }
.story b { color: #FFD3AE; } .story b.up { color: #8FE0B0; } .story b.down { color: #FFB1A6; }
.eq-panel h3 { margin-bottom: 14px; }
.eq-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 22px; align-items: center; }
.eq { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.frac { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.frac-num, .frac-den { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.frac-bar { width: 100%; border-top: 3px solid var(--navy); text-align: center; line-height: 0; }
.frac-bar span { display: inline-block; background: #fff; padding: 0 10px; font-size: 11.5px; color: var(--muted); font-weight: 700; transform: translateY(-1px); line-height: 1.2; }
.eq-box { background: #F3F5FB; border: 1px solid #DDE3F3; border-radius: 12px; padding: 10px 14px; text-align: center; min-width: 118px; }
.eq-box.sum { background: #E3E7F5; border-color: #CDD3E8; }
.eq-box.den { background: #fff; border: 2px solid var(--navy); }
.eq-v { font-size: 26px; font-weight: 800; color: var(--navy); line-height: 1.15; font-variant-numeric: tabular-nums; }
.eq-l { font-size: 12.5px; color: var(--ink); font-weight: 600; margin-top: 2px; }
.eq-h { font-size: 11px; color: var(--muted); }
.eq-d { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.eq-d.up { color: var(--up); } .eq-d.down { color: var(--down); }
.eq-op { font-size: 26px; font-weight: 800; color: #9AA3B5; }
.eq-op.big { font-size: 40px; color: var(--navy); }
.eq-res { background: var(--orange); color: #fff; border-radius: 14px; padding: 14px 20px; text-align: center; min-width: 150px; }
.eq-res .eq-v { color: #fff; font-size: 38px; }
.eq-res .eq-l { color: #fff; }
.eq-res .eq-d, .eq-res .eq-d.up, .eq-res .eq-d.down { color: #FFF1E6; }
.eq-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.waffle-box { background: #F4F6F9; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.wf-title { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.waffle { display: grid; grid-template-columns: repeat(10, 1fr); gap: 3px; }
.waffle i { aspect-ratio: 1; border-radius: 50%; background: #E3E7F0; }
.waffle i.on { background: var(--orange); }
.wf-cap { font-size: 12.5px; margin-top: 10px; line-height: 1.5; }
.wf-cap b { color: var(--orange); }
.pm { display: grid; grid-template-columns: 70px 1fr 64px; align-items: center; gap: 8px; margin: 10px 0; font-size: 12.5px; }
.pm-bar { height: 16px; border-radius: 4px; display: block; }
.pm-bar.plus { background: var(--up); } .pm-bar.minus { background: var(--down); }
.pm b { text-align: right; }
.pos-big { font-size: 46px; font-weight: 800; color: var(--navy); line-height: 1; }
.pos-big small { font-size: 18px; } .pos-big span { font-size: 13px; color: var(--muted); font-weight: 600; }
.track { position: relative; height: 96px; margin: 18px 6px 6px; }
.track-line { position: absolute; left: 0; right: 0; top: 46px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #F6D2CC, #E3E7F0 50%, #CFEBDB); }
.tdot { position: absolute; top: 42px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #B7C1DA; border: 2px solid #fff; }
.tdot.me { width: 22px; height: 22px; margin-left: -11px; top: 38px; background: var(--orange); z-index: 2; box-shadow: 0 0 0 3px #FFE3CC; }
.tavg { position: absolute; top: 34px; height: 30px; border-left: 2px dashed var(--navy); }
.tlab { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; text-align: center; line-height: 1.3; }
.tlab.low, .tlab.high { top: 66px; } .tlab.me { top: 0; color: #B5651F; font-weight: 800; font-size: 12.5px; } .tlab.avg { top: 18px; color: var(--navy); font-weight: 600; }
.tlab.low { transform: translateX(-10%); } .tlab.high { transform: translateX(-90%); }
.pos-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.pos-facts div { background: #ECEEF2; border-radius: 10px; padding: 8px 10px; text-align: center; }
.pos-facts b { display: block; font-size: 18px; color: var(--navy); } .pos-facts b.up { color: var(--up); } .pos-facts b.down { color: var(--down); }
.pos-facts span { font-size: 11.5px; color: var(--muted); }
.pos-empty { color: var(--muted); padding: 40px 0; text-align: center; }
.more-head { font-weight: 700; color: var(--navy); margin: 22px 0 8px; }
details.more { padding: 0; }
details.more > summary { cursor: pointer; padding: 14px 16px; list-style: none; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "▸"; color: var(--navy); font-weight: 800; }
details.more[open] > summary::before { content: "▾"; }
details.more[open] > summary { border-bottom: 1px solid var(--line); }
details.more > :not(summary) { margin-left: 16px; margin-right: 16px; }
details.more > :last-child { margin-bottom: 16px; }
details.more > .drill, details.more > p { margin-top: 10px; }
@media (max-width: 1100px) { .eq-wrap { grid-template-columns: 1fr; } .waffle-box { max-width: 420px; } }
@media (max-width: 640px) {
  .story { font-size: 14.5px; padding: 12px 14px; }
  .eq-box { min-width: 96px; padding: 8px 10px; } .eq-v { font-size: 20px; } .eq-res .eq-v { font-size: 30px; }
  .eq-op { font-size: 20px; } .eq-op.big { font-size: 28px; }
  .pos-big { font-size: 36px; }
}
@media (min-width: 1101px) { .eq-wrap { grid-template-columns: minmax(0, 1fr) 230px; } }
.tlab.me span { color: var(--navy); font-weight: 600; font-size: 11px; }
@media (max-width: 640px) { .waffle-box { max-width: none; } .pos-facts b { font-size: 15px; } .tlab { font-size: 10px; } }

/* ───────── 부서 탭 */
.tagk { display: inline-block; font-size: 11.5px; font-weight: 800; border-radius: 6px; padding: 2px 9px; margin-right: 4px; vertical-align: 1px; }
.tagk.resp { background: var(--orange); color: #fff; } .tagk.lead { background: var(--navy); color: #fff; }
.lead-cards { margin-top: 10px; }
.lead-cards .kpi .v { font-size: 23px; }
.kpi.is-dummy { border: 1.5px dashed #D9822B; background: #FFFCF9; } .kpi.is-dummy .v { color: #B5651F; font-style: italic; }
.rk-chip { background: var(--hl); color: var(--navy); border-radius: 5px; padding: 0 5px; font-weight: 700; }
.flow-title { margin: 18px 0 2px; font-size: 14px; }
.flow { display: grid; gap: 7px; margin-top: 8px; }
.flow-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 70px 54px; gap: 10px; align-items: center; font-size: 13px; }
.flow-row .fb { background: #F1F3F8; border-radius: 6px; height: 22px; overflow: hidden; }
.flow-row .fb i { display: block; height: 100%; background: linear-gradient(90deg, #8E9BC4, #2B3A8C); border-radius: 6px; }
.flow-row.is-dummy .fb i { background: repeating-linear-gradient(45deg, #F2B98D, #F2B98D 6px, #F8D5B8 6px, #F8D5B8 12px); }
.flow-row b { text-align: right; font-variant-numeric: tabular-nums; } .flow-row em { font-style: normal; color: var(--orange); font-weight: 700; font-size: 12.5px; }
.linkrow { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.linkbtn { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; }
.linkbtn:hover { background: var(--hl); }
.subtabs { overflow-x: auto; } .subtabs button { white-space: nowrap; }
@media (max-width: 640px) { .flow-row { grid-template-columns: 84px minmax(0, 1fr) 54px 44px; gap: 6px; font-size: 12px; } }

/* 다음 달 예상 묶음 */
.tagk.fc { background: #2E9E6B; color: #fff; }
.ol-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 10px; }
.ol-lines { flex: 1 1 420px; min-width: 0; display: grid; gap: 6px; }
.ol-rates { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.ol-rates span { background: var(--hl); border-radius: 999px; padding: 3px 12px; font-size: 12.5px; color: var(--navy); }
.ol-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) auto; gap: 12px; align-items: center; background: #F7F8FB; border-radius: 10px; padding: 9px 14px; font-size: 13.5px; }
.ol-l { font-weight: 700; color: var(--navy); } .ol-e { color: var(--muted); font-variant-numeric: tabular-nums; }
.ol-row b { font-size: 17px; color: var(--navy); font-variant-numeric: tabular-nums; }
.outlook .eq-res .eq-d { max-width: 240px; display: block; line-height: 1.4; }
.ol-note { margin-top: 10px; }
@media (max-width: 640px) { .ol-row { grid-template-columns: 1fr auto; } .ol-e { grid-column: 1 / -1; order: 3; font-size: 12px; } }

/* ───────── 책임지표 · 계산식 영역 압축 */
.eq-panel { padding-bottom: 14px; }
.eq-panel h3 { margin-bottom: 10px; }
@media (min-width: 1101px) { .eq-wrap { grid-template-columns: minmax(0, 1fr) auto; gap: 18px; } }
.eq { gap: 10px; }
.eq-box { padding: 8px 14px; min-width: 104px; }
.eq-v { font-size: 24px; }
.eq-res { padding: 10px 18px; min-width: 140px; }
.eq-res .eq-v { font-size: 32px; }
.eq-op.big { font-size: 32px; }
.eq-note { margin-top: 10px; }
.waffle-box { display: flex; align-items: center; gap: 14px; padding: 10px 14px; max-width: 360px; }
.waffle { width: 118px; flex: 0 0 118px; gap: 2px; }
.wf-side, .wf-col { min-width: 0; }
.wf-col { flex: 1; min-width: 220px; }
.wf-title { margin-bottom: 4px; }
.wf-cap { margin-top: 0; font-size: 13px; }
.pm { margin: 6px 0; }
@media (max-width: 1100px) { .waffle-box { max-width: none; } }
@media (max-width: 640px) { .waffle { width: 96px; flex-basis: 96px; } }

/* ───────── 질문 도우미 (오른쪽 아래) */
.ask-fab { position: fixed; right: 24px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; z-index: 60;
  background: linear-gradient(135deg, #3F51A3, #2B3A8C); color: #fff; box-shadow: 0 6px 18px rgba(33,41,92,.35); display: grid; place-items: center; transition: transform .15s; }
.ask-fab:hover { transform: scale(1.06); } .ask-fab.on { background: var(--orange); }
.ask-panel { position: fixed; right: 24px; bottom: 92px; width: 380px; max-width: calc(100vw - 24px); height: 540px; max-height: calc(100vh - 120px); z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 16px 40px rgba(20,26,60,.22); display: flex; flex-direction: column; overflow: hidden; }
.ask-panel[hidden] { display: none; }
.ask-panel header { background: var(--navy); color: #fff; padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; }
.ask-panel header b { display: block; font-size: 15px; } .ask-panel header span { font-size: 11.5px; color: #C3CAE8; }
.ask-panel header button { background: none; border: 0; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; padding: 0 4px; }
.ask-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: #F7F8FB; }
.ask-msg { max-width: 92%; border-radius: 12px; padding: 9px 12px; font-size: 13.5px; line-height: 1.55; }
.ask-msg.me { align-self: flex-end; background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.ask-msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ask-t { font-weight: 600; color: var(--ink); }
.ask-tbl { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12.5px; }
.ask-tbl td { padding: 4px 6px; border-top: 1px solid #F0F2F6; } .ask-tbl td.n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.ask-tbl tr.me td { background: var(--hl); color: var(--navy); font-weight: 700; }
.ask-n { margin-top: 8px; font-size: 11px; color: var(--muted); }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ask-chips button { border: 1px solid var(--line); background: #ECEEF2; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12px; color: var(--navy); cursor: pointer; text-align: left; }
.ask-chips button:hover { background: var(--hl); }
.ask-wait { color: var(--muted); }
#ask-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
#ask-form input { flex: 1; min-width: 0; } #ask-form .btn { padding: 7px 12px; white-space: nowrap; }
@media (max-width: 640px) { .ask-fab { right: 14px; bottom: 14px; } .ask-panel { right: 12px; left: 12px; width: auto; bottom: 80px; height: 70vh; } }
@media print { .ask-fab, .ask-panel { display: none; } }

/* ───────── 대시보드 봇 안내문 · 월별 표 · 계산식 한 줄 */
.ask-foot { margin: 0; padding: 6px 12px 9px; font-size: 10.5px; color: var(--muted); text-align: center; background: #fff; }
#ask-form { padding-bottom: 6px; }
.trend-tbl { margin-top: 12px; font-size: 13px; }
.trend-tbl th, .trend-tbl td { white-space: nowrap; text-align: right; }
.trend-tbl th:first-child, .trend-tbl td:first-child { text-align: left; color: var(--muted); font-weight: 600; position: sticky; left: 0; background: #fff; }
.trend-tbl th:first-child { background: #F4F6F9; }
.trend-tbl tr.main td { font-weight: 800; color: var(--navy); font-size: 14px; }
.trend-tbl tr.main td:first-child { color: var(--navy); }
.trend-tbl .cur { background: var(--hl); }
.trend-tbl .up { color: var(--up); } .trend-tbl .down { color: var(--down); }
.eq-par { font-size: 44px; font-weight: 300; color: #9AA3B5; line-height: 1; margin: 0 -4px; }
.kpi .v.up { color: var(--up); } .kpi .v.down { color: var(--down); } .kpi .v.small2 { font-size: 21px; padding: 3px 0; }
.drill-head.more-head { margin: 22px 0 8px; }
.drill-head.more-head .drill { margin: 0; }
@media (max-width: 640px) { .eq-par { font-size: 30px; } }

/* 그래프의 달과 표의 달 칸을 같은 세로줄에 */
.trend-tbl .fill { display: none; padding: 0; }
.trend-tbl.aligned { table-layout: fixed; min-width: 0; }
.trend-tbl.aligned .fill { display: table-cell; background: none; border-bottom-color: transparent; }
.trend-tbl.aligned th, .trend-tbl.aligned td { text-align: center; padding-left: 2px; padding-right: 2px; overflow: hidden; text-overflow: ellipsis; }
.trend-tbl.aligned th:first-child, .trend-tbl.aligned td:first-child { text-align: left; padding-left: 6px; white-space: normal; line-height: 1.25; }
.trend-tbl { margin-top: 4px; }

.ask-tbl.wide td { vertical-align: top; }
.ask-tbl.wide td:first-child { color: var(--muted); font-weight: 600; width: 38%; padding-right: 10px; }
.ask-tbl.wide td.n { text-align: left; font-weight: 500; white-space: normal; }
.ask-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ask-links button { border: 0; background: var(--navy); color: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.ask-links button:hover { background: var(--navy-2); }

/* ───────── 표 정돈 (모든 일반 표 공통) */
.tbl.even { table-layout: fixed; }
.tbl.even th, .tbl.even td { padding: 9px 14px; white-space: normal; overflow-wrap: anywhere; word-break: keep-all; vertical-align: middle; }
.tbl.even th { font-size: 12.5px; }
.tbl.even th + th, .tbl.even td + td { border-left: 1px solid #F0F2F6; }
.tbl.even tr:nth-child(odd) td { background: #FBFCFE; }
.tbl.even tr:hover td { background: #F1F4FB; }
.tbl.even tr.me td, .tbl.even tr.ch-total td { background: var(--hl); }
.tbl.even td:first-child, .tbl.even th:first-child { text-align: left; }
.tbl.even td.n, .tbl.even th.n { text-align: right; }
.scroll-x { max-width: 100%; }
.tbl.small.even th, .tbl.small.even td { padding: 6px 10px; }
@media (max-width: 640px) { .tbl.even th, .tbl.even td { padding: 7px 8px; } }
.tbl.even th, .tbl.even td { padding: 9px 10px; }
.tbl.even td.n, .tbl.even th.n { white-space: nowrap; overflow-wrap: normal; }
.tbl.even td .sub { white-space: normal; }
.tbl.even td.n .muted.small { display: block; white-space: normal; }

/* ───────── 단계 사다리 */
.ch-lead { margin: 2px 0 14px; font-size: 14.5px; color: var(--ink); }
.chain { display: grid; grid-template-columns: minmax(0, 1fr) 74px minmax(0, 1fr) 74px minmax(0, 1fr) 74px minmax(0, 1fr); align-items: stretch; margin-bottom: 10px; }
.ch-step { position: relative; background: #F3F5FB; border: 1px solid #DDE3F3; border-radius: 12px; padding: 22px 12px 12px; text-align: center; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.ch-step.goal { background: var(--navy); border-color: var(--navy); color: #fff; }
.ch-step.missing { background: #fff; border: 2px dashed #C9CFDC; }
.ch-step.fc { border-style: dashed; }
.ch-own { position: absolute; top: 7px; left: 10px; font-size: 11px; font-weight: 700; color: var(--muted); }
.ch-step.goal .ch-own { color: #C3CAE8; }
.ch-v { font-size: 30px; font-weight: 800; color: var(--navy); line-height: 1.15; font-variant-numeric: tabular-nums; }
.ch-v small { font-size: 15px; font-weight: 700; margin-left: 2px; }
.ch-step.goal .ch-v { color: #fff; }
.ch-step.missing .ch-v { font-size: 17px; color: var(--muted); padding: 7px 0; }
.ch-l { font-size: 14px; font-weight: 700; margin-top: 2px; }
.ch-s { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.4; overflow-wrap: anywhere; }
.ch-step.goal .ch-s { color: #C3CAE8; }
.ch-arrow { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 12px; color: var(--muted); padding: 0 4px; }
.ch-arrow b { font-size: 16px; color: var(--orange); }
.ch-arrow i { width: 100%; max-width: 54px; height: 2px; background: #B8C0D6; position: relative; margin-top: 4px; }
.ch-arrow i::after { content: ""; position: absolute; right: -2px; top: -5px; border: 6px solid transparent; border-left: 8px solid #B8C0D6; border-right: 0; }
.chain-panel .trend-tbl { margin-top: 6px; }
@media (max-width: 900px) {
  .chain { grid-template-columns: 1fr; }
  .ch-arrow { flex-direction: row; gap: 8px; padding: 6px 0; }
  .ch-arrow i { width: 2px; height: 18px; max-width: none; margin: 0; order: -1; }
  .ch-arrow i::after { right: -5px; top: auto; bottom: -4px; border: 6px solid transparent; border-top: 8px solid #B8C0D6; border-bottom: 0; }
  .ch-step { padding: 22px 12px 10px; }
  .ch-v { font-size: 26px; }
}

/* ───────── 출처 (오른쪽 위) */
.src { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sec-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.home-note { text-align: right; margin-bottom: 10px; }
.gone { display: none; }
@media (max-width: 640px) { .src { white-space: normal; } .sec-right { align-items: flex-start; } .home-note { text-align: left; } }

/* ───────── 운영 매뉴얼 */
.tabs button.man-tab { margin-left: 0; }
.man-toc ol { columns: 3; margin: 8px 0 0; padding-left: 20px; line-height: 1.9; }
.man-toc a { color: var(--navy-2); text-decoration: none; } .man-toc a:hover { text-decoration: underline; }
details.man { scroll-margin-top: 12px; }
details.man > p, details.man > ul, details.man > ol { line-height: 1.75; }
details.man li { margin: 2px 0; }
details.man code { background: #F1F3F8; border-radius: 4px; padding: 1px 5px; font-size: 12px; overflow-wrap: anywhere; }
.man-tbl { margin: 10px 0; } .man-tbl td { vertical-align: top; line-height: 1.6; } .man-tbl td:first-child { white-space: nowrap; font-weight: 600; }
@media (max-width: 900px) { .man-toc ol { columns: 1; } .man-tbl td:first-child { white-space: normal; } }
.man-tbl { width: 100%; } .man-tbl th, .man-tbl td { text-align: left; padding: 8px 12px; } .man-tbl td:first-child { width: 1%; }

/* 센터 기수별 현황 — 요약 카드 3개 */
.kpis.c-sum { margin-bottom: 14px; }

/* 신학부 전체 현황 */
.sov-kpis .v { font-size: 30px; }

.sov-seg { flex-wrap: wrap; margin: 0 0 4px; }
.sov-seg button { padding: 7px 14px; font-size: 13px; }

/* ───────── 캘린더 */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cal-nav { display: flex; align-items: center; gap: 8px; } .cal-nav b { font-size: 18px; min-width: 120px; text-align: center; }
.cal-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.cal-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-wd { padding: 6px; font-size: 12px; font-weight: 700; text-align: center; background: #ECEEF2; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cal-day { min-height: 104px; padding: 4px 5px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); cursor: pointer; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-day:hover { background: #F7F8FC; }
.cal-day.out { background: #FAFAFB; } .cal-day.out .cal-n { color: #B8BDC8; }
.cal-day.sel { background: var(--hl); }
.cal-n { font-size: 12px; font-weight: 700; }
.cal-day.today .cal-n { background: var(--orange); color: #fff; border-radius: 999px; padding: 0 7px; align-self: flex-start; }
.sun .cal-n, .cal-wd.sun { color: #D64545; } .sat .cal-n, .cal-wd.sat { color: #3A7CC0; }
.cal-day.today.sun .cal-n, .cal-day.today.sat .cal-n { color: #fff; }
.cal-ev { font-size: 11.5px; line-height: 1.35; padding: 1px 6px; border-radius: 4px; background: color-mix(in srgb, var(--c) 14%, #fff); border-left: 3px solid var(--c);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev em { font-style: normal; color: var(--muted); }
.cal-more { font-size: 11px; color: var(--muted); }
.cal-form textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; resize: vertical; }
.cal-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cal-list { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; }
.cal-item { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 8px; padding: 8px 10px; }
.ci-top { display: flex; gap: 6px; align-items: baseline; } .ci-top b { font-size: 14px; overflow-wrap: anywhere; }
.ci-dept { font-size: 11px; font-weight: 700; color: var(--c); white-space: nowrap; }
.ci-when { font-size: 12px; color: var(--ink); margin-top: 2px; }
.ci-memo { font-size: 12px; color: var(--muted); margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ci-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.role-sel { font-size: 12px; padding: 3px 6px; }
@media (max-width: 1100px) { .cal-layout { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .cal-day { min-height: 64px; padding: 3px; } .cal-ev { font-size: 0; padding: 0; height: 6px; border-left-width: 6px; } .cal-ev em { display: none; } }

.cal-btns { display: flex; gap: 8px; align-items: center; } .cal-btns .btn.primary { flex: 1; }
.ci-foot > span:last-child { white-space: nowrap; }

/* ───────── 부드러운 움직임 */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
:root { --ease: cubic-bezier(.2, .7, .2, 1); }

/* 탭을 바꾸면 화면 블록이 위에서부터 차례로 올라옴 */
.view.on > * { animation: fadeUp .42s var(--ease) both; }
.view.on > :nth-child(2) { animation-delay: .04s; } .view.on > :nth-child(3) { animation-delay: .08s; }
.view.on > :nth-child(4) { animation-delay: .12s; } .view.on > :nth-child(5) { animation-delay: .16s; }
.view.on > :nth-child(6) { animation-delay: .2s; } .view.on > :nth-child(n+7) { animation-delay: .24s; }
/* 홈 보고지표 카드 · 숫자 카드도 하나씩 */
.cards5 > .card, .kpis > .kpi { animation: fadeUp .45s var(--ease) both; }
.cards5 > :nth-child(2), .kpis > :nth-child(2) { animation-delay: .05s; } .cards5 > :nth-child(3), .kpis > :nth-child(3) { animation-delay: .1s; }
.cards5 > :nth-child(4), .kpis > :nth-child(4) { animation-delay: .15s; } .cards5 > :nth-child(5), .kpis > :nth-child(5) { animation-delay: .2s; }
.kpis > :nth-child(n+6) { animation-delay: .25s; }
.subtabs:not([hidden]) { animation: fadeIn .3s ease both; }

/* 마우스를 올리면 살짝 떠오름 */
.card, .kpi { transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s; }
.card:hover, .kpi:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(33, 41, 92, .09); border-color: #D3D9EA; }
.panel { transition: box-shadow .25s var(--ease); }
.panel:hover { box-shadow: 0 6px 18px rgba(33, 41, 92, .05); }

/* 탭 · 버튼 · 선택 칸 */
.tabs button { transition: color .2s, border-color .25s var(--ease), background .2s; }
.tabs button:hover { color: var(--navy); background: #F6F7FB; }
.subtabs button, .seg button, .btn, .linkbtn, select, input, textarea { transition: background .18s, color .18s, border-color .18s, box-shadow .18s, transform .12s; }
.subtabs button:hover:not(.on), .seg button:hover:not(.on) { background: #F1F3F9; color: var(--navy); }
.btn:active, .subtabs button:active, .seg button:active { transform: scale(.97); }
.btn.primary:hover { box-shadow: 0 4px 12px rgba(33, 41, 92, .25); }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--navy-2); box-shadow: 0 0 0 3px rgba(58, 74, 140, .15); }

/* 표 줄 · 펼침 · 막대 */
.tbl td { transition: background .15s; }
details.more[open] > :not(summary) { animation: fadeUp .3s var(--ease) both; }
details.more > summary { transition: background .15s; } details.more > summary:hover { background: #F7F8FC; }
.fb i, .mix i { transition: width .6s var(--ease); }

/* 캘린더 */
.cal-day { transition: background .15s; }
.cal-ev { transition: filter .15s, transform .15s; } .cal-ev:hover { filter: brightness(.96); transform: translateX(1px); }
.cal-item { animation: fadeUp .35s var(--ease) both; transition: box-shadow .2s, transform .2s var(--ease); }
.cal-item:hover { box-shadow: 0 6px 16px rgba(33, 41, 92, .08); transform: translateY(-1px); }

/* 대시보드 봇 */
.ask-panel.pop { animation: popIn .28s var(--ease) both; transform-origin: bottom right; }
.ask-fab { transition: transform .2s var(--ease), box-shadow .2s, background .2s; }
.ask-fab:hover { box-shadow: 0 10px 24px rgba(33, 41, 92, .4); }
.ask-log > * { animation: fadeUp .3s var(--ease) both; }

/* 불러오는 중: 살짝 흐리게 */
main.page .view.on { transition: opacity .2s ease; }
main.page.loading .view.on { opacity: .55; pointer-events: none; }

/* 매뉴얼 목차로 이동 */
html { scroll-behavior: smooth; }

/* 윈도우에서 '애니메이션 효과'를 끈 사람에게는 움직임 없음 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ───────── 인쇄 (A4) */
.print-head { display: none; }
@media print {
  @page { size: A4; margin: 12mm 10mm; }
  html, body { background: #fff !important; font-size: 10.5px; }
  * { animation: none !important; transition: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  header.top, .tabs, .subtabs, .ask-fab, .ask-panel, .flash, .drill, .sec-right .drill, .seg, #c-q, #p-tbl-mon, #p-tbl-ch, #p-tbl-org,
  .man-toc, .cal-side .panel:first-child, .cal-nav button, button.linkbtn, .linkrow { display: none !important; }
  .print-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border-bottom: 2px solid #2B3A8C; padding: 0 0 6px; margin: 0 0 10px; }
  .print-head b { font-size: 14px; color: #2B3A8C; } .print-head span { font-size: 10.5px; color: #555; }
  main.page { padding: 0 !important; max-width: none !important; }
  .view.on { opacity: 1 !important; }
  .panel, .card, .kpi { box-shadow: none !important; transform: none !important; border-color: #CCD2E0 !important; }
  .panel { break-inside: avoid; page-break-inside: avoid; padding: 10px 12px; margin-bottom: 10px; }
  .panel:has(.tbl-box), .panel:has(table.compact) { break-inside: auto; page-break-inside: auto; }
  .tbl-box, .scroll-x, .cal-list { max-height: none !important; overflow: visible !important; }
  .tbl { font-size: 9.5px; } .tbl th, .tbl td { padding: 4px 6px !important; }
  .tbl thead, .tbl tr:first-child th { position: static !important; }
  .chart canvas { max-width: 100%; }
  .tbl th { white-space: normal !important; overflow-wrap: anywhere; }
  .grid2, .cal-layout { grid-template-columns: 1fr !important; }
  .cards5 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px !important; }
  .card { break-inside: avoid; padding: 10px; } .card .rank { font-size: 32px; }
  .kpis, .kpis.seven, .kpis.six { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 8px; }
  .kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
  .story { background: #fff !important; color: #2B3A8C !important; border: 1px solid #2B3A8C; }
  details.more > summary::before { content: "" !important; }
  .sec-head { margin-bottom: 8px; } .src { white-space: normal; }
  a[href]::after { content: none !important; }
  /* 센터 기수별 표: A4 폭에 맞춤 */
  .tbl.compact { width: 100% !important; min-width: 0 !important; table-layout: auto; font-size: 8px !important; }
  .tbl.compact th { white-space: nowrap !important; font-size: 8px; }
  .tbl.compact td, .tbl.compact th { padding: 3px 3px !important; }
  .tbl.compact td.ev { min-width: 0 !important; max-width: 120px; }
  .tbl.compact .sub { font-size: 7px; }
  .tbl.compact .mix { width: 48px; }
  .tbl.compact tr { break-inside: avoid; }
}

/* ───────── 챗봇 버튼 · 창 이동 · 크기 조절 */
.ask-fab { width: auto; height: 50px; border-radius: 999px; padding: 0 20px 0 16px; display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 15px; font-weight: 800; letter-spacing: .5px; }
.ask-fab:hover { transform: translateY(-2px); }
.ask-panel { resize: both; overflow: hidden; min-width: 300px; min-height: 360px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
.ask-panel header#ask-head { cursor: move; user-select: none; touch-action: none; }
.ask-panel header#ask-head span { display: block; font-size: 10.5px; color: #C3CAE8; margin-top: 1px; }
.ask-hbtn { display: flex; align-items: center; gap: 2px; }
.ask-hbtn button { border-radius: 6px; }
.ask-hbtn #ask-reset { font-size: 17px; padding: 2px 6px; opacity: .85; } .ask-hbtn button:hover { background: rgba(255, 255, 255, .15); opacity: 1; }
.ask-panel.dragging { box-shadow: 0 18px 44px rgba(33, 41, 92, .35); opacity: .97; }
.ask-panel.dragging .ask-log { pointer-events: none; }
.ask-links button { display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 640px) {
  .ask-fab { height: 46px; padding: 0 16px 0 13px; font-size: 14px; }
  .ask-panel { resize: none; min-width: 0; }
  .ask-panel header#ask-head { cursor: default; } .ask-panel header#ask-head span { display: none; }
}

/* 재적 현황: 카드를 골라 그래프 보기 */
.r-pick .kpi.pick { cursor: pointer; position: relative; }
.r-pick .kpi.pick::after { content: "그래프 ▸"; position: absolute; top: 10px; right: 12px; font-size: 10.5px; color: var(--muted); opacity: 0; transition: opacity .2s; }
.r-pick .kpi.pick:hover::after { opacity: 1; }
.r-pick .kpi.pick.sel { border: 2px solid var(--navy); background: var(--hl); box-shadow: 0 8px 20px rgba(33, 41, 92, .12); }
.r-pick .kpi.pick.sel::after { content: "그래프 ▾"; opacity: 1; color: var(--navy); font-weight: 700; }
.r-pick .kpi.pick:focus-visible { outline: 3px solid rgba(58, 74, 140, .35); outline-offset: 2px; }
.r-chart-box:not([hidden]) { animation: fadeUp .35s var(--ease) both; }

/* ───────── 화면 폭별 최적화 (큰 모니터에서 양옆 여백 줄이기)
   본문 최대 폭을 화면 구간마다 넓히고, 위쪽 메뉴 줄도 본문 폭에 맞춤. 2400px 이상은 글자 · 숫자 · 그래프도 함께 키움 */
:root { --maxw: 1440px; --gut: 24px; }
.page, .flash { max-width: var(--maxw); }
.top, .tabs, .subtabs { padding-left: max(var(--gut), calc((100% - var(--maxw)) / 2 + var(--gut)));
  padding-right: max(var(--gut), calc((100% - var(--maxw)) / 2 + var(--gut))); }
@media (min-width: 1600px) { :root { --maxw: 1560px; } }
@media (min-width: 1800px) {                                  /* FHD 1920 */
  :root { --maxw: 1800px; --gut: 32px; }
  body { font-size: 15px; }
  .tbl { font-size: 13.5px; }
  .chart { height: 290px; } .chart.tall { height: 380px; }
  .cal-layout { grid-template-columns: minmax(0, 1fr) 380px; }
}
@media (min-width: 2200px) {                                  /* QHD 2560 · 울트라와이드 */
  :root { --maxw: 2200px; --gut: 40px; }
  body { font-size: 16px; }
  h2 { font-size: 26px; } h3 { font-size: 17px; }
  .brand strong { font-size: 19px; } .tabs button { font-size: 16px; padding: 16px 20px; } .subtabs button { font-size: 14px; }
  .tbl { font-size: 15px; } .tbl th, .tbl td { padding: 9px 9px; } .tbl.small { font-size: 13.5px; }
  .kpi { padding: 16px 18px; } .kpi .l, .kpi .s { font-size: 13.5px; } .kpi .v { font-size: 32px; }
  .card { padding: 20px; } .card .nm { font-size: 26px; } .card .rank { font-size: 56px; } .card .val { font-size: 17px; }
  .card .meta { font-size: 13.5px; } .card ol.rk { font-size: 15px; }
  .panel { padding: 20px 22px; border-radius: 16px; }
  .chart { height: clamp(300px, 32vh, 440px); } .chart.tall { height: clamp(380px, 40vh, 560px); } .chart.short { height: 230px; }
  .trend-tbl { font-size: 15px; } .trend-tbl tr.main td { font-size: 16px; }
  .cal-layout { grid-template-columns: minmax(0, 1fr) 440px; } .cal-day { min-height: clamp(110px, 12vh, 150px); } .cal-ev { font-size: 13px; }
  .ask-msg { font-size: 15px; }
}
@media (min-width: 3000px) {                                  /* 4K (100% 배율) */
  :root { --maxw: 2900px; --gut: 56px; }
  body { font-size: 18px; }
  h2 { font-size: 30px; } h3 { font-size: 19px; }
  .tabs button { font-size: 18px; } .tbl { font-size: 17px; } .tbl th, .tbl td { padding: 11px 11px; }
  .kpi .v { font-size: 38px; } .kpi .l, .kpi .s { font-size: 15px; }
  .card .nm { font-size: 30px; } .card .rank { font-size: 66px; } .card ol.rk { font-size: 17px; }
  .trend-tbl { font-size: 17px; } .trend-tbl tr.main td { font-size: 18px; }
}
@media (max-width: 640px) { :root { --gut: 16px; } }

/* ───────── 표 십자선 강조 (기존 배경색 위에 옅은 남색을 겹쳐 칠함) */
.tbl td, .tbl th { transition: background-color .12s, color .12s; }
.tbl .x-row, .tbl .x-col { background-image: linear-gradient(rgba(58, 74, 140, .07), rgba(58, 74, 140, .07)) !important; }
.tbl .x-row.x-col { background-image: linear-gradient(rgba(58, 74, 140, .12), rgba(58, 74, 140, .12)) !important; }
.tbl .x-row.x-col.x-cell { background-image: linear-gradient(rgba(58, 74, 140, .2), rgba(58, 74, 140, .2)) !important; box-shadow: inset 0 0 0 1.5px rgba(33, 41, 92, .45);
  color: var(--navy) !important; font-weight: 800; }
.tbl .x-head { color: var(--navy) !important; font-weight: 800; }
@media (hover: none) { .tbl .x-row, .tbl .x-col { background-image: none !important; } }
@media print { .tbl .x-row, .tbl .x-col, .tbl .x-cell { background-image: none !important; box-shadow: none !important; } }

/* 12지파 누적 현황 카드 */
#ch-kpis .kpi .l { display: flex; align-items: center; gap: 6px; }
.ch-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
#ch-kpis .kpi.pick.sel { border-color: var(--c); }
#ch-pick-panel:not([hidden]) { animation: fadeUp .35s var(--ease) both; }
@media (min-width: 1101px) { #ch-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.r-pick .kpi.pick.sel .l { padding-right: 54px; }

/* 카드 그래프 표시: 글씨 배지 대신 오른쪽 위 작은 동그라미 (제목과 겹치지 않게 그 자리를 항상 비워 둠) */
.r-pick .kpi.pick .l { padding-right: 26px; }
.r-pick .kpi.pick.sel .l { padding-right: 26px; }
.r-pick .kpi.pick::after { content: "▸"; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 10px; line-height: 1; color: var(--muted); background: #F1F3F8; opacity: .55; }
.r-pick .kpi.pick:hover::after { opacity: 1; color: var(--navy); background: #E3E8F5; }
.r-pick .kpi.pick.sel::after { content: "▾"; opacity: 1; color: #fff; background: var(--navy); font-weight: 400; }
@media (min-width: 2200px) { .r-pick .kpi.pick::after { width: 24px; height: 24px; font-size: 12px; } .r-pick .kpi.pick .l { padding-right: 30px; } }
.kpi .l { word-break: keep-all; overflow-wrap: anywhere; }
.pick-hint { display: flex; justify-content: flex-end; margin: -6px 0 6px; }
@media print { .pick-hint { display: none; } }
.btn[hidden], button[hidden] { display: none !important; }

/* 홈: 다음 달 예상 순위 계산 방법 */
.fc-how { margin-top: 14px; }
.fc-how h3 { margin-bottom: 10px; }
.fc-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
.fc-grid p { margin: 6px 0; line-height: 1.6; } .fc-grid ul { margin: 6px 0 0; padding-left: 18px; line-height: 1.75; color: var(--ink); }
.fc-who { display: inline-block; font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: #EEF0F4; color: var(--muted); }
.fc-who.me { background: var(--navy); color: #fff; }
@media (max-width: 900px) { .fc-grid { grid-template-columns: 1fr; } }

/* 내무부 › 신앙관리회의 */
.sg-h4 { margin: 14px 0 6px; font-size: 13.5px; color: var(--navy); }
.sg-me { font-size: 13.5px; margin: 4px 0 2px; display: flex; gap: 18px; flex-wrap: wrap; }
.sg-me em { font-style: normal; color: var(--muted); font-size: 12.5px; } .sg-me em.up { color: var(--up); } .sg-me em.down { color: var(--down); }
.sg-2 { grid-template-columns: 1fr 1fr; }
.sg-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .sg-2, .sg-3 { grid-template-columns: 1fr; } }

.jd-grid { grid-template-columns: 1fr 1.4fr; }
.tbl tr.jd-off td { color: #A0A7B5; }
@media (max-width: 1100px) { .jd-grid { grid-template-columns: 1fr; } }

/* ── 톤 정리: 바탕은 무게감 있게, 표 · 데이터는 채도 낮은 편안한 색 */
body { background: var(--bg); }
.panel, .card, .kpi { border-color: #D9DEE7; box-shadow: 0 1px 2px rgba(40, 48, 66, .04); }
.tabs { background: #F7F8FA; border-bottom-color: #D9DEE7; }
.tbl th { color: #6E7584; background: #F2F4F7; }
.tbl td { border-bottom-color: #ECEEF2; }
.tbl.even tr:nth-child(odd) td { background: #FAFBFC; }
.tbl.even tr:hover td { background: #F0F2F6; }
.tbl tr.me td, .tbl.even tr.me td { background: #E3E7F5; color: #2B3A8C; }
.tbl tr.ch-total td, .tbl.even tr.ch-total td { background: #EEF1F5; color: #2B3A8C; }
/* 순위표: 순위 · 지파 좁게, 값 칸에 막대 */
.tbl.rank-tbl th, .tbl.rank-tbl td { padding: 7px 10px; }
.tbl.rank-tbl td:first-child, .tbl.rank-tbl th:first-child { text-align: right; color: #8A91A0; }
.tbl.rank-tbl tr.me td:first-child { color: #2B3A8C; }
.tbl td.vcell { position: relative; }
.tbl td.vcell b { position: relative; font-weight: inherit; }
.tbl td.vcell .vbar { position: absolute; left: 8px; top: 50%; height: 10px; transform: translateY(-50%);
  width: calc((100% - 74px) * var(--w) / 100); background: #A7B1CC; border-radius: 3px; }
.tbl tr.me td.vcell .vbar { background: #8E9BC4; }
.sg-2, .sg-3 { gap: 20px; }
@media print { .tbl td.vcell .vbar { display: none; } }

/* ── 참고 사진 톤: 로열 블루 · 회청 막대 · 선명한 증감 */
.top { background: #1F2A66; }
.tabs button.on { color: #2B3A8C; border-bottom-color: #2B3A8C; }
.panel, .card, .kpi { border-color: #DDE1EA; box-shadow: 0 1px 3px rgba(31, 42, 102, .05); }
.tbl tr.me td, .tbl.even tr.me td { background: #E3E7F5; color: #1F2A66; }
.tbl tr.ch-total td, .tbl.even tr.ch-total td { background: #F0F2F8; color: #2B3A8C; }
.tbl td.vcell .vbar { background: #A7B1CC; }
.tbl td.vcell .vbar.hi { background: #A7B1CC; }
.tbl td.vcell .vbar.lo { background: #E8B4B0; }
.tbl tr.me td.vcell .vbar { background: #1B2FA8; }
.avg-key { color: var(--muted); font-size: 12px; display: inline-flex; align-items: center; gap: 5px; margin-left: auto; }
.avg-key .vk { display: inline-block; width: 14px; height: 8px; border-radius: 2px; } .avg-key .vk.hi { background: #A7B1CC; } .avg-key .vk.lo { background: #E8B4B0; margin-left: 8px; }
.card .val .dv { font-size: 12.5px; font-weight: 700; margin-left: 2px; }
.rk .avg-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 6px; vertical-align: 2px; }
.rk .avg-dot.hi { background: var(--up); } .rk .avg-dot.lo { background: var(--down); }
.card .val > .muted.small { white-space: nowrap; }

/* 데이터 관리 › 부서 통합 데이터 파일 */
.book-panel { border-left: 4px solid #2B3A8C; }
.book-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }
.book-dl { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.ghost-dark { background: #fff; color: #2B3A8C; border-color: #C3CAE8; font-weight: 600; }
.btn.ghost-dark:hover { background: #EEF0F8; }
.book-up { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 가상 시나리오 */
.scn-layout { display: grid; grid-template-columns: minmax(330px, 400px) minmax(0, 1fr); gap: 14px; align-items: start; }
.scn-levers { position: sticky; top: 12px; }
.scn-lv { padding: 10px 0; border-top: 1px dashed var(--line); }
.scn-lv.changed .scn-lv-h b { color: #2B3A8C; }
.scn-lv-h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.scn-lv-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 4px; }
.scn-step { border: 1px solid var(--line); background: #F4F6F9; border-radius: 6px; padding: 4px 7px; font: inherit; font-size: 12px; cursor: pointer; min-width: 38px; }
.scn-step:hover { background: #E3E7F5; border-color: #C3CAE8; }
.scn-in { width: 92px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.scn-dv { font-size: 12px; font-weight: 700; margin-left: 6px; }
.scn-act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.scn-act input { flex: 1; min-width: 140px; }
.scn-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.scn-card { text-align: left; font: inherit; color: inherit; background: #fff; border: 1px solid #DDE1EA; border-radius: 14px; padding: 14px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, box-shadow .15s; }
.scn-card:hover { border-color: #A7B1CC; }
.scn-card.on { border-color: #2B3A8C; box-shadow: 0 0 0 2px rgba(43, 58, 140, .12); }
.scn-card .nm { font-weight: 800; color: var(--navy); font-size: 14px; }
.scn-rk { display: flex; align-items: baseline; gap: 8px; } .scn-rk .rank { font-size: 38px; font-weight: 800; color: var(--navy); line-height: 1.1; }
.scn-rk .rank small { font-size: 16px; } .scn-rk span:not(.rank) { font-weight: 700; font-size: 13px; }
.scn-card .val { font-size: 14px; }
.scn-up { font-size: 12.5px; margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); line-height: 1.5; }
.scn-up b { color: #2B3A8C; }
.tbl.scn-tgt td, .tbl.scn-saved td { white-space: nowrap; }
@media (max-width: 1250px) { .scn-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .scn-layout { grid-template-columns: 1fr; } .scn-levers { position: static; } .scn-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 가상 시나리오 v2 — 부서별 선행 · 책임지표 */
.scn-dept { border: 1px solid #DDE1EA; border-radius: 12px; padding: 4px 12px 10px; margin: 10px 0; }
.scn-dept.d-J { border-left: 4px solid var(--d-jeondo); } .scn-dept.d-S { border-left: 4px solid var(--d-sinhak); } .scn-dept.d-N { border-left: 4px solid var(--d-naemu); }
.scn-dept-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 8px 0 2px; flex-wrap: wrap; }
.scn-dept-h b { font-size: 15px; color: var(--navy); }
.scn-dept .scn-lv:first-of-type { border-top: 0; }
.scn-kind { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; }
.scn-kind.k-선행 { background: #E3E7F5; color: #2B3A8C; } .scn-kind.k-책임 { background: #FCEBD9; color: #B5651F; } .scn-kind.k-기타 { background: #F0F1F4; color: var(--muted); }
.scn-flow { font-size: 12.5px; background: #F4F6F9; border-radius: 8px; padding: 8px 10px; margin-top: 6px; line-height: 1.7; }
.scn-flow b { color: #2B3A8C; }
.scn-pick { flex-wrap: wrap; margin: 4px 0 8px; align-items: center; gap: 4px; }
.scn-pick .muted { margin-right: 6px; }
.tbl.scn-saved td.scn-chg { white-space: normal; min-width: 220px; font-size: 12px; }

/* 가상 시나리오 — 책임지표로 보기 */
.scn-resp-row { display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: 18px; align-items: start; }
.scn-resp-now { background: #FBF4EC; border: 1px solid #F1DCC6; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.scn-resp-now b { font-size: 15px; color: #8A4B12; }
.scn-resp-now .scn-in { width: 100px; }
.scn-resp-pick { cursor: pointer; }
.scn-resp-tbl .tbl td, .scn-resp-tbl .tbl th { white-space: nowrap; }
#scn-resp-seg { flex-wrap: wrap; }
@media (max-width: 1000px) { .scn-resp-row { grid-template-columns: 1fr; } }
/* 가상 시나리오 v3 — 인원 조정 */
.scn-aff { display: inline-flex; gap: 3px; }
.scn-aff i { font-style: normal; font-size: 11px; font-weight: 700; background: #E3E7F5; color: #2B3A8C; border-radius: 999px; padding: 1px 7px; }
.scn-dv b { font-weight: 800; }
.scn-card.moved { background: linear-gradient(180deg, #F7F8FD, #fff 60%); }
.scn-card.moved .nm::after { content: " · 움직임"; font-size: 11px; font-weight: 700; color: #D9822B; }
#view-scn .tbl.even td.n .muted.small, #view-scn .tbl td .small { display: inline; }
#view-scn .tbl.even td, #view-scn .tbl.even th { padding: 8px 12px; }

/* ── 가상 시나리오 v4: 한 화면 배치 */
#view-scn .scn-head { margin-bottom: 10px; align-items: center; }
#view-scn .scn-act { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#view-scn .scn-act .src { margin-right: 8px; }
#view-scn .scn-act input { width: 150px; padding: 5px 8px; }
#view-scn .scn-act .btn.primary { padding: 6px 14px; }
#view-scn .scn-cards { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
#view-scn .scn-card { padding: 10px 12px; gap: 2px; border-radius: 12px; }
#view-scn .scn-card .nm { font-size: 13px; }
#view-scn .scn-rk { display: flex; align-items: center; gap: 8px; }
#view-scn .scn-rk .rank { font-size: 32px; }
#view-scn .scn-rk > span:not(.rank):not(.scn-v) { font-size: 13px; font-weight: 800; }
#view-scn .scn-v { display: flex; flex-direction: column; margin-left: auto; text-align: right; font-weight: 700; font-size: 14px; line-height: 1.25; }
#view-scn .scn-v em { font-style: normal; font-size: 11.5px; } #view-scn .scn-v small { font-weight: 400; color: var(--muted); font-size: 11px; }
#view-scn .scn-up { font-size: 12px; border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 4px; min-height: 18px; }
#view-scn .scn-up b { color: #2B3A8C; }
.scn-card.moved .nm::after { content: " ●"; color: #D9822B; }
/* 부서 3칸 */
.scn-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.scn-col { background: #fff; border: 1px solid #DDE1EA; border-radius: 12px; padding: 8px 12px 10px; border-top: 4px solid var(--navy); }
.scn-col.d-J { border-top-color: var(--d-jeondo); } .scn-col.d-S { border-top-color: var(--d-sinhak); } .scn-col.d-N { border-top-color: var(--d-naemu); }
.scn-col-h { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px; flex-wrap: wrap; }
.scn-col-h > b { font-size: 15px; color: var(--navy); }
.scn-col-aff { font-size: 12px; color: var(--muted); } .scn-col-aff b { color: var(--ink); }
.sl { display: grid; grid-template-columns: 92px auto 1fr; align-items: center; gap: 8px; padding: 4px 0; }
.sl + .sl { border-top: 1px dashed #EEF0F4; }
.sl-l { font-weight: 700; font-size: 13px; line-height: 1.2; }
.sl-l i { font-style: normal; font-size: 10.5px; color: #2B3A8C; margin-left: 4px; font-weight: 700; }
.sl-l small { display: block; font-weight: 400; font-size: 10.5px; color: var(--muted); white-space: normal; }
.sl-c { display: inline-flex; align-items: center; gap: 2px; }
.sl-c button { border: 1px solid var(--line); background: #F4F6F9; border-radius: 6px; font: inherit; font-size: 11.5px; padding: 3px 0; width: 34px; cursor: pointer; }
.sl-c button:hover { background: #E3E7F5; border-color: #C3CAE8; }
.sl-c .scn-in { width: 72px; padding: 4px 6px; font-size: 13px; }
.sl-m { font-size: 11.5px; text-align: right; white-space: nowrap; }
.sl.changed .sl-l { color: #2B3A8C; }
.sl.resp { background: #FBF4EC; border-radius: 8px; padding: 5px 6px; margin-top: 4px; border-top: 0 !important; cursor: pointer; }
.sl.resp.on { box-shadow: inset 0 0 0 1.5px #E2B37F; }
.sl.resp .sl-l { color: #8A4B12; }
/* 아래 두 패널 */
.scn-bottom { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 10px; }
.scn-bottom .panel { margin-bottom: 10px; padding: 12px 14px; }
.scn-bottom .drill-head { margin-bottom: 4px; }
.scn-bottom h3 { font-size: 14px; margin: 0; }
.scn-sub { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 2px 0 6px; }
.scn-bottom .seg button { padding: 4px 9px; font-size: 12px; }
.scn-bottom p.small { margin: 0 0 6px; }
.tbl.scn-h { font-size: 12px; table-layout: auto !important; min-width: 0 !important; }
.tbl.scn-h th, .tbl.scn-h td { padding: 5px 6px !important; white-space: nowrap; text-align: center; }
.tbl.scn-h td:first-child, .tbl.scn-h th:first-child { text-align: left; color: var(--muted); font-weight: 600; width: auto !important; }
.tbl.scn-h td small, .tbl.scn-h th small { display: block; font-size: 10.5px; color: var(--muted); font-weight: 400; }
.tbl.scn-h .me { background: #E3E7F5 !important; color: #1F2A66; font-weight: 700; }
.tbl.scn-h td .up, .tbl.scn-h td .down { font-size: 10.5px; margin-left: 2px; }
.scn-rp { cursor: pointer; } .scn-rp:hover { background: #F0F2F8; }
.tbl.scn-saved td { white-space: nowrap; } .tbl.scn-saved td.scn-chg { white-space: normal; font-size: 12px; min-width: 200px; }
@media (max-width: 1250px) { .scn-cols { grid-template-columns: 1fr 1fr; } .scn-bottom { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .scn-cols, #view-scn .scn-cards { grid-template-columns: 1fr 1fr; } }
.sl.resp { grid-template-columns: 92px auto minmax(0, 1fr); } .sl.resp .sl-m { white-space: normal; line-height: 1.3; }
.sl-l small { max-width: 92px; }

/* 가상 시나리오 v5 — 비율 칸 */
.sl.rate { grid-template-columns: 92px auto minmax(0, 1fr); background: #F3F5FB; border-radius: 8px; padding: 5px 6px; margin-top: 4px; border-top: 0 !important; cursor: pointer; }
.sl.rate.on { box-shadow: inset 0 0 0 1.5px #A7B1CC; }
.sl.rate .sl-l { color: #2B3A8C; }
.sl.rate .sl-m { white-space: normal; line-height: 1.3; }
