/* ═══════════════════════════════════════════════════════════════════
   PHARMFORUM INSIGHT — 애플리케이션 UI (캔버스 바깥의 모든 것).
   report.css 가 "이미지에 찍히는 것", 이 파일은 "화면에서만 보이는 것".

   색 (2026-09-28 B안 "코드북 색인" 으로 교체 — 리포트 이미지(report.css)는 그대로)
     남색 #1B3A8C (버튼·링크·브랜드)   잉크 #121A33   보조 글자 #5A6480
     선 #D5DBE6   바탕 #E8ECF2   옅은 면 #F5F7FB   선택 면 #EEF2FA
     KCD 장(章) 탭 색은 lib/disease.php 의 disease_chapters() 가 준다.
   글꼴: 화면은 Pretendard(assets/fonts/pretendard, OFL), 코드는 IBM Plex Mono. 캔버스는 report.css 의 IBM Plex Sans KR.
   ═══════════════════════════════════════════════════════════════════ */

body {
    margin: 0;
    background: #E8ECF2;
    color: #121A33;
    /* Pretendard(로컬, assets/fonts/pretendard) — Gothic A1 은 윈도우 크롬에서 획이 얇게 번져 흐려 보여 교체(2026-09-28) */
    font-family: 'Pretendard Variable', 'IBM Plex Sans KR', 'Malgun Gothic', system-ui, sans-serif;
    word-break: keep-all;          /* 한글을 단어 중간에서 자르지 않는다("않았습/니다") */
    overflow-wrap: break-word;
}
a { color: #1B3A8C; }
a:hover { color: #10275F; }
:focus-visible { outline: 2px solid #1B3A8C; outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── 상단 바 ────────────────────────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 20;
    height: 62px; box-sizing: border-box;
    background: #FFFFFF;
    border-bottom: 1px solid #D5DBE6;
    display: flex; align-items: center; gap: 18px;
    padding: 0 24px;
    color: #121A33;
}
.topbar .brand {
    font-size: 18px; font-weight: 900; letter-spacing: -0.01em;
    color: #1B3A8C; text-decoration: none; white-space: nowrap;
}
.topbar .brand b { font-weight: 900; }
.topbar .crumb {
    display: flex; align-items: center; gap: 9px;
    font-size: 16px; font-weight: 800; color: #121A33;
    min-width: 0; overflow: hidden;
}
.topbar .crumb.sub { font-size: 14px; font-weight: 500; color: #5A6480; }
.topbar .chip {
    font-size: 12.5px; font-weight: 700; color: #1B3A8C;
    border: 1px solid #C9D3EA; background: #EEF2FA;
    padding: 2px 9px; border-radius: 6px; white-space: nowrap;
}
.topbar .actions { margin-left: auto; display: flex; gap: 8px; }

.btn {
    font: inherit; font-size: 14px; font-weight: 700;
    padding: 9px 16px; border-radius: 8px; cursor: pointer;
    border: 1px solid #C7D0DE; background: #FFFFFF; color: #121A33;
    text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
    white-space: nowrap;
}
.btn:hover { border-color: #1B3A8C; color: #1B3A8C; }
.btn.primary { background: #1B3A8C; border-color: #1B3A8C; color: #FFFFFF; }
.btn.primary:hover { background: #10275F; border-color: #10275F; color: #FFFFFF; }
.btn.primary[disabled] { opacity: .55; cursor: default; }
.btn.ghost { border-style: dashed; border-color: #C7D0DE; color: #5A6480; width: 100%; justify-content: center; }
.btn.ghost:hover { border-color: #1B3A8C; color: #1B3A8C; }
.btn.wide { width: 100%; justify-content: center; margin-top: 10px; padding: 12px; font-size: 15px; }

/* ── 작업 영역 (리포트 화면) ────────────────────────────────────── */
.work { display: flex; align-items: flex-start; gap: 0; }
.work .stage { flex: 1; min-width: 0; padding: 26px; overflow: auto; }
/* 캔버스는 1920px 고정 → 화면 폭에 맞춰 축소만 한다(JS가 scale 계산) */
.work .stage .canvas { box-shadow: 0 16px 44px rgba(18, 26, 51, .22); word-break: normal; }   /* PNG(렌더 모드엔 이 파일이 없다)와 줄바꿈을 똑같이 */
/* 1·2페이지 머리 — 캔버스 위 한 줄 */
.page-label { margin: 0 0 10px; font-size: 14px; font-weight: 800; color: #3A4460; scroll-margin-top: 80px; }
.page-label span { margin-left: 8px; font-weight: 500; color: #5A6480; }
.stage .canvas + .page-label { margin-top: 34px; }

/* 내려받기 메뉴 (1페이지 PNG · 2페이지 PNG · PDF) */
.dl { position: relative; }
.dl-menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px;
    background: #FFFFFF; border: 1px solid #D5DBE6; border-radius: 10px; padding: 6px;
    box-shadow: 0 12px 32px rgba(18, 26, 51, .16);
}
.dl-menu button {
    display: flex; align-items: baseline; justify-content: space-between; gap: 14px; width: 100%;
    font: inherit; font-size: 14px; text-align: left; color: #121A33;
    background: none; border: 0; border-radius: 6px; padding: 10px 12px; cursor: pointer;
}
.dl-menu button span { font-size: 12.5px; color: #5A6480; }
.dl-menu button:hover, .dl-menu button:focus-visible { background: #EEF2FA; }

/* 편집 패널은 화면에 붙어 있고 안에서만 따로 스크롤한다 — 리포트를 내려 봐도 패널이 따라온다(2026-09-29) */
.side {
    flex: none; width: 390px;
    position: sticky; top: 62px; align-self: flex-start;
    height: calc(100vh - 62px); overflow-y: auto; overscroll-behavior: contain;
    box-sizing: border-box;
    background: #FFFFFF; border-left: 1px solid #D5DBE6;
    padding: 18px 22px 40px;
}
.side-guide {
    margin: 0 0 14px; padding: 10px 12px; border-radius: 8px;
    background: #EEF2FA; color: #3A4460; font-size: 12.5px; line-height: 1.6;
}
.side-guide b { color: #B7791F; }

/* 구역 = 리포트 칸 하나(또는 여럿)를 고치는 곳. 머리에 바뀌는 칸 번호를 캔버스와 같은 딱지로 */
.sec {
    margin: 0 -10px; padding: 16px 10px 18px;
    border-top: 1px solid #E8ECF2; border-radius: 10px;
    transition: background-color .2s;
}
.side-guide + .sec { border-top: 0; }
.sec.on { background: #FFF8EC; }
.sec.flash { animation: sec-flash 1.4s ease-out; }
@keyframes sec-flash { 0%, 35% { background: #FBE3B5; } 100% { background: #FFF8EC; } }
.sec-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sec-hd h3 { margin: 0; }
.affects {
    margin-left: auto; display: inline-flex; align-items: center; gap: 4px;
    font-size: 11.5px; font-weight: 600; color: #5A6480; white-space: nowrap;
}
.affects b {
    min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box;
    display: inline-flex; align-items: center; justify-content: center;
    background: #F0A21B; color: #131E33; font-size: 12px; font-weight: 800;
}
.affects b.pg { background: #131E33; color: #F0A21B; }
.sec-what { margin: 0 0 12px; font-size: 13px; color: #3A4460; line-height: 1.55; }

/* 캔버스 칸 — 패널 구역에 마우스를 올리면 테두리, 고칠 수 있는 칸은 누르면 그 구역으로(화면 전용, PNG 에는 없다) */
.stage .card.editable { cursor: pointer; }
.stage .card.editable:hover { outline: 5px solid rgba(240, 162, 27, .45); outline-offset: 5px; }
.stage .card.hl, .stage .card.hl:hover { outline: 9px solid #F0A21B; outline-offset: 5px; }
@media (prefers-reduced-motion: reduce) { .sec, .sec.flash { transition: none; animation: none; } }
.side h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
.side h4 { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: #3A4460; }
.side h4 .more { float: right; font-size: 12px; font-weight: 700; color: #1B3A8C; }
.side .hint { margin: 0 0 16px; font-size: 13px; color: #5A6480; line-height: 1.55; }
.sec + h4 { margin-top: 6px; padding-top: 16px; border-top: 1px solid #E8ECF2; }   /* 마지막 구역 다음 '데이터 출처' */

.tip-item {
    border: 1px solid #D5DBE6; border-radius: 8px;
    padding: 12px; margin-bottom: 10px; background: #F5F7FB;
}
/* ⚠ 클래스명 주의: report.css 의 .hd 는 캔버스 헤더(높이 144px·네이비 배경)다.
   같은 이름을 쓰면 편집 패널에 검은 띠가 생긴다 — 그래서 .tip-hd 로 분리한다. */
.tip-item .tip-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tip-item .tip-hd .n {
    width: 22px; height: 22px; border-radius: 50%; background: #1B3A8C; color: #FFFFFF;
    font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.tip-item .tip-hd .del {
    margin-left: auto; border: 0; background: none; cursor: pointer;
    color: #8B93A8; font-size: 17px; line-height: 1; padding: 2px 5px;
}
.tip-item .tip-hd .del:hover { color: #B3261E; }
.tip-item label { display: block; font-size: 11.5px; font-weight: 700; color: #5A6480; margin: 7px 0 3px; }
.tip-item input {
    width: 100%; box-sizing: border-box; font: inherit; font-size: 13.5px;
    padding: 7px 9px; border: 1px solid #C7D0DE; border-radius: 6px; background: #FFFFFF;
}
.tip-item input:focus { outline: 0; border-color: #1B3A8C; box-shadow: 0 0 0 2px rgba(27, 58, 140, .16); }

/* ── ⑤ 대표 상병 순위 편집 ─────────────────────────────────────── */
.sick-row {
    display: grid;
    grid-template-columns: 22px 78px 1fr auto auto;
    grid-template-rows: auto auto;
    align-items: center; gap: 4px 6px;
    border: 1px solid #D5DBE6; border-left: 4px solid #C7D0DE; border-radius: 6px;
    padding: 8px 8px 6px; margin-bottom: 7px; background: #FFFFFF;
}
.sick-row.top { border-left-color: #1B3A8C; background: #F5F7FB; }
.sick-row .rk {
    width: 22px; height: 22px; border-radius: 5px; background: #E8ECF2; color: #3A4460;
    font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.sick-row.top .rk { background: #1B3A8C; color: #FFFFFF; }
.sick-row input {
    width: 100%; min-width: 0; box-sizing: border-box; font: inherit; font-size: 13px;
    padding: 6px 7px; border: 1px solid #C7D0DE; border-radius: 6px; background: #FFFFFF;
}
.sick-row input[name=code] { font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
.sick-row input:focus { outline: 0; border-color: #1B3A8C; box-shadow: 0 0 0 2px rgba(27, 58, 140, .16); }
.sick-row .mv { display: flex; flex-direction: column; gap: 1px; }
.sick-row .mv button, .sick-row .del {
    border: 0; background: none; cursor: pointer; color: #8B93A8; line-height: 1; padding: 1px 4px;
}
.sick-row .mv button { font-size: 9px; }
.sick-row .del { font-size: 17px; }
.sick-row .mv button:hover { color: #1B3A8C; }
.sick-row .del:hover { color: #B3261E; }
.sick-row .meta { grid-column: 2 / -1; font-size: 11.5px; color: #5A6480; min-height: 14px; }
.sick-row .meta.warn { color: #9A4A00; font-weight: 700; }

.sick-add { display: flex; gap: 6px; margin-top: 4px; }
.sick-add select {
    flex: 1; min-width: 0; font: inherit; font-size: 13px; color: #3A4460;
    padding: 7px 8px; border: 1px dashed #C7D0DE; border-radius: 6px; background: #FFFFFF; cursor: pointer;
}
.btn.ghost.narrow { width: auto; padding: 7px 11px; font-size: 13px; }
.row2 { display: flex; gap: 8px; margin-top: 10px; }
.row2 .btn { flex: 1; width: auto; justify-content: center; padding: 10px 8px; }

.saved { font-size: 13px; color: #1E7A55; margin-top: 9px; min-height: 18px; font-weight: 700; }
.saved.err { color: #B3261E; }

.side .src { list-style: none; margin: 0; padding: 0; font-size: 12.5px; color: #3A4460; }
.side .src li { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px dotted #D5DBE6; }
.side .src li b { flex: none; color: #1B3A8C; width: auto; min-width: 26px; }
.side .src li span { margin-left: auto; color: #5A6480; }
.side .src li.why { display: block; font-size: 11.5px; color: #1B3A8C; background: #EEF2FA; padding: 6px 8px; border-bottom: 0; line-height: 1.5; }
.side .foot { margin-top: 16px; font-size: 11.5px; color: #5A6480; line-height: 1.6; }

/* ── 첫 화면 (B안: 코드북 색인) ─────────────────────────────────── */
.bhome { display: flex; align-items: stretch; min-height: calc(100vh - 62px); }
.bhome-main {
    flex: 1; min-width: 0; box-sizing: border-box;
    background: #FFFFFF; padding: 44px 64px 56px 72px;
    display: flex; flex-direction: column; gap: 36px;
}
/* 본문은 화면 가운데, 최대 1680px — 넓은 모니터(2540px)에서 왼쪽에 몰리고 오른쪽이 비던 것(2026-09-28) */
.bhome-main > * { width: 100%; max-width: 1680px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
.hero h1 { margin: 0 0 16px; font-size: clamp(40px, 1.6vw + 18px, 56px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.25; }

.searchbox { display: flex; height: clamp(68px, 1.2vw + 50px, 80px); }
.searchbox input {
    flex: 1; min-width: 0; font: inherit; font-size: 20px; padding: 0 22px;
    border: 2px solid #1B3A8C; border-right: 0; border-radius: 10px 0 0 10px; background: #FFFFFF; color: #121A33;
}
.searchbox input:focus { outline: 0; box-shadow: inset 0 0 0 1px #1B3A8C; }
.searchbox button {
    width: 140px; font: inherit; font-size: 18px; font-weight: 700;
    border: 0; border-radius: 0 10px 10px 0; background: #1B3A8C; color: #FFFFFF; cursor: pointer;
}
.searchbox button:hover { background: #10275F; }

.results { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.results a, .results .off {
    display: flex; align-items: center; gap: 12px;
    background: #FFFFFF; border: 1px solid #D5DBE6; border-radius: 10px;
    padding: 13px 18px; text-decoration: none; color: inherit;
}
.results a:hover { border-color: #1B3A8C; background: #F5F7FB; }
.results .nm { font-size: 17px; font-weight: 700; }
.results .cd {
    font-family: 'IBM Plex Mono', monospace; font-size: 13.5px; font-weight: 600;
    color: #FFFFFF; background: #1B3A8C; padding: 2px 8px; border-radius: 5px;
}
.results .atc {
    font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 600;
    color: #1B3A8C; border: 1px solid #C9D3EA; background: #EEF2FA; padding: 2px 8px; border-radius: 5px;
}
.results .pt { font-size: 13px; color: #5A6480; font-variant-numeric: tabular-nums; }
.results .go { margin-left: auto; font-size: 14px; font-weight: 700; color: #1B3A8C; }
.results .auto {
    font-size: 12px; font-weight: 700; color: #3A4460;
    border: 1px solid #D5DBE6; background: #F5F7FB; padding: 2px 8px; border-radius: 5px; cursor: help;
}
.results .off { opacity: .62; }
.results .off .go { color: #5A6480; font-weight: 500; }

/* 최근 리포트 칸은 본문의 38%(최소 440px) — 썸네일이 칸 폭만큼 16:9 로 커진다 */
.home-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(440px, 38%); gap: 56px; align-items: start; }
.home-cols h2, .chapter-view h2 { margin: 0; font-size: 16px; font-weight: 700; }
.by-chapter h2 span { font-weight: 400; color: #5A6480; }
.grp-grid { margin-top: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 22px 26px; }
.grp { display: flex; flex-direction: column; gap: 8px; }
.grp .gh { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--tab-fg); }
.grp .lt, .chapter-view .lt {
    flex: none; min-width: 26px; height: 26px; padding: 0 4px; box-sizing: border-box; border-radius: 6px;
    background: var(--tab-bg); color: var(--tab-fg); font-weight: 900; font-size: 13px;
    display: inline-flex; align-items: center; justify-content: center;
}
.grp a { display: flex; gap: 10px; font-size: 16px; color: #121A33; text-decoration: none; }
.grp a b { width: 36px; flex: none; color: #1B3A8C; }
.grp a:hover .nm { text-decoration: underline; text-underline-offset: 3px; }

.recent-shots { display: flex; flex-direction: column; gap: 10px; }
.rs-hd { display: flex; align-items: baseline; }
.rs-hd a { margin-left: auto; font-size: 14px; font-weight: 700; text-decoration: none; }
.shot { display: flex; flex-direction: column; gap: 8px; color: #121A33; text-decoration: none; }
.shot .frame { position: relative; display: block; margin: 14px; background: #F5F7FB; box-shadow: 0 14px 32px rgba(18, 26, 51, .18); }
.shot .frame { aspect-ratio: 16 / 9; }
.shot.small .frame { margin: 12px; box-shadow: 0 8px 20px rgba(18, 26, 51, .16); }
.shot .frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.shot .none {
    position: absolute; inset: 0; box-sizing: border-box; border: 1.5px dashed #AEB7C8; background: #F7F9FC;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 0 18px; text-align: center; font-size: 14px; font-weight: 700; color: #3A4460;
}
.shot .none small { font-size: 12.5px; font-weight: 400; color: #5A6480; }
.shot.small .none { font-size: 12px; padding: 0 10px; }
.shot.small .none small { display: none; }
.shot:has(.none) .frame { box-shadow: none; }
/* 재단선 — 네 모서리 바깥에 짧은 선 두 개씩 */
.shot .c { position: absolute; width: 0; height: 0; }
.shot .c::before, .shot .c::after { content: ""; position: absolute; background: #8B93A8; }
.shot .c::before { width: 10px; height: 1px; }
.shot .c::after  { width: 1px; height: 10px; }
.shot .c.tl { left: 0; top: 0; }     .shot .c.tl::before { left: -14px; top: -1px; }  .shot .c.tl::after { left: -1px; top: -14px; }
.shot .c.tr { right: 0; top: 0; }    .shot .c.tr::before { left: 4px; top: -1px; }    .shot .c.tr::after { left: 0; top: -14px; }
.shot .c.bl { left: 0; bottom: 0; }  .shot .c.bl::before { left: -14px; top: 0; }     .shot .c.bl::after { left: -1px; top: 4px; }
.shot .c.br { right: 0; bottom: 0; } .shot .c.br::before { left: 4px; top: 0; }       .shot .c.br::after { left: 0; top: 4px; }
.shot .cap { display: flex; align-items: baseline; gap: 10px; padding: 0 14px; font-size: 14px; }
.shot .cap b { font-size: 17px; font-weight: 800; }
.shot .cap span { color: #5A6480; }
.shot .cap em { margin-left: auto; font-style: normal; font-size: 13px; font-weight: 700; color: #1B3A8C; }
.shot.small .cap { flex-direction: column; gap: 2px; padding: 0 12px; }
.shot.small .cap b { font-size: 15px; }
.shot.small .cap span { font-size: 12.5px; }
.shot:hover .cap b { color: #1B3A8C; }
.shot-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
.shot-empty { padding: 26px 18px; border: 1.5px dashed #AEB7C8; border-radius: 10px; color: #5A6480; font-size: 14px; line-height: 1.6; }

.chapter-view { display: flex; flex-direction: column; gap: 14px; }
.chapter-view .ch-hd { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.chapter-view .ch-hd .lt { min-width: 36px; height: 36px; font-size: 16px; border-radius: 8px; }
.chapter-view .ch-hd h2 { font-size: 22px; font-weight: 800; }
.chapter-view .ch-hd .m { font-size: 13.5px; color: #5A6480; }
.chapter-view .results { margin-top: 0; }

/* 오른쪽 가장자리 색인 탭 */
.thumb-index {
    flex: none; width: 104px; box-sizing: border-box; padding: 40px 0;
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 62px; align-self: flex-start; max-height: calc(100vh - 62px); overflow-y: auto;
}
.thumb-index a {
    height: 54px; flex: none; box-sizing: border-box; border-radius: 0 12px 12px 0;
    background: var(--tab-bg, #D5DBE6); color: var(--tab-fg, #121A33); text-decoration: none;
    display: flex; flex-direction: column; justify-content: center; padding-left: 14px; font-size: 11px; font-weight: 500;
}
.thumb-index a b { font-size: 17px; font-weight: 900; }
.thumb-index a.all { background: #D5DBE6; color: #121A33; }
.thumb-index a.all.on { background: #1B3A8C; color: #FFFFFF; }
.thumb-index a:not(.all).on { width: 116px; margin-left: -12px; padding-left: 26px; box-shadow: inset -3px 0 0 var(--tab-fg); }
.thumb-index a:hover { filter: brightness(.96); }

.spin { display: inline-block; font-size: 13.5px; color: #5A6480; padding: 10px 2px; }

/* ── 리포트 생성 중 가림막 ─────────────────────────────────────── */
.making {
    position: fixed; inset: 0; z-index: 100;
    background: rgba(18, 26, 51, .5);
    display: flex; align-items: center; justify-content: center;
}
.making[hidden] { display: none; }
.making .box {
    background: #FFFFFF; border-top: 4px solid #1B3A8C; border-radius: 10px;
    padding: 30px 36px; max-width: 460px; text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
}
.making .spinner {
    width: 38px; height: 38px; margin: 0 auto 16px; border-radius: 50%;
    border: 4px solid #E8ECF2; border-top-color: #1B3A8C; animation: making-spin .8s linear infinite;
}
@keyframes making-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .making .spinner { animation-duration: 2.4s; } }
.making .t { font-size: 19px; font-weight: 800; color: #121A33; }
.making .d { margin-top: 8px; font-size: 13.5px; color: #5A6480; line-height: 1.6; }
.making #makingName { font-size: 16px; font-weight: 800; color: #1B3A8C; }


/* ── 알림 띠 (이미 만든 리포트 열림 · 전수 조사 진행 중) ─────────── */
.notice {
    background: #EEF2FA; border: 1px solid #C9D3EA; border-left: 5px solid #1B3A8C;
    color: #3A4460; font-size: 14px; line-height: 1.6; padding: 11px 16px; margin: 0 0 14px; border-radius: 6px;
}
.notice.slim { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 14px; font-size: 13px; }
.notice.slim > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice .x { flex: none; border: 0; background: none; font-size: 18px; line-height: 1; color: #5A6480; cursor: pointer; padding: 2px 6px; }
.notice .x:hover { color: #121A33; }
.notice.err { background: #FDECEA; border-color: #F2B8B2; border-left-color: #B3261E; color: #7A1A14; }
.hero .notice { margin-top: 16px; box-sizing: border-box; }

/* ── 약 계열 (리포트 오른쪽 패널) ─────────────────────────────── */
.atc-now { background: #F5F7FB; border: 1px solid #D5DBE6; border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; font-size: 13px; }
.atc-now > div { display: flex; align-items: baseline; gap: 7px; padding: 2px 0; }
.atc-now .k { flex: none; width: 56px; font-size: 12px; font-weight: 700; color: #5A6480; }
.atc-now .code { font-family: 'IBM Plex Mono', monospace; font-weight: 700; color: #1B3A8C; }
.atc-now .m { margin-left: auto; font-size: 11.5px; color: #5A6480; white-space: nowrap; }
.atc-now .why { margin: 6px 0 0; font-size: 11.5px; line-height: 1.5; color: #1B3A8C; background: #EEF2FA; padding: 6px 8px; border-radius: 5px; }
/* 계열을 정한 곳 배지 — ⚠ .src 는 오른쪽 패널 "데이터 출처" 목록(ul.src)이 이미 쓰는 이름이라 .srcb 로 분리 */
.srcb { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 5px; background: #E8ECF2; color: #3A4460; white-space: nowrap; }
.srcb.srcb-auto { background: #EEF2FA; color: #1B3A8C; }
.srcb.srcb-user { background: #F3E3BD; color: #6B4B0B; }
.srcb.srcb-url  { background: #DCE2EA; color: #34445A; }
#atcPanel { margin-top: 10px; }
.atc-table-wrap { max-height: 340px; overflow: auto; border: 1px solid #D5DBE6; border-radius: 6px; }
.atc-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.atc-table th { position: sticky; top: 0; background: #F5F7FB; color: #5A6480; font-weight: 700; padding: 6px 4px; text-align: center; border-bottom: 1px solid #D5DBE6; font-size: 11px; line-height: 1.25; }
.atc-table td { padding: 5px 4px; border-bottom: 1px solid #E8ECF2; text-align: center; vertical-align: middle; }
.atc-table td.nm { text-align: left; width: 100%; max-width: 0; white-space: nowrap; overflow: hidden; }   /* 이름 열이 남는 폭만 쓰고 말줄임 — 옆 패널 밖으로 밀려나지 않게 */
.atc-table td.nm b { font-family: 'IBM Plex Mono', monospace; }
.atc-table td.nm div { font-size: 10.5px; color: #5A6480; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atc-table td.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.atc-table tr.is-primary td { background: #EEF2FA; }
.atc-table tr.excluded td { color: #8B93A8; }
.atc-table .rec { font-size: 10px; font-weight: 700; color: #1B3A8C; background: #EEF2FA; padding: 0 5px; border-radius: 4px; }
.atc-table .exc { font-size: 10px; font-weight: 700; color: #5A6480; background: #E8ECF2; padding: 0 5px; border-radius: 4px; }
.atc-add { display: flex; gap: 6px; margin-top: 8px; }
.atc-add input { flex: 1; min-width: 0; font: inherit; font-size: 13px; padding: 7px 9px; border: 1px solid #C7D0DE; border-radius: 6px; }

/* ── ③ 기준 전환 버튼 ─────────────────────────────────────────── */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 4px 0 8px; }
.seg button {
    font: inherit; font-size: 13.5px; font-weight: 700; padding: 9px 8px; cursor: pointer;
    border: 1px solid #C7D0DE; border-radius: 8px; background: #FFFFFF; color: #3A4460; line-height: 1.3;
}
.seg button small { display: block; font-size: 11px; font-weight: 500; color: #5A6480; margin-top: 2px; }
.seg button.on { border: 2px solid #1B3A8C; background: #EEF2FA; color: #121A33; }
.seg button:hover:not(.on) { border-color: #8B93A8; }
.seg.seg3 { grid-template-columns: repeat(3, 1fr); }
.p2set .k { font-size: 12px; font-weight: 700; color: #5A6480; margin-top: 8px; }
.p2-empty-note { margin: -2px 0 6px; font-size: 12px; color: #8A5A00; background: #FBF1DA; padding: 5px 8px; border-radius: 5px; }

/* ── 버튼 보조 ────────────────────────────────────────────────── */
.btn.ghost.danger { color: #B3261E; border-color: #F2B8B2; }
.btn.ghost.danger:hover { color: #FFFFFF; background: #B3261E; border-color: #B3261E; }
.btn[disabled] { opacity: .5; cursor: default; }

/* ── 전체 리포트 관리 화면 ────────────────────────────────────── */
.admin { max-width: 1320px; margin: 0 auto; padding: 26px 24px 60px; }
.panel { background: #FFFFFF; border: 1px solid #D5DBE6; border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; }
.panel-hd { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.panel-hd h2 { margin: 0; font-size: 18px; font-weight: 800; }
.panel-hd h2 small { font-size: 13px; color: #5A6480; font-weight: 600; }
.panel-hd .m { font-size: 12.5px; color: #5A6480; }
.mini-search { margin-left: auto; display: flex; gap: 6px; }
.mini-search input { font: inherit; font-size: 13.5px; padding: 7px 10px; border: 1px solid #C7D0DE; border-radius: 6px; width: 220px; }
.scan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.scan-grid > div { background: #F5F7FB; border: 1px solid #E8ECF2; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.scan-grid .k { font-size: 12px; font-weight: 700; color: #5A6480; }
.scan-grid b { font-size: 20px; color: #121A33; }
.scan-grid .m { font-size: 12px; color: #5A6480; }
.scan-grid .act { justify-content: center; align-items: flex-start; }
.st { font-weight: 700; }
.st.ok, .st.st-done { color: #1E7A55; }
.st.run, .st.st-running { color: #1B3A8C; }
.st.wait, .st.st-incomplete { color: #8A5A00; }
.st.st-failed { color: #B3261E; }
table.runs { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13px; }
table.runs th, table.runs td { padding: 6px 10px; border-bottom: 1px solid #E8ECF2; text-align: left; }
table.runs th { color: #5A6480; font-size: 12px; background: #F5F7FB; }
.table-wrap { overflow-x: auto; }
table.reports { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.reports th { text-align: left; font-size: 12px; color: #5A6480; background: #F5F7FB; padding: 8px 10px; border-bottom: 1px solid #D5DBE6; white-space: nowrap; }
table.reports td { padding: 9px 10px; border-bottom: 1px solid #E8ECF2; vertical-align: middle; }
table.reports td a { color: #121A33; text-decoration: none; font-weight: 700; }
table.reports td a:hover { color: #1B3A8C; }
table.reports .mono { font-family: 'IBM Plex Mono', monospace; font-weight: 600; }
table.reports .num { white-space: nowrap; font-weight: 700; }
table.reports .num small { font-weight: 500; color: #5A6480; margin-left: 1px; }
.next-year {
    margin-top: 16px; padding: 12px 16px; border: 1px solid #D5DBE6; border-left: 5px solid #C7D0DE;
    border-radius: 6px; background: #F5F7FB; color: #3A4460; font-size: 13px; line-height: 1.6;
}
.next-year.due { border-color: #E8CF94; border-left-color: #B7791F; background: #FBF1DA; }
.next-year > b { display: block; margin-bottom: 6px; font-size: 14px; color: #121A33; }
.next-year ol { margin: 0 0 6px; padding-left: 18px; }
.next-year li { margin: 2px 0; }
.next-year code { font-family: 'IBM Plex Mono', monospace; font-size: 12px; background: #E8ECF2; padding: 1px 5px; border-radius: 4px; }
.next-year .m { display: block; margin-top: 6px; font-size: 12px; color: #5A6480; }
.next-year a { color: #1B3A8C; }

table.reports .old { font-size: 10.5px; font-weight: 700; color: #B3261E; background: #FDECEA; padding: 1px 5px; border-radius: 4px; }
table.reports .dup { font-size: 11px; font-weight: 700; color: #6B4B0B; background: #F3E3BD; padding: 1px 6px; border-radius: 4px; margin-left: 4px; cursor: help; }
table.reports .edits span { font-size: 11px; font-weight: 700; color: #1B3A8C; background: #EEF2FA; padding: 1px 6px; border-radius: 4px; margin-right: 3px; white-space: nowrap; }
table.reports .edits span.stale { color: #6B4B0B; background: #F3E3BD; cursor: help; }
table.reports .acts { white-space: nowrap; text-align: right; }
.admin .empty { padding: 26px; text-align: center; color: #5A6480; }

/* ── 검색 결과: 못 만드는 질환의 이유 → guide.php ───────────────── */
/* ⚠ .results a 가 결과 줄 전체를 카드로 만드는 규칙이라, 안쪽 링크는 따로 되돌린다 */
.results .off .go a.reason {
    display: inline; padding: 0; border: 0; border-radius: 0; background: none;
    color: #1B3A8C; font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}
.results .off .go a.reason:hover { color: #10275F; background: none; }

/* ── 데이터 설명 (guide.php) ──────────────────────────────────── */
.guide {
    max-width: 1120px; margin: 0 auto; padding: 32px 24px 80px;
    display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 40px; align-items: start;
}
.guide-toc { position: sticky; top: 86px; display: flex; flex-direction: column; }
.guide-toc a {
    font-size: 13.5px; font-weight: 600; color: #3A4460; text-decoration: none;
    padding: 7px 12px; border-left: 2px solid #D5DBE6;
}
.guide-toc a:hover { color: #1B3A8C; border-left-color: #1B3A8C; }
.guide-body {
    max-width: 780px; background: #FFFFFF; border: 1px solid #D5DBE6; border-radius: 10px;
    padding: 36px 44px 40px; font-size: 15px; line-height: 1.75; color: #121A33;
}
.guide-body h1 { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: -0.01em; }
.guide-body .lead { margin: 8px 0 0; font-size: 16px; color: #3A4460; }
.guide-body section { margin-top: 30px; padding-top: 26px; border-top: 1px solid #E8ECF2; scroll-margin-top: 80px; }
.guide-body h2 { margin: 0 0 10px; font-size: 20px; font-weight: 800; }
.guide-body p { margin: 0 0 12px; }
.guide-body .note { font-size: 13.5px; color: #5A6480; }
.guide-body ul.rules { margin: 0 0 12px; padding-left: 20px; }
.guide-body ul.rules li { margin: 4px 0; }
.guide-body .why {
    margin: 14px 0; padding: 14px 18px; scroll-margin-top: 80px;
    background: #F5F7FB; border: 1px solid #D5DBE6; border-left: 4px solid #C7D0DE; border-radius: 8px;
    transition: background-color .3s, border-color .3s;
}
.guide-body .why:target { background: #EEF2FA; border-color: #C9D3EA; border-left-color: #1B3A8C; }   /* 검색 결과 링크로 들어온 이유 */
.guide-body .why h3 { margin: 0 0 6px; font-size: 16px; font-weight: 800; }
.guide-body .why h3 span { margin-left: 6px; font-size: 12.5px; font-weight: 700; color: #5A6480; }
.guide-body .why p:last-child { margin-bottom: 0; }
.guide-body .eg {
    font-size: 13.5px; color: #3A4460; line-height: 1.65;
    background: #FFFFFF; border: 1px dashed #C7D0DE; border-radius: 6px; padding: 8px 12px;
}
.guide-table { width: 100%; border-collapse: collapse; margin: 4px 0 14px; font-size: 14px; line-height: 1.55; }
.guide-table th { text-align: left; font-size: 12.5px; color: #5A6480; background: #F5F7FB; padding: 8px 10px; border-bottom: 1px solid #D5DBE6; white-space: nowrap; }
.guide-table td { padding: 9px 10px; border-bottom: 1px solid #E8ECF2; vertical-align: top; }
.guide-table td.no { width: 32px; text-align: center; font-weight: 800; color: #1B3A8C; }
.guide-table td.mono { font-family: 'IBM Plex Mono', monospace; font-weight: 700; color: #1B3A8C; white-space: nowrap; }
.guide-table td.mono small { font-family: 'Pretendard Variable', sans-serif; font-size: 12px; font-weight: 600; color: #5A6480; }
.guide-body blockquote {
    margin: 12px 0 16px; padding: 14px 18px; font-size: 14px; line-height: 1.7; color: #3A4460;
    background: #F5F7FB; border-left: 4px solid #5A6480; border-radius: 0 6px 6px 0;
}
.guide-body blockquote cite { display: block; margin-top: 8px; font-size: 12px; font-style: normal; color: #5A6480; }
@media (prefers-reduced-motion: reduce) { .guide-body .why { transition: none; } }

/* ── 좁은 화면 ────────────────────────────────────────────────── */
@media (max-width: 1180px) {
    .home-cols { grid-template-columns: minmax(0, 1fr); }
    .recent-shots { max-width: 560px; }
    .bhome-main { padding: 32px 28px 48px 32px; }
}
@media (max-width: 900px) {
    .scan-grid { grid-template-columns: 1fr 1fr; }
    .mini-search { margin-left: 0; }
    .thumb-index { width: 72px; }
    .thumb-index a { padding-left: 10px; font-size: 10px; }
    .guide { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 20px 16px 60px; }
    .guide-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px 0; }
    .guide-toc a { border-left: 0; border-bottom: 2px solid #D5DBE6; padding: 5px 10px; }
    .guide-body { padding: 24px 18px 28px; }
}
@media (max-width: 600px) {
    /* 폰 폭에서 상단 바가 화면 밖으로 밀리지 않게 — 위치 표시는 숨기고 버튼을 줄인다 */
    .topbar { gap: 8px; padding: 0 12px; }
    .topbar .brand { font-size: 14px; }
    .topbar .crumb { display: none; }
    .topbar .actions { gap: 5px; }
    .topbar .actions .btn { padding: 6px 8px; font-size: 12.5px; }
}
/* ── 소플 노출 체크 (2026-10-30) ──────────────────
   체크한 것만 소플(sopl.co.kr) 인사이트 메뉴에 나간다. 기본은 꺼져 있다.
   ⚠ 이 사이트에서는 체크와 상관없이 **다 보인다** — 사내에서는
     만들다 만 것도 봐야 한다. 안 나가는 줄을 흐리게 해 구분한다. */
table.reports td.soplh { text-align: center; width: 54px; }
table.reports td.soplh input { width: 16px; height: 16px; cursor: pointer; accent-color: #1B3A8C; }
table.reports td.soplh input:disabled { cursor: progress; opacity: .5; }

/* 소플에 안 나가는 줄 — 글자만 흐리게. 체크칸은 흐리면 누르기 어려워 제외한다. */
table.reports tr.is-sopl-off td:not(.soplh) { opacity: .45; }
table.reports tr.is-sopl-off td a { font-weight: 600; }