/* ==========================================================================
   에스원 공조사업 T/F 업무시스템 — 사내 업무시스템 스타일
   외부 CDN/폰트 미사용 (사내망 오프라인 구동 전제)
   기준 해상도 1920x1080~1280, 하단 잘림 방지를 위한 고정 헤더 + 내부 스크롤 구조
   ========================================================================== */
:root {
  --s1-navy: #00479d;
  --s1-navy-dk: #003072;
  --s1-navy-lt: #eaf1fa;
  --ink: #1b2330;
  --ink-2: #46536b;
  --ink-3: #7a869a;
  --line: #d4dae4;
  --line-2: #e6eaf1;
  --bg: #eef1f6;
  --panel: #ffffff;
  --head: #f5f7fb;
  --ok: #10714f;
  --ok-bg: #e3f4ec;
  --warn: #94620a;
  --warn-bg: #fdf3d8;
  --bad: #a52121;
  --bad-bg: #fbe8e8;
  --info: #0b57a4;
  --info-bg: #e6effa;
  --gray-bg: #eef0f4;
  --hdr-h: 52px;
  --nav-h: 42px;
  --sub-h: 46px;
  --font: "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", Dotum, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  overflow: hidden; /* 페이지 전체 스크롤 제거 → 내부 영역만 스크롤 (하단 잘림 방지) */
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: 13px; color: var(--ink); }
a { color: var(--s1-navy); text-decoration: none; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: #e7ebf1; }
::-webkit-scrollbar-thumb { background: #b6bfcd; border: 3px solid #e7ebf1; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #94a0b3; }

/* ------------------------------- 전체 레이아웃 ------------------------------ */
#app { display: flex; flex-direction: column; height: 100vh; min-width: 1280px; }

/* 상단 헤더 */
.gnb {
  height: var(--hdr-h);
  flex: 0 0 var(--hdr-h);
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 18px;
  gap: 16px;
}
.gnb .logo { display: flex; align-items: center; gap: 11px; }
.gnb .logo img { height: 21px; display: block; }
.gnb .logo .divider { width: 1px; height: 20px; background: var(--line); }
.gnb .logo .sys {
  font-size: 15px; font-weight: 700; color: var(--s1-navy-dk); letter-spacing: -0.4px;
}
.gnb .logo .sys small { font-weight: 400; color: var(--ink-3); font-size: 11px; margin-left: 6px; letter-spacing: 0; }
.gnb .logo .demo-badge {
  font-size: 10.5px; font-weight: 700; color: var(--warn); background: var(--warn-bg);
  border: 1px solid #f0dba0; border-radius: 10px; padding: 2px 9px; letter-spacing: .2px; white-space: nowrap;
}
.gnb .spacer { flex: 1; }
.gnb .who {
  display: flex; align-items: center; gap: 8px;
  background: var(--head); border: 1px solid var(--line);
  padding: 5px 9px 5px 11px; border-radius: 3px;
}
.gnb .who label { color: var(--ink-3); font-size: 11px; }
.gnb .who select { border: 0; background: transparent; font-weight: 700; color: var(--s1-navy); padding: 0 2px; }
.gnb .clock { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.gnb .clock b { color: var(--ink); }
.gnb .sitelinks { display: flex; align-items: center; gap: 6px; margin-left: 14px; }
.gnb .sitelinks a {
  font-size: 11.5px; font-weight: 600; color: var(--s1-navy); background: var(--s1-navy-lt);
  border: 1px solid #cfe0f3; border-radius: 3px; padding: 5px 9px; white-space: nowrap;
}
.gnb .sitelinks a:hover { background: #dce9f8; border-color: var(--s1-navy); }
.gnb .acct { display: flex; align-items: center; gap: 8px; margin-left: 10px; font-size: 12px; color: var(--ink-2); }
.gnb .acct b { color: var(--s1-navy); font-weight: 700; }
.gnb .acct button {
  height: 26px; padding: 0 9px; border-radius: 3px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 11.5px; cursor: pointer;
}
.gnb .acct button:hover { background: var(--head); color: var(--ink); }
.gnb .acct button.on { background: var(--ok-bg); border-color: #b7e0cc; color: var(--ok); font-weight: 600; }
.gnb .acct button.on.warn { background: var(--warn-bg); border-color: #f0dba0; color: var(--warn); }

/* 로그인 / 회원가입 */
.authwrap {
  position: relative; overflow: hidden;
  height: 100vh; display: flex; align-items: center; justify-content: center;
  background: #f4f7fb;
}
.authbg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; touch-action: none; }
.authbox {
  position: relative; z-index: 1;
  width: 360px; max-width: calc(100vw - 40px); background: rgba(255,255,255,.92);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.7); border-radius: 10px;
  box-shadow: 0 24px 60px rgba(15,40,80,.16), 0 4px 14px rgba(15,40,80,.08);
  padding: 30px 28px 24px; text-align: center;
  transition: box-shadow .3s ease;
}
.authbox:focus-within { box-shadow: 0 26px 64px rgba(0,71,157,.22), 0 4px 14px rgba(15,40,80,.1); }
.authbox .alogo { height: 26px; margin-bottom: 14px; }
.authbox .atitle { font-size: 15px; font-weight: 700; color: var(--ink); margin-bottom: 18px; }
.authbox .atabs { display: flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; margin-bottom: 16px; }
.authbox .atabs button {
  flex: 1 1 0; height: 32px; border: 0; background: var(--head); color: var(--ink-3); font-weight: 600; font-size: 12.5px; cursor: pointer;
}
.authbox .atabs button.on { background: var(--s1-navy); color: #fff; }
.aform { display: grid; grid-template-columns: auto 1fr; gap: 9px 10px; align-items: center; text-align: left; }
.aform[hidden] { display: none; }
.aform label { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.aform input { width: 100%; }
.aform .btn { grid-column: 1 / -1; margin-top: 6px; height: 36px; font-size: 13px; }
.amsg { min-height: 18px; margin-top: 12px; font-size: 12px; }
.amsg.err { color: var(--bad); }
.amsg.ok { color: var(--ok); }
.ahint { margin-top: 10px; font-size: 11px; color: var(--ink-3); line-height: 1.5; }

@media (max-width: 1023px) {
  .gnb .sitelinks { display: none; }
  .gnb .acct span { display: none; }
}

/* 캡처 방지 워터마크 */
.wm-overlay {
  position: fixed; inset: 0; z-index: 99999; pointer-events: none;
  background-repeat: repeat;
}

/* 메인 메뉴 */
.nav {
  height: var(--nav-h);
  flex: 0 0 var(--nav-h);
  background: var(--s1-navy);
  display: flex;
  align-items: stretch;
  padding: 0 10px;
}
.nav button {
  border: 0; background: transparent; color: #cddef5; cursor: pointer;
  padding: 0 20px; font-size: 13.5px; font-weight: 600; letter-spacing: -0.3px;
  border-bottom: 3px solid transparent; transition: none;
  position: relative;
}
.nav button .ping {
  position: absolute; top: 8px; right: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: #ff5a5f; box-shadow: 0 0 0 rgba(255,90,95,.6); animation: ping-pulse 1.6s infinite;
}
@keyframes ping-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,90,95,.6); }
  70% { box-shadow: 0 0 0 6px rgba(255,90,95,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,90,95,0); }
}
@keyframes new-pop {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); }
}
.tag.new-badge {
  display: inline-flex; align-items: center; gap: 3px; background: #ff5a5f; color: #fff;
  border-color: #ff5a5f; animation: new-pop .4s ease-out;
}
.nav button:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav button.on { color: #fff; background: rgba(0,0,0,.16); border-bottom-color: #ffd24a; }
/* 영업 업무 클러스터(영업Biz·T/A관리·고객사관리·협력사관리·S1-FCI) — 나머지 메뉴와 톤 구분용 은은한 배경 */
.nav button.sales-group {
  background: rgba(27, 117, 188, .28);
  border-top: 2px solid rgba(27, 117, 188, .75);
}
.nav button.sales-group:hover { background: rgba(27, 117, 188, .42); }
.nav button.sales-group.on { background: rgba(27, 117, 188, .56); border-bottom-color: #5cc8ff; }
.nav .spacer { flex: 1; }
.nav .util { display: flex; align-items: center; gap: 6px; padding: 6px 0; }
.nav .util button {
  padding: 0 11px; font-size: 12px; font-weight: 500; color: #dbe7f7;
  border: 1px solid rgba(255,255,255,.28); border-radius: 3px; border-bottom-width: 1px;
}
.nav .util button:hover { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.5); }

/* 페이지 영역 */
.page { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.subbar {
  flex: 0 0 auto; min-height: var(--sub-h);
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 7px 18px; flex-wrap: wrap;
}
.subbar .t { font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: -0.4px; }
.subbar .t .path { font-size: 11px; color: var(--ink-3); font-weight: 400; margin-left: 8px; }
.subbar .spacer { flex: 1; }
.body {
  flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px 18px 24px;
}

/* --------------------------------- 컴포넌트 -------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 5px; justify-content: center;
  height: 29px; padding: 0 13px; border-radius: 3px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2); font-weight: 600; font-size: 12.5px;
  white-space: nowrap;
}
.btn:hover { background: var(--head); border-color: #b9c2d0; color: var(--ink); }
.btn.pri { background: var(--s1-navy); border-color: var(--s1-navy); color: #fff; }
.btn.pri:hover { background: var(--s1-navy-dk); border-color: var(--s1-navy-dk); color: #fff; }
.btn.dark { background: #3c4657; border-color: #3c4657; color: #fff; }
.btn.dark:hover { background: #2b3span; }
.btn.ai { background: #c0392b; border-color: #c0392b; color: #fff; }
.btn.ai:hover { background: #a52f22; border-color: #a52f22; color: #fff; }
.btn.danger { color: var(--bad); border-color: #e3b9b9; }
.btn.danger:hover { background: var(--bad-bg); }
.btn.sm { height: 24px; padding: 0 8px; font-size: 11.5px; font-weight: 500; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.fld { display: flex; align-items: center; gap: 5px; }
.fld > label { color: var(--ink-3); font-size: 11.5px; white-space: nowrap; }
input[type=text], input[type=password], input[type=date], input[type=number], select, textarea {
  height: 29px; border: 1px solid var(--line); border-radius: 3px; padding: 0 8px; background: #fff;
  outline: none;
}
textarea { height: auto; padding: 6px 8px; line-height: 1.55; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--s1-navy); box-shadow: 0 0 0 2px rgba(0,71,157,.11); }
input[readonly] { background: #f4f6fa; color: var(--ink-2); }
select { cursor: pointer; }

/* 패널 */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 3px; margin-bottom: 12px; }
.panel > h3 {
  margin: 0; padding: 9px 13px; font-size: 13px; font-weight: 700; color: var(--ink);
  border-bottom: 1px solid var(--line-2); background: linear-gradient(#fff, #fafbfd);
  display: flex; align-items: center; gap: 8px;
}
.panel > h3::before { content: ''; width: 3px; height: 13px; background: var(--s1-navy); border-radius: 1px; }
.panel > h3 .sub { font-weight: 400; font-size: 11.5px; color: var(--ink-3); }
.panel > h3 .spacer { flex: 1; }
.panel .in { padding: 12px 13px; }
.panel .in.p0 { padding: 0; }

/* 그리드 */
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g6 { grid-template-columns: repeat(6, 1fr); }
.g-2-1 { grid-template-columns: 2fr 1fr; }
.g-1-2 { grid-template-columns: 1fr 2fr; }
.g-3-2 { grid-template-columns: 3fr 2fr; }

/* KPI 카드 */
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 12px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: 3px; padding: 11px 13px 12px;
  position: relative; overflow: hidden;
}
.kpi::after { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--s1-navy); }
.kpi.w::after { background: #c9950e; }
.kpi.d::after { background: #b03030; }
.kpi.g::after { background: #14795a; }
.kpi .lab { font-size: 11.5px; color: var(--ink-3); margin-bottom: 5px; display: flex; align-items: center; gap: 5px; }
.kpi .val { font-size: 23px; font-weight: 700; letter-spacing: -0.8px; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.kpi .val small { font-size: 12px; font-weight: 600; color: var(--ink-3); margin-left: 3px; letter-spacing: 0; }
.kpi .sub { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.kpi.d .val { color: #a52121; }

/* 테이블 */
.tbl-wrap { overflow: auto; border-top: 1px solid var(--line-2); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12.5px; }
table.tbl th {
  background: var(--head); font-weight: 700; color: var(--ink-2); text-align: center;
  padding: 7px 8px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-2);
  position: sticky; top: 0; z-index: 2; white-space: nowrap;
}
table.tbl td {
  padding: 6px 8px; border-bottom: 1px solid var(--line-2); border-right: 1px solid #f0f2f6;
  vertical-align: middle; line-height: 1.5;
}
table.tbl tr:hover > td { background: #f7fafd; }
table.tbl tr.sel > td { background: var(--s1-navy-lt) !important; }
table.tbl th.sortable:hover { background: #e8edf5; }
table.tbl td.c, table.tbl th.c { text-align: center; }
table.tbl td.r, table.tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl tfoot td { background: #f2f5f9; font-weight: 700; border-top: 1px solid var(--line); }
table.tbl .ell { max-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.tbl.form th { text-align: left; background: var(--head); width: 110px; position: static; font-weight: 600; }
table.tbl.form td { padding: 5px 8px; }
.empty { padding: 46px 10px; text-align: center; color: var(--ink-3); font-size: 12.5px; }
.empty b { display: block; color: var(--ink-2); font-size: 13.5px; margin-bottom: 6px; }

/* 태그/배지 */
.tag {
  display: inline-block; padding: 1px 7px; border-radius: 2px; font-size: 11px; font-weight: 700;
  border: 1px solid transparent; white-space: nowrap; line-height: 1.7;
}
.tag.i { background: var(--info-bg); color: var(--info); border-color: #c2d8f0; }
.tag.o { background: var(--ok-bg); color: var(--ok); border-color: #bfe2d1; }
.tag.w { background: var(--warn-bg); color: var(--warn); border-color: #ecd79a; }
.tag.b { background: var(--bad-bg); color: var(--bad); border-color: #eec4c4; }
.tag.n { background: var(--gray-bg); color: #5b6577; border-color: #dadfe7; }
.tag.d { background: #e9e9ec; color: #8a8f98; border-color: #d7d9de; text-decoration: line-through; }
.tag.gate { background: #2c3e57; color: #fff; font-family: monospace; letter-spacing: .5px; }

/* 진척 바 */
.pbar { height: 14px; background: #eceff4; border-radius: 2px; position: relative; overflow: hidden; min-width: 66px; }
.pbar > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--s1-navy); display: block; }
.pbar > span { position: absolute; inset: 0; text-align: center; font-size: 10.5px; font-weight: 700; color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.45); line-height: 14px; }
.pbar.low > i { background: #8b98ab; }
.pbar.done > i { background: #14795a; }

/* 막대 차트(순수 CSS) */
.bars { display: flex; flex-direction: column; gap: 5px; }
.bars .row { display: grid; grid-template-columns: 118px 1fr 92px; align-items: center; gap: 8px; font-size: 12px; }
.bars .row .nm { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .row .bg { background: #f0f2f6; height: 17px; border-radius: 2px; position: relative; }
.bars .row .bg > i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, #0b57a4, #2f7ec9); border-radius: 2px; }
.bars .row .bg > i.alt { background: linear-gradient(90deg, #14795a, #2c9c78); }
.bars .row .vl { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.bars .row .vl small { color: var(--ink-3); font-weight: 400; margin-left: 3px; }

/* 파이프라인(퍼널) */
.funnel { display: flex; flex-direction: column; gap: 3px; }
.funnel .st { display: grid; grid-template-columns: 118px 1fr; gap: 8px; align-items: center; }
.funnel .st .n { font-size: 11.5px; color: var(--ink-2); text-align: right; }
.funnel .st .b { height: 22px; background: #f0f2f6; position: relative; border-radius: 2px; }
.funnel .st .b > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: #0b57a4; }
.funnel .st .b > span { position: absolute; left: 7px; top: 0; line-height: 22px; font-size: 11px; font-weight: 700; color: #fff; }
.funnel .st .b > em { position: absolute; right: 7px; top: 0; line-height: 22px; font-size: 11px; color: var(--ink-2); font-style: normal; }

/* 도넛(SVG 생성) */
.donut-wrap { display: flex; align-items: center; gap: 16px; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.donut-legend .li { display: flex; align-items: center; gap: 6px; }
.donut-legend .li i { width: 9px; height: 9px; border-radius: 2px; flex: 0 0 9px; }
.donut-legend .li .nm { flex: 1; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend .li b { font-variant-numeric: tabular-nums; }

/* 탭 */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button {
  border: 1px solid transparent; border-bottom: 0; background: transparent; cursor: pointer;
  padding: 7px 16px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin-bottom: -1px;
}
.tabs button.on {
  color: var(--s1-navy); background: #fff; border-color: var(--line); border-bottom: 1px solid #fff;
  border-top: 2px solid var(--s1-navy); border-radius: 3px 3px 0 0;
}

/* 모달 */
.modal-bg {
  position: fixed; inset: 0; background: rgba(20,26,36,.42); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center; padding: 44px 20px;
}
.modal {
  background: #fff; border-radius: 4px; box-shadow: 0 14px 44px rgba(0,0,0,.28);
  width: 760px; max-width: 100%; max-height: calc(100vh - 88px); display: flex; flex-direction: column;
}
.modal.wide { width: 1120px; }
.modal.narrow { width: 480px; }
.modal > header {
  padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px;
  background: var(--head);
}
.modal > header h4 { margin: 0; font-size: 14.5px; font-weight: 700; }
.modal > header .spacer { flex: 1; }
.modal > header .x { border: 0; background: transparent; cursor: pointer; font-size: 20px; color: var(--ink-3); line-height: 1; padding: 0 4px; }
.modal > header .x:hover { color: var(--bad); }
.modal > .mbody { padding: 14px 16px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.modal > footer {
  padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 7px; justify-content: flex-end;
  background: #fafbfd;
}

/* 토스트 */
#toast { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 7px; }
#toast .t {
  background: #22303f; color: #fff; padding: 10px 15px; border-radius: 3px; font-size: 12.5px;
  box-shadow: 0 6px 20px rgba(0,0,0,.26); max-width: 380px; border-left: 3px solid #4c9bef;
}
#toast .t.ok { border-left-color: #2fbb85; }
#toast .t.err { border-left-color: #ef6b6b; }

/* 폼 그리드 */
.fgrid { display: grid; grid-template-columns: 104px 1fr 104px 1fr; gap: 8px 10px; align-items: center; }
.fgrid .lbl { font-size: 12px; color: var(--ink-2); font-weight: 600; text-align: right; }
.fgrid .lbl.req::after { content: '*'; color: #c0392b; margin-left: 2px; }
.fgrid .full { grid-column: 2 / -1; }
.fgrid .all { grid-column: 1 / -1; }
.fgrid input, .fgrid select, .fgrid textarea { width: 100%; }
.hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.6; }
.hint.box { background: var(--s1-navy-lt); border: 1px solid #cfe0f3; border-radius: 3px; padding: 9px 11px; color: #2b4f7d; }
.hint.warnbox { background: var(--warn-bg); border: 1px solid #ecd79a; border-radius: 3px; padding: 9px 11px; color: #6f4a05; }

/* 일일보고 카드 */
.wl-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wl-list { display: flex; flex-direction: column; gap: 7px; }
.wl {
  border: 1px solid var(--line); border-left: 3px solid var(--s1-navy); border-radius: 3px; background: #fff;
  padding: 8px 10px; cursor: pointer;
}
.wl:hover { background: #f8fafd; border-color: #b9c8dc; }
.wl.done { border-left-color: #14795a; }
.wl.hold { border-left-color: #c9950e; }
.wl.plan { border-left-color: #8b98ab; }
.wl.drop { border-left-color: #adb5c0; opacity: .62; }
.wl .r1 { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.wl .r1 .ti { font-weight: 700; font-size: 12.8px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl .r2 { font-size: 11.5px; color: var(--ink-2); line-height: 1.55; max-height: 3.2em; overflow: hidden; }
.wl .r3 { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 11px; color: var(--ink-3); }
.wl .r3 .pb { width: 74px; }
.wl .iss { margin-top: 5px; font-size: 11px; color: #8a4b00; background: #fff8e8; border: 1px solid #f0dfb4; border-radius: 2px; padding: 3px 6px; }
.wl .carried { font-size: 10.5px; color: #0b57a4; background: #e9f1fb; border: 1px solid #c6dbf3; padding: 0 4px; border-radius: 2px; }

/* 좌우 분할(마스터-디테일) */
.split { display: grid; grid-template-columns: 1fr 400px; gap: 12px; align-items: start; }
.split.wide-detail { grid-template-columns: 1fr 470px; }

/* 리스트 요약줄 */
.sum-line { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--ink-2); padding: 7px 13px; background: #f7f9fc; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.sum-line b { color: var(--ink); font-variant-numeric: tabular-nums; }
.sum-line .dot { width: 1px; height: 12px; background: var(--line); }

/* 히트맵(개인×일자) */
.heat { overflow: auto; }
.heat table { border-collapse: collapse; font-size: 11.5px; }
.heat th, .heat td { border: 1px solid var(--line-2); padding: 4px 6px; text-align: center; white-space: nowrap; }
.heat th { background: var(--head); font-weight: 700; color: var(--ink-2); }
.heat td.nm { text-align: left; font-weight: 700; background: #fafbfd; position: sticky; left: 0; }
.heat td.h0 { background: #fff; color: #c3c9d2; }
.heat td.h1 { background: #e6effa; }
.heat td.h2 { background: #c3d9f2; }
.heat td.h3 { background: #8fb9e6; color: #fff; }
.heat td.h4 { background: #4a8ed1; color: #fff; }
.heat td.h5 { background: #00479d; color: #fff; }

/* 로딩 */
.loading { padding: 40px; text-align: center; color: var(--ink-3); font-size: 12.5px; }
.chk { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; font-size: 12px; color: var(--ink-2); }
.chk input { margin: 0; }

/* ==========================================================================
   보고서 문서(일일/주간 보고서 갑지) — 화면 및 A4 인쇄 공용
   ========================================================================== */
.rdoc {
  background: #fff; border: 1px solid var(--line); border-radius: 3px;
  padding: 22px 26px 26px; margin: 0 auto 14px; max-width: 1040px;
}
.rdoc .rhead {
  display: flex; align-items: flex-end; gap: 14px;
  border-bottom: 2px solid var(--s1-navy); padding-bottom: 9px; margin-bottom: 6px;
}
.rdoc .rhead .lg { display: flex; flex-direction: column; gap: 5px; }
.rdoc .rhead .lg img { height: 19px; display: block; }
.rdoc .rhead .lg .org { font-size: 11.5px; color: var(--ink-3); letter-spacing: -0.2px; }
.rdoc .rhead .rt { flex: 1; text-align: center; }
.rdoc .rhead .rt .tt { font-size: 22px; font-weight: 800; letter-spacing: -1.2px; color: var(--ink); }
.rdoc .rhead .rt .st { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.rdoc .rhead .rm { font-size: 11px; color: var(--ink-2); text-align: right; line-height: 1.75; white-space: nowrap; }
.rdoc .rhead .rm b { color: var(--ink); }
.rdoc .rline { height: 1px; background: var(--s1-navy); opacity: .35; margin-bottom: 16px; }
.rdoc h4 {
  margin: 18px 0 7px; font-size: 13.5px; font-weight: 800; color: var(--s1-navy-dk);
  display: flex; align-items: center; gap: 7px; letter-spacing: -0.4px;
}
.rdoc h4::before { content: '■'; font-size: 9px; color: var(--s1-navy); }
.rdoc h4 .sub { font-weight: 400; font-size: 11.5px; color: var(--ink-3); }
.rdoc h4 .spacer { flex: 1; }
.rdoc > h4:first-child { margin-top: 0; }
table.doc { width: 100%; border-collapse: collapse; font-size: 12px; }
table.doc th, table.doc td { border: 1px solid #aeb8c6; padding: 5px 7px; vertical-align: top; line-height: 1.6; }
table.doc th { background: #eaeff7; font-weight: 700; color: var(--ink-2); text-align: center; white-space: nowrap; vertical-align: middle; }
table.doc td.c { text-align: center; vertical-align: middle; }
table.doc td.r { text-align: right; font-variant-numeric: tabular-nums; }
table.doc td.mem { background: #f6f8fc; font-weight: 700; text-align: center; vertical-align: middle; white-space: nowrap; }
table.doc td.mem span { display: block; font-weight: 400; font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
table.doc td.grp { background: #f6f8fc; text-align: center; vertical-align: middle; font-weight: 600; font-size: 11.5px; }
table.doc tfoot td { background: #f1f4f9; font-weight: 700; }
table.doc .sm { font-size: 11px; color: var(--ink-2); }
table.doc .iss2 { color: #8a4b00; }
table.doc .sup2 { color: #26507f; }
.rdoc .sumbox {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
  border: 1px solid #aeb8c6; margin-bottom: 4px;
}
.rdoc .sumbox .c1 { padding: 8px 10px; border-right: 1px solid #cfd6e0; text-align: center; }
.rdoc .sumbox .c1:last-child { border-right: 0; }
.rdoc .sumbox .c1 .l { font-size: 11px; color: var(--ink-3); margin-bottom: 3px; }
.rdoc .sumbox .c1 .v { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.6px; }
.rdoc .sumbox .c1 .v small { font-size: 11px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.rdoc .sumbox .c1.d .v { color: #a52121; }
.rdoc .sumbox .c1.g .v { color: #10714f; }
.rdoc .signrow { display: flex; justify-content: flex-end; gap: 0; margin-top: 16px; }
.rdoc .signrow .sg { border: 1px solid #aeb8c6; border-left: 0; width: 108px; text-align: center; }
.rdoc .signrow .sg:first-child { border-left: 1px solid #aeb8c6; }
.rdoc .signrow .sg .h { background: #eaeff7; font-size: 11px; font-weight: 700; padding: 4px; border-bottom: 1px solid #aeb8c6; color: var(--ink-2); }
.rdoc .signrow .sg .b { height: 46px; }
.rdoc .rfoot { margin-top: 14px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--ink-3); display: flex; justify-content: space-between; }
.rdoc .nodata { padding: 22px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line); font-size: 12px; }

/* ==========================================================================
   인쇄 (A4 / 일일보고서 최적화)
   ========================================================================== */
@page { size: A4 portrait; margin: 11mm 10mm; }
@media print {
  .gnb, .nav, .subbar, .tabs, #toast, .no-print, .modal-bg, .wm-overlay { display: none !important; }
  html, body, #app { height: auto !important; overflow: visible !important; min-width: 0 !important; background: #fff !important; }
  .page, .body { overflow: visible !important; padding: 0 !important; display: block !important; }
  .panel { break-inside: avoid; }
  .rdoc { border: 0 !important; padding: 0 !important; margin: 0 !important; max-width: none !important; }
  .rdoc .rhead { padding-bottom: 7px; }
  table.doc { font-size: 10px; }
  table.doc th, table.doc td { padding: 3px 5px; }
  table.doc tr { break-inside: avoid; }
  .rdoc h4 { margin: 12px 0 5px; font-size: 12px; break-after: avoid; }
  .rdoc .sumbox .c1 .v { font-size: 16px; }
  .rdoc .pgbrk { break-before: page; }
  a[href]::after { content: none !important; }
}

/* ==========================================================================
   모바일 / 태블릿 반응형 (스마트폰에서 조회·작성·수정 모두 가능)
   ========================================================================== */
@media (max-width: 1023px) {
  html, body { height: auto; }
  body {
    overflow-x: hidden; overflow-y: auto; -webkit-text-size-adjust: 100%;
    font-size: 13.5px;
  }
  #app { min-width: 0; height: auto; min-height: 100vh; }

  /* 상단 헤더 */
  .gnb {
    position: sticky; top: 0; z-index: 40; height: auto; flex: 0 0 auto;
    padding: 7px 10px; gap: 8px; flex-wrap: nowrap;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
  }
  .gnb .logo { gap: 7px; min-width: 0; }
  .gnb .logo img { height: 17px; }
  .gnb .logo .sys {
    font-size: 12.5px; line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 44vw; vertical-align: middle;
  }
  .gnb .logo .sys small { display: none; }
  .gnb .clock { display: none; }
  .gnb .who { padding: 3px 5px 3px 7px; }
  .gnb .who label { display: none; }
  .gnb .who select { font-size: 12.5px; max-width: 118px; }

  /* 메뉴: 가로 스크롤 스트립 */
  .nav {
    position: sticky; top: 45px; z-index: 39;
    height: auto; flex: 0 0 auto; padding: 0;
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav button { padding: 0 13px; height: 40px; font-size: 13px; flex: 0 0 auto; }
  .nav .spacer { display: none; }
  .nav .util { padding: 5px 8px 5px 4px; flex: 0 0 auto; }
  .nav .util button { height: 30px; }

  /* 페이지 본문: 페이지 자체 스크롤 사용 */
  .page { display: block; flex: 1 1 auto; }
  .subbar { padding: 8px 10px; gap: 7px; min-height: 0; }
  .subbar .t { font-size: 14px; width: 100%; }
  .subbar .t .path { display: none; }
  .subbar .spacer { display: none; }
  .body { overflow: visible; padding: 10px 10px 56px; }

  /* 터치 타깃 확대 · iOS 자동 확대 방지 */
  .btn { height: 34px; padding: 0 12px; font-size: 13px; }
  .btn.sm { height: 28px; font-size: 12px; }
  input[type=text], input[type=password], input[type=date], input[type=number], select, textarea {
    height: 36px; font-size: 16px; border-radius: 4px;
  }
  textarea { height: auto; min-height: 72px; }
  .fld { flex: 1 1 auto; min-width: 138px; }
  .fld > label { font-size: 12px; }
  /* 인라인 width 지정을 무시하고 화면 폭에 맞춤 */
  .fld input, .fld select { flex: 1 1 auto; min-width: 0 !important; width: 100% !important; }
  .subbar .fld { min-width: 0; }
  .subbar .fld input[type=date] { min-width: 118px; }

  /* 그리드 전부 1단(일부 2단) */
  .grid, .grid.g2, .grid.g3, .grid.g4, .grid.g6,
  .grid.g-2-1, .grid.g-1-2, .grid.g-3-2 { grid-template-columns: 1fr !important; gap: 10px; }
  .kpis { grid-template-columns: repeat(2, 1fr) !important; gap: 8px; }
  .kpi { padding: 9px 11px 10px; }
  .kpi .val { font-size: 20px; }
  .wl-cols { grid-template-columns: 1fr !important; gap: 10px; }
  .split, .split.wide-detail { grid-template-columns: 1fr !important; }
  .fgrid { grid-template-columns: 1fr !important; gap: 3px 0; }
  .fgrid .lbl { text-align: left; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
  .fgrid .full, .fgrid .all { grid-column: 1 / -1 !important; }
  .bars .row { grid-template-columns: 92px 1fr 72px; font-size: 11.5px; }
  .funnel .st { grid-template-columns: 88px 1fr; }
  .funnel .st .n { font-size: 11px; }
  .funnel .st .b > em { display: none; }
  .donut-wrap { flex-direction: column; align-items: stretch; gap: 10px; }
  .donut-wrap svg { align-self: center; }

  /* ── 가로 오버플로 차단: grid/flex 자식의 min-width:auto 무력화 ──
     (자식이 콘텐츠 폭만큼 늘어나 화면을 넘기는 현상 방지 → 표는 자체 영역에서만 가로 스크롤) */
  .page, .body, .panel, .panel > .in, .grid > *, .split > *, .wl-cols > *,
  .wl-list, .wl, .kpi, .bars .row, .bars .row .bg, .funnel .st, .funnel .st .b,
  .donut-wrap, .donut-legend, .donut-legend .li, .sum-line, .rdoc {
    min-width: 0 !important;
  }
  .body > *, .grid > *, .panel { max-width: 100%; }
  .wl .r1 .ti, .bars .row .nm, .donut-legend .li .nm { min-width: 0; }
  /* 긴 영문/숫자 토큰(사업장명·T/A번호 등)으로 인한 폭 증가 방지 */
  .wl, .wl .r1, .wl .r2, .wl .r3, .wl .iss, .mcard, .sum-line, .kpi, .hint, .panel > h3 {
    overflow-wrap: break-word; word-break: break-word;
  }
  .wl .r1, .wl .r3, .panel > h3, .sum-line { flex-wrap: wrap; }
  .wl .r3 .pb { width: 64px; flex: 0 0 64px; }

  /* 표: 표 영역만 가로 스크롤 (높이 제한 해제 → 하단 잘림 방지) */
  .tbl-wrap, .heat, .panel .in.p0, .rdoc .doc-wrap,
  .panel .in.p0 > div[style*="overflow"], .panel .in > div[style*="overflow"] {
    max-height: none !important;
    overflow-x: auto !important; -webkit-overflow-scrolling: touch;
    width: 100%; max-width: 100%;
  }
  .tbl-wrap, .heat { min-width: 0 !important; }
  .tbl-wrap table.tbl, .panel .in.p0 > table.tbl { min-width: 620px; }
  table.tbl th { position: static; }
  table.tbl th, table.tbl td { padding: 7px 7px; font-size: 12.5px; }
  table.tbl.form, .panel .in.p0 > table.tbl.form { min-width: 0; }
  table.tbl.form th { width: 88px; font-size: 12px; }
  .rdoc table.doc { font-size: 11.5px; }
  /* 히트맵 등 인라인 최대높이 제한 해제 */
  .panel .in.p0 > div, .panel .in > .heat { max-height: none !important; }

  /* 탭: 가로 스크롤 */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs button { flex: 0 0 auto; padding: 9px 13px; }

  /* 모달: 전체화면 시트 */
  .modal-bg { padding: 0; align-items: stretch; }
  .modal, .modal.wide, .modal.narrow {
    width: 100% !important; max-width: 100% !important; max-height: 100% !important;
    border-radius: 0; height: 100%;
  }
  .modal > header { padding: 11px 12px; position: sticky; top: 0; z-index: 2; }
  .modal > header h4 { font-size: 14px; }
  .modal > header .x { font-size: 26px; padding: 0 8px; }
  .modal > .mbody { padding: 12px; -webkit-overflow-scrolling: touch; }
  .modal > footer {
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); position: sticky; bottom: 0;
  }
  .modal > footer .btn { flex: 1 1 auto; height: 40px; font-size: 13.5px; }

  #toast { left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); }
  #toast .t { max-width: none; }

  /* 보고서 문서 */
  .rdoc { padding: 14px 12px 18px; }
  .rdoc .rhead { flex-wrap: wrap; gap: 8px; }
  .rdoc .rhead .rt { order: 3; width: 100%; text-align: left; }
  .rdoc .rhead .rt .tt { font-size: 17px; }
  .rdoc .rhead .rm { font-size: 10.5px; line-height: 1.6; }
  .rdoc .sumbox { grid-template-columns: repeat(2, 1fr); }
  .rdoc .sumbox .c1 { border-bottom: 1px solid #cfd6e0; }
  .rdoc .sumbox .c1:nth-child(2n) { border-right: 0; }
  .rdoc .signrow { display: none; }
  .rdoc .doc-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .rdoc .doc-wrap table.doc { min-width: 600px; }

  .sum-line { gap: 8px; font-size: 11.5px; padding: 7px 10px; }
  .panel { margin-bottom: 10px; }
  .panel > h3 { padding: 9px 11px; font-size: 12.5px; flex-wrap: wrap; }
  .panel .in { padding: 10px 11px; }
  .heat table { font-size: 11px; }
  .heat td.nm { position: static; }
}

/* 소형 스마트폰 (≤ 480px) */
@media (max-width: 480px) {
  .kpis { grid-template-columns: repeat(2, 1fr) !important; }
  .gnb .logo .sys {
    font-size: 11.5px; max-width: 132px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle;
  }
  .gnb .who select { max-width: 96px; }
  /* 워터마크/데모모드 토글은 관리자 전용 부가 기능 — 좁은 화면에서는 숨겨 시스템명이 보일 공간 확보 (데스크탑·태블릿 폭에서는 계속 사용 가능) */
  .gnb .acct #btn-wm, .gnb .acct #btn-demo { display: none; }
  .subbar .btn { flex: 1 1 auto; }
  .rdoc .sumbox { grid-template-columns: 1fr 1fr; }
}

/* 모바일 전용 / PC 전용 표시 제어 */
.only-mo { display: none; }
@media (max-width: 1023px) {
  .only-mo { display: block; }
  .only-pc { display: none !important; }
}

/* 모바일 플로팅 등록 버튼 */
.fab {
  position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom));
  width: 52px; height: 52px; border-radius: 50%; z-index: 60;
  background: var(--s1-navy); color: #fff; border: 0; cursor: pointer;
  font-size: 30px; font-weight: 300; line-height: 48px; padding: 0;
  box-shadow: 0 4px 14px rgba(0,71,157,.42);
}
.fab:active { background: var(--s1-navy-dk); }
@media print { .fab { display: none !important; } }

/* 모바일 카드형 리스트(넓은 표 대체) */
.mcards { display: flex; flex-direction: column; gap: 8px; }
.mcard {
  border: 1px solid var(--line); border-left: 3px solid var(--s1-navy); border-radius: 4px;
  background: #fff; padding: 9px 11px; cursor: pointer;
}
.mcard:active { background: #f5f8fc; }
.mcard .m1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.mcard .m1 .id { font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.mcard .m2 { font-weight: 700; font-size: 13px; line-height: 1.45; margin-bottom: 3px; }
.mcard .m3 { font-size: 11.5px; color: var(--ink-2); line-height: 1.6; }
.mcard .m4 {
  display: flex; align-items: center; gap: 8px; margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed var(--line-2); font-size: 11.5px; color: var(--ink-3); flex-wrap: wrap;
}
.mcard .m4 b { color: var(--ink); font-variant-numeric: tabular-nums; }
.mcard.ov { border-left-color: #b03030; }
.mcard.won { border-left-color: #14795a; }

/* ============================== 영업 Biz 현황판 ============================== */
.biz-board { display: flex; gap: 10px; padding: 10px; overflow-x: auto; align-items: flex-start; }
.biz-col { flex: 1 1 0; min-width: 260px; background: var(--head); border: 1px solid var(--line); border-radius: 5px; display: flex; flex-direction: column; max-height: calc(100vh - 430px); min-height: 220px; }
.biz-col.drag-over { outline: 2px dashed var(--s1-navy); outline-offset: -2px; background: var(--s1-navy-lt); }
.biz-col-h { padding: 9px 10px 8px; border-bottom: 1px solid var(--line); background: #fff; border-radius: 5px 5px 0 0; }
.biz-col-h .t1 { font-size: 13px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.biz-col-h .t1 .cnt { font-size: 11px; font-weight: 700; color: #fff; background: var(--s1-navy); border-radius: 9px; padding: 1px 7px; }
.biz-col-h .t2 { font-size: 10.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
.biz-col-h .t3 { font-size: 10.5px; color: var(--ink-2); margin-top: 4px; font-weight: 600; }
.biz-col-b { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.biz-empty { text-align: center; color: var(--ink-3); font-size: 11.5px; padding: 20px 6px; border: 1px dashed var(--line); border-radius: 4px; }

.biz-card { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--s1-navy); border-radius: 4px; padding: 9px 10px; cursor: grab; }
.biz-card:active { cursor: grabbing; }
.biz-card:hover { border-color: #b9c8dc; box-shadow: 0 2px 6px rgba(15,40,80,.08); }
.bc1 { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.bc1 .id { font-size: 10.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bc2 { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.bc3 { font-size: 11.5px; color: var(--ink-2); line-height: 1.5; margin-bottom: 5px; }
.bc4 { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.bc4 b { color: var(--ink); font-variant-numeric: tabular-nums; }
.bc5 { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line-2); font-size: 10.5px; }
.bc6 { margin-top: 6px; }
.bc6 .btn { width: 100%; }
.biz-ai-comment { display: block; font-size: 11px; line-height: 1.5; color: #7a3b12; background: #fdf3e9; border: 1px solid #f0d9bd; border-radius: 4px; padding: 6px 8px; }

.biz-age { font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 8px; white-space: nowrap; }
.biz-age.ok { background: var(--ok-bg); color: var(--ok); }
.biz-age.warn { background: var(--warn-bg); color: var(--warn); }
.biz-age.bad { background: var(--bad-bg); color: var(--bad); }

.biz-wait { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 3px; margin-bottom: 5px; }
.biz-wait.cust { background: var(--bad-bg); color: var(--bad); }
.biz-wait.us { background: var(--info-bg); color: var(--info); }

.biz-cl { font-size: 10.5px; font-weight: 700; color: var(--ink-2); background: var(--head); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; }
.biz-cl.full { color: var(--ok); background: var(--ok-bg); border-color: transparent; }
.biz-nm { font-size: 10.5px; color: var(--s1-navy); font-weight: 600; }
.biz-nm.muted { color: var(--ink-3); font-weight: 400; }

.biz-checklist { display: flex; flex-direction: column; gap: 9px; }
.chk.block { display: flex; width: 100%; padding: 7px 9px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--head); font-size: 12.5px; }

.bt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }

@media (max-width: 1023px) {
  .biz-col { max-height: 60vh; min-width: 240px; }
}

/* ============================== AI 도우미(챗봇) — 사이트 전역 ============================== */
.chat-fab {
  position: fixed; left: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 60;
  height: 44px; padding: 0 16px; border-radius: 22px; border: 0; cursor: pointer;
  background: var(--s1-navy); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .3px;
  box-shadow: 0 4px 14px rgba(0,71,157,.38);
}
.chat-fab:hover { background: var(--s1-navy-dk); }
.chat-fab.on { background: var(--s1-navy-dk); }

.chat-panel {
  position: fixed; left: 14px; bottom: calc(66px + env(safe-area-inset-bottom)); z-index: 61;
  width: 360px; max-width: calc(100vw - 28px); height: 480px; max-height: calc(100vh - 100px);
  background: #fff; border-radius: 8px; border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(15,40,80,.24);
  display: flex; flex-direction: column; overflow: hidden;
}
.chat-panel[hidden] { display: none; }
.chat-head {
  flex: 0 0 auto; height: 42px; padding: 0 8px 0 14px; background: var(--s1-navy); color: #fff;
  display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 700;
}
.chat-head button {
  border: 0; background: transparent; color: #fff; font-size: 20px; line-height: 1; cursor: pointer; padding: 6px 8px; opacity: .85;
}
.chat-head button:hover { opacity: 1; }
.chat-body { flex: 1 1 auto; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.chat-msg { max-width: 86%; }
.chat-msg p { margin: 0 0 4px; }
.chat-msg p:last-child { margin-bottom: 0; }
.chat-msg.assistant { align-self: flex-start; }
.chat-msg.assistant > :not(.chat-editbtn) { background: #fff; border: 1px solid var(--line-2); border-radius: 3px 10px 10px 10px; padding: 8px 11px; font-size: 12.5px; line-height: 1.55; color: var(--ink); }
.chat-msg.assistant.busy > * { color: var(--ink-3); font-style: italic; }
.chat-editbtn {
  display: block; margin-top: 4px; height: 26px; padding: 0 12px; border-radius: 4px;
  border: 1px solid var(--line); background: var(--head); color: var(--ink-2); font-size: 11.5px; cursor: pointer;
}
.chat-editbtn:hover { background: var(--s1-navy-lt); border-color: #cfe0f3; color: var(--s1-navy); }
.chat-msg.user { align-self: flex-end; }
.chat-msg.user p { background: var(--s1-navy); color: #fff; border-radius: 10px 3px 10px 10px; padding: 8px 11px; font-size: 12.5px; line-height: 1.5; }
.chat-msg h4 { font-size: 12.5px; margin: 4px 0 3px; }
.chat-msg ul { margin: 2px 0 4px; padding-left: 18px; font-size: 12.5px; }
.chat-inbar { flex: 0 0 auto; display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line-2); background: #fff; }
.chat-inbar textarea {
  flex: 1; resize: none; height: 36px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 4px;
  font-family: inherit; font-size: 12.5px; line-height: 1.4;
}
.chat-inbar .btn { height: 36px; }

@media (max-width: 1023px) {
  .chat-panel {
    left: 0; right: 0; bottom: 0; top: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%;
    border-radius: 0; border: 0;
  }
  .chat-fab { bottom: calc(14px + env(safe-area-inset-bottom)); }
}
.briefing-original-wrap{margin:10px 0 16px}.briefing-original-label{display:flex;gap:8px;align-items:baseline;margin:0 0 7px;color:var(--ink-2)}.briefing-original-label span{font-size:12px;color:var(--ink-3)}.briefing-original{display:block;width:100%;height:70vh;min-height:520px;border:1px solid var(--line);border-radius:10px;background:#f5f7fa}
