/* Pretendard (가변 폰트, 자체 호스팅 — assets/fonts/, 라이선스: SIL OFL 1.1, LICENSE.txt 동봉) */
@font-face {
    font-family: "Pretendard";
    font-weight: 45 920;
    font-style: normal;
    font-display: swap;
    src: url("/resource/kor/images/cyber_118/assets/fonts/PretendardVariable.woff2") format("woff2-variations");
}

/* ============================================================
   ROOT
============================================================ */

:root {
    --bg: #f6f7fa;
    --white: #ffffff;
    --text: #202939;
    --soft: #687386;
    --light: #9ca5b3;
    --border: #e5e8ef;
    --border-soft: #f0f2f5;

    /* KISA 공식 브랜드 컬러 */
    --kisa-main-blue: #00387f;   /* PANTONE 281 C */
    --kisa-blue: #004ea2;
    --kisa-blue-light: #6fa3d8;
    --kisa-dark-blue: #002b69;
    --kisa-green: #8fc31f;
    --kisa-dark-green: #608709;
    --kisa-green-soft: #eef8da;
    --kisa-blue-soft: #e5edf7;

    --primary: var(--kisa-blue);
    --primary-soft: var(--kisa-blue-soft);

    --pink: #ed729f;
    --pink-dark: #cf5c86;
    --pink-soft: #fff0f5;

    --blue: #6578d8;
    --blue-dark: #5267c3;
    --blue-soft: #eef1ff;

    --sidebar: 270px;

    --sidebar-background: #0f172a;
    --nav-blue: var(--kisa-blue);
    --nav-blue-light: var(--kisa-blue-light);
    --status-green: var(--kisa-green);
    --status-yellow: #f59e0b;
    --status-red: #ef4444;

    --navy: var(--kisa-dark-blue);
    --navy-dark: var(--kisa-main-blue);
    --navbar-height: 90px;
    --header-offset: var(--navbar-height);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    word-break: keep-all;
}

button { font-family: inherit; }

/* ============================================================
   TOP NAVBAR
============================================================ */

.top-navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--navbar-height);
    padding: 0 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.navbar-logo-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.navbar-logo {
    height: 34px;
    width: auto;
    display: block;
}

.navbar-logo-wrap.navbar-logo-fallback {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: var(--navy);
    display: grid;
    place-items: center;
}

.navbar-logo-wrap.navbar-logo-fallback::after {
    content: "K";
    color: #ffffff;
    font-size: 17.5px;
    font-weight: 850;
}

.navbar-title {
    color: var(--navy);
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -.3px;
}

a.navbar-title,
a.navbar-title:hover,
a.navbar-title:visited {
    color: var(--navy);
    text-decoration: none;
}

.navbar-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-meta-icon {
    width: 20px; height: 20px;
    flex: 0 0 auto;
    color: var(--soft);
}

.navbar-meta > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.navbar-meta-label {
    color: var(--soft);
    font-size: 13.5px;
    font-weight: 600;
}

.navbar-meta-value {
    color: var(--navy);
    font-size: 16px;
    font-weight: 750;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   INFO BAR
============================================================ */

.info-bar {
    flex: 0 0 auto;
    display: flex;
    gap: 10px;
}

.info-card {
    flex: 0 0 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(16,42,92,.04);
}

.info-card-icon {
    width: 22px; height: 22px;
    flex: 0 0 auto;
    color: var(--navy);
}

.info-card-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.info-card-label { color: var(--soft); font-size: 11.5px; font-weight: 700; }
.info-card-main { font-size: 15px; font-weight: 800; }
.info-card-sub { color: var(--soft); font-size: 12px; font-variant-numeric: tabular-nums; }

.info-card p {
    margin: 0;
    color: var(--soft);
    font-size: 13px;
    line-height: 1.55;
}

.info-card-notice {
    background: #fff5f6;
    border-color: #f6cdd3;
}

.info-card-notice p { color: #a94454; }

.info-highlight {
    color: var(--nav-blue);
    font-weight: 800;
}

/* 통계 기간 카드 우측 상단 장식 원 */
.info-card { position: relative; overflow: hidden; isolation: isolate; }
.info-card::after {
    content: "";
    position: absolute;
    top: -26px;
    right: -22px;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: var(--kisa-blue-soft);
    opacity: .7;
    z-index: -1;
    pointer-events: none;
}

/* ============================================================
   SIDEBAR
============================================================ */

.sidebar {
    position: fixed;
    left: 0; top: var(--header-offset); bottom: 0;
    z-index: 30;
    width: var(--sidebar);
    padding: 28px 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;

    background:
        radial-gradient(circle at top left, rgba(59,130,246,.25), transparent 33%),
        radial-gradient(circle at 80% 75%, rgba(139,92,246,.13), transparent 32%),
        var(--sidebar-background);
    color: #ffffff;
}

/* 데스크톱에서는 사이드바의 바로가기로 충분하므로 숨김 — 900px 이하에서만 표시 */
.mobile-quicknav { display: none; }

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 4px 24px;
}

.brand-logo {
    flex: 0 0 auto;
    width: 50px; height: 50px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #60a5fa 0%, #2563eb 52%, #7c3aed 100%);
    color: #ffffff;
    font-size: 25px;
    font-weight: 900;
    box-shadow: 0 14px 34px rgba(37,99,235,.38);
}

.brand-subtitle {
    margin: 0 0 4px;
    color: var(--nav-blue-light);
    font-size: 12.5px;
    font-weight: 900;
    letter-spacing: 1.35px;
}

.brand h1 {
    margin: 0;
    color: #ffffff;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.25;
}

.sidebar-navigation {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    flex: 1;
}

.navigation-button {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 13px 15px;
    border-radius: 13px;
    background: transparent;
    color: #cbd5e1;
    text-align: left;
    font-size: 15px;
    font-weight: 750;
    cursor: pointer;
    border: none;
    transition: background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.navigation-button:hover {
    background: rgba(255,255,255,.075);
    color: #ffffff;
    transform: translateX(3px);
}

.navigation-button.active {
    background: linear-gradient(135deg, rgba(59,130,246,.98), rgba(37,99,235,.92));
    color: #ffffff;
    box-shadow: 0 11px 27px rgba(37,99,235,.28);
}

.navigation-button.active::before {
    content: "";
    position: absolute;
    top: 50%; left: 7px;
    width: 3px; height: 21px;
    border-radius: 999px;
    background: #ffffff;
    transform: translateY(-50%);
}

.navigation-icon {
    flex: 0 0 auto;
    width: 24px; height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--nav-blue-light);
    font-size: 17.5px;
    font-weight: 900;
    transition: color .2s ease, transform .2s ease;
}

.navigation-button:hover .navigation-icon,
.navigation-button.active .navigation-icon {
    color: #ffffff;
    transform: scale(1.07);
}

.data-status-box {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding: 16px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 15px;
    background: rgba(255,255,255,.05);
}

.status-dot {
    flex: 0 0 auto;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--status-yellow);
    box-shadow: 0 0 0 5px rgba(245,158,11,.13);
}

.status-dot.loading { animation: status-pulse 1.35s ease-in-out infinite; }
.status-dot.connected { background: var(--status-green); box-shadow: 0 0 0 5px rgba(16,185,129,.13); }
.status-dot.error { background: var(--status-red); box-shadow: 0 0 0 5px rgba(239,68,68,.13); }

@keyframes status-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .4; }
}

.data-status-box strong { display: block; margin-bottom: 2px; color: #ffffff; font-size: 14.5px; }
.data-status-box p { margin: 0; color: #94a3b8; font-size: 14px; }

/* ----- 좌측 정보 패널 ----- */
/* 소개 문구 카드: 앞 문장은 크게, 핵심 단어는 형광펜처럼 강조 */
.side-lead {
    position: relative;
    margin-top: 2px;
    padding: 20px 18px 18px;
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(111,163,216,.16), rgba(111,163,216,.04));
    border: 1px solid rgba(255,255,255,.08);
    overflow: hidden;
}
.side-lead-quote {
    position: absolute;
    top: -14px;
    right: 10px;
    color: rgba(255,255,255,.08);
    font-size: 96px;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
}
.side-lead-hook {
    position: relative;
    margin: 0 0 12px;
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.5;
    letter-spacing: -.3px;
    word-break: keep-all;
}
.side-lead-hook b { color: #b9dcff; font-weight: 850; }
.side-lead-body {
    position: relative;
    margin: 0;
    color: #cbd5e1;
    font-size: 13.5px;
    line-height: 1.85;
    word-break: keep-all;
}
.side-lead-body em {
    font-style: normal;
    font-weight: 750;
    color: #ffffff;
    white-space: nowrap;
    background: linear-gradient(transparent 62%, rgba(143,195,31,.45) 62%);
    padding: 0 1px;
}

.side-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 2px;
    border-top: 1px solid rgba(255,255,255,.09);
    border-bottom: 1px solid rgba(255,255,255,.09);
}
.side-label {
    color: #6fa3d8;
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: 1.1px;
}
.side-value { color: #ffffff; font-size: 15.5px; font-weight: 800; }
.side-sub { color: #94a3b8; font-size: 11.5px; font-variant-numeric: tabular-nums; }

/* ============================================================
   MAIN
============================================================ */

.main {
    margin-left: var(--sidebar);
    padding: 38px 39px 70px;
    margin-top: var(--header-offset);
}

/* ============================================================
   HEADER
============================================================ */

.page-header-row {
    margin-bottom: 25px;
    padding: 22px 26px;
    border-radius: 16px;
    background: var(--kisa-main-blue);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.page-header {
    flex: 1 1 320px;
    scroll-margin-top: 25px;
    min-width: 0;
}

.eyebrow, .section-label {
    color: var(--primary);
    font-size: 11.5px;
    font-weight: 850;
    letter-spacing: 1.5px;
}

.page-header h2 {
    position: relative;
    margin: 0;
    padding-left: 15px;
    color: #ffffff;
    font-size: 33px;
    line-height: 1.2;
    font-weight: 820;
    letter-spacing: -.8px;
}

.page-header h2::before {
    content: "";
    position: absolute;
    left: 0; top: 3px; bottom: 3px;
    width: 5px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--kisa-green), var(--kisa-dark-green));
}

.page-header p {
    margin: 9px 0 0;
    color: rgba(255,255,255,.72);
    font-size: 13.5px;
    line-height: 1.65;
    white-space: nowrap;
}

.usage-note {
    margin: -8px 0 20px;
    color: var(--soft);
    font-size: 13px;
    line-height: 1.6;
}

/* ============================================================
   SUMMARY
============================================================ */

.summary-grid {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(200px, 260px);
    gap: 10px;
}

.summary-card {
    position: relative;
    min-width: 0;
    min-height: 108px;
    padding: 17px 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.summary-label { margin-bottom: 11px; color: var(--soft); font-size: 11.5px; font-weight: 700; }
.summary-period { margin-bottom: 8px; font-size: 15px; font-weight: 780; }

.summary-card small { margin-top: auto; color: var(--light); font-size: 10.5px; }

/* ============================================================
   CHARTS GRID (좌우 배치)
============================================================ */

.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    gap: 15px;
}

/* ============================================================
   CARD
============================================================ */

.dashboard-card {
    margin-bottom: 15px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 5px 26px rgba(32,42,65,.025);
    overflow: hidden;
    scroll-margin-top: calc(var(--navbar-height) + 16px);
    display: flex;
    flex-direction: column;
}
/* 두 카드가 같은 높이일 때 목록 영역이 남는 공간을 흡수 */
.dashboard-card .top10-list { flex: 1 0 auto; }

.card-header {
    height: 118px;
    padding: 16px 22px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.card-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 810;
    letter-spacing: -.25px;
    display: flex;
    align-items: center;
    gap: 10px;
}
/* 섹션 제목 앞 아이콘 배지 — 제목임을 분명히 보이도록 */
.section-icon {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--kisa-main-blue);
    color: #ffffff;
    box-shadow: 0 3px 8px rgba(0, 56, 127, .18);
}
.section-icon svg { width: 19px; height: 19px; }
.card-header h2 { font-size: 21px; color: var(--kisa-dark-blue); }
/* 상담 유형 / 예방 및 조치방법 제목: 카드 왼쪽 끝~오른쪽 끝까지 이어지는 연한 배경 띠 */
#typeSection .card-header h2,
#guide .card-header h2 {
    margin: 0 -22px;
    padding: 12px 22px;
    border-radius: 0;
    background: var(--kisa-blue-soft);
}
#typeSection .card-header h2 .section-icon,
#guide .card-header h2 .section-icon { width: 32px; height: 32px; }
#typeSection .card-header p { margin-top: 12px; }
#typeSection .card-header, #guide .card-header { height: auto; min-height: 140px; padding-top: 0; justify-content: flex-start; }
#typeSection .card-header h2, #guide .card-header h2 { padding-top: 16px; padding-bottom: 16px; }
/* 예방 및 조치방법 카드는 머리에 제목 띠만 있으므로 띠 높이에 맞춤 (빈 흰 공간 없이) */
#typeSection .card-header { min-height: 0; padding-bottom: 0; border-bottom: 0; }
#guide .card-header { min-height: 0; padding-bottom: 0; border-bottom: 0; }

.card-header p { margin: 7px 0 0; color: var(--text); font-size: 13px; line-height: 1.65; }

/* 상담 유형 카드: 클릭하면 안내가 뜬다는 것을 놓치지 않도록 살짝 붉은색으로 강조 */
.top10-click-hint { color: #b3453e; font-weight: 700; }

.header-badge {
    padding: 6px 9px;
    border-radius: 7px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 10.5px;
    font-weight: 850;
}

/* 카드 우측 상단 장식 원 (상담 유형 / 예방 및 조치방법) */
.dashboard-card { position: relative; isolation: isolate; }
.dashboard-card::after {
    content: "";
    position: absolute;
    top: -50px;
    right: -50px;
    width: 138px;
    height: 138px;
    border-radius: 50%;
    background: var(--kisa-blue-soft);
    opacity: .55;
    z-index: -1;
    pointer-events: none;
}
.dashboard-card::before {
    content: "";
    position: absolute;
    top: 16px;
    right: -40px;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    border: 1.5px solid #d9e5f5;
    z-index: -1;
    pointer-events: none;
}

/* ============================================================
   상담 유형 목록
============================================================ */

.top10-list { padding: 4px 21px 12px; }

.top10-row {
    min-height: 60px;
    padding-left: 10px;
    border-bottom: 1px solid var(--border-soft);
    display: grid;
    grid-template-columns: 30px minmax(120px, 1fr);
    align-items: center;
    gap: 10px;
}

.top10-row:last-child { border-bottom: none; }

.rank { color: #aab1bc; font-size: 12.5px; font-weight: 850; }

.top-category { min-width: 0; }

.category-name { display: flex; align-items: center; gap: 8px; }
.category-name strong {
    overflow: hidden;
    font-size: 16px;
    font-weight: 750;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.cat-swatch { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* 상담 유형 목록: 순위 칸 없이 유형명만, 분야(개인정보 / 해킹·바이러스)별로 묶어 표시 */
.top10-row.type-row { min-height: 50px; grid-template-columns: minmax(0, 1fr); }
.type-row .category-name strong { font-size: 15px; white-space: normal; }

/* 분야 구분 라벨(개인정보 / 해킹·바이러스 / 스팸) — 분야마다 다른 색 */
.type-group-label {
    display: flex;
    align-items: center;
    width: 100%;
    border: none;
    font-family: inherit;
    text-align: left;
    cursor: default;
    margin: 18px 0 6px;
    padding: 8px 12px;
    border-radius: 8px;
    border-left: 4px solid #c97a98;
    background: #f8edf2;
    color: #94506d;
    font-size: 15px;
    font-weight: 850;
    letter-spacing: -.1px;
}
.type-group-label.is-hacking {
    border-left-color: var(--kisa-green);
    background: var(--kisa-green-soft);
    color: var(--kisa-dark-green);
}
.type-group-label.is-spam {
    border-left-color: #ef8a00;
    background: #fdf0df;
    color: #a65800;
}
.type-group:first-child .type-group-label { margin-top: 8px; }
.type-group-body .top10-row:last-child { border-bottom: none; }

/* 분야 라벨 화살표: 모바일에서만 표시 (PC는 항상 펼침) */
.type-group-chevron {
    display: none;
    flex: 0 0 auto;
    margin-left: auto;
    margin-right: 4px;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .15s ease;
}
.type-group.open .type-group-chevron { transform: rotate(-135deg); }

@media (max-width: 960px) {
    .type-group-label { cursor: pointer; margin: 8px 0 4px; padding: 12px; }
    .type-group:first-child .type-group-label { margin-top: 4px; }
    .type-group-chevron { display: inline-block; }
    .type-group:not(.open) .type-group-body { display: none; }
}

/* 세부유형이 있는 유형: 오른쪽 화살표(펼치면 아래로 회전) */
.type-chevron {
    flex: 0 0 auto;
    margin-left: auto;
    margin-right: 12px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #9ca5b3;
    border-bottom: 2px solid #9ca5b3;
    transform: rotate(-45deg);
    transition: transform .15s ease;
}
.type-row.expanded .type-chevron { transform: rotate(45deg); }

/* 세부유형 하위 목록 */
.subtype-list {
    margin: 2px 0 8px 28px;
    padding-left: 12px;
    border-left: 2px solid var(--border);
}
.subtype-item {
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .12s ease;
}
.subtype-item:hover { background: #fafbfe; }
.subtype-item.selected { background: #eceef2; }
.subtype-head { display: block; font-size: 15px; font-weight: 650; line-height: 1.5; }
.subtype-item.selected .subtype-head { color: #1f2937; font-weight: 750; }

/* 하위 목록을 펼친 유형은 선택 배경 대신 글씨만 강조 (선택 표시는 세부유형 쪽에) */
.top10-row.type-row.has-sub.selected { background: transparent; box-shadow: none; }
.top10-row.type-row.has-sub.selected .category-name strong { color: #1f2937; }

/* 클릭 가능한 목록 행 — 선택된 유형은 안내 패널에 표시됨 */
.top10-row.clickable { cursor: pointer; border-radius: 10px; transition: background .12s ease; }
.top10-row.clickable:hover { background: #fafbfe; }
.top10-row.clickable.selected {
    background: #eceef2;
    box-shadow: inset 3px 0 0 #8a929e;
}

/* ============================================================
   CONSULTATION GUIDE (인라인 안내 패널)
============================================================ */

.guide-panel {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    padding: 20px 22px;
}

.guide-placeholder {
    margin: auto 0;
    padding: 30px 10px;
    color: var(--light);
    font-size: 13px;
    text-align: center;
}

/* 예방/조치방법과 한 박스에 있지만 구분되어 보이도록 위쪽에 경계선 + 소제목 */
.guide-subsection {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.guide-subsection-title {
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-size: 20px;
    font-weight: 810;
    letter-spacing: -.25px;
}
/* "관련 법령" 제목: 상담 유형·예방 및 조치방법 제목과 같은 연한 파랑 띠 + 아이콘 */
.guide-subsection-title {
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--kisa-blue-soft);
    color: var(--kisa-dark-blue);
}
/* 카드 왼쪽 끝~오른쪽 끝까지 이어지는 띠 (.guide-panel 좌우 여백 22px만큼 확장) */
.guide-subsection { border-top: 0; padding-top: 0; }
.guide-subsection-title { margin-left: -22px; margin-right: -22px; padding: 14px 22px; border-radius: 0; }
.guide-subsection-title .section-icon { width: 32px; height: 32px; }

.consultation-guide-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.consultation-guide-section {
}

/* 목록 기본 불릿(•) 제거 — 텍스트가 좌측에서 바로 시작
   (.guide-panel 기준으로 적용 — "예방 및 조치방법"은 박스 없이 카드에 바로 들어있고,
   "관련법령/시행령"은 .consultation-guide-section 박스 안에 들어있어 공통 조상이 .guide-panel) */
.guide-panel ul { margin: 0; padding-left: 0; list-style: none; }
.guide-panel li {
    list-style: none;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 13.5px;
    line-height: 1.75;
    word-break: keep-all;       /* 한글이 음절 단위로 잘려 줄바꿈되는 것 방지 */
    overflow-wrap: break-word;  /* 긴 URL 등은 필요할 때 줄바꿈 허용 */
}
.guide-panel li:last-child { margin-bottom: 0; }

/* "▶ ..." 소제목 항목 */
.guide-panel li.guide-lead {
    margin-bottom: 10px;
}

/* 서로 다른 사례를 나누는 구분 라벨 (색칠된 네모) */
.guide-panel li.guide-case {
    margin-top: 16px;
    margin-bottom: 10px;
}
.guide-panel li.guide-case:first-child { margin-top: 0; }

.guide-panel .guide-case-label {
    display: inline-block;
    padding: 6px 13px;
    border-radius: 8px;
    background: var(--kisa-dark-green);
    color: #ffffff;
    font-size: 15px;
    font-weight: 750;
    line-height: 1.4;
}

/* 소제목 항목: "▶" 글자 없이 첫 줄만 굵게 강조 */
.guide-panel .guide-head {
    display: block;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.5;
}
.guide-panel .guide-detail {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.75;
}

/* 일반 번호 항목: 번호(1., 2. …)를 그대로 살려 좌측 정렬 */
.guide-panel li.guide-num {
    margin-left: 0;
}

/* ①② 항목: 초록 번호 동그라미 + 내용 (예: 스팸 신고 방법) */
.guide-panel li.guide-step {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;
    gap: 10px;
}
.guide-panel li.guide-step .sg-num { margin-top: 3px; }  /* 첫 줄(13.5px × 1.75 ≈ 24px)의 가운데 */

/* "※ ..." 참고 문구 */
.guide-panel li.guide-note {
    margin-top: 10px;
    color: var(--text);
    font-size: 13px;
}

.guide-section-tag {
    display: block;
    margin: 0 0 10px;
    color: var(--text);
    font-size: 17px;  /* 예방 안내 제목(.sg-title)과 같은 크기 */
    font-weight: 800;
    letter-spacing: .2px;
}

/* "예방 및 조치방법" 카드: 법령 안내와 분리된 독립 박스라 카드 헤더 밑줄만 초록색 강조 (제목 글자는 검정 유지) */
.guide-prevention-card .card-header { border-bottom-color: #cfe6a3; }

/* 조문 하나하나(법령·벌칙 모두)를 같은 간격으로: 조가 시작될 때마다 위에 같은 여백 */
.law-article + .law-article { margin-top: 18px; }

/* 관련법령/시행령: 항상 펼친 상태로 표시 */
.law-list { display: flex; flex-direction: column; gap: 8px; }

.law-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #ffffff;
    overflow: hidden; /* law-summary 헤더바가 둥근 모서리 밖으로 안 튀어나오게 */
}

/* 세부유형 제목 줄(항목이 여러 개일 때만 표시): 본문과 다른 색의 "헤더바"로 구분 */
.law-summary {
    padding: 10px 13px;
    background: var(--border-soft);
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    word-break: keep-all;
}

.law-body {
    margin: 0;
    padding: 12px 13px 13px;
    background: #ffffff;
    color: var(--text);
    font-size: 14.5px;
    font-weight: 400;
    line-height: 1.6;
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* 법령 본문·안내 소제목에서 "==...==" 로 표시한 부분 — 형광펜(노란 하이라이트) 효과 */
.law-body .law-highlight,
.guide-panel .law-highlight {
    background: #fff1a6;
    padding: 1px 3px;
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* 조 제목("제OO조(...)")을 눈에 띄게 */
.law-body .law-article-title {
    display: block;
    margin-bottom: 8px;
    color: var(--kisa-main-blue);
    font-size: 15px;
    font-weight: 800;
}
/* 한 항목 안에 여러 조가 이어지는 경우(예: 제29조 다음 제30조) 새 조 제목은 위쪽 간격을 띄워 구분 */
.law-body .law-article-title-next {
    margin-top: 0;
}

/* "1. 2. 3." 호 항목: 항(①②③)보다 한 단계 더 안쪽으로 들여쓰고, 호끼리는 촘촘하게 */
.law-body .law-line {
    display: block;
    margin: 0;
    padding-left: 3em;
    text-indent: -1.4em;
    font-weight: 400;
}
/* "①②③" 항 항목: 굵게 대신 글씨 크기를 살짝 키우고, 호보다 바깥쪽(왼쪽)에 정렬 + 새 항 시작 시 위쪽 간격만 넉넉하게 */
.law-body .law-line-para {
    margin-top: 0;
    margin-bottom: 1px;
    padding-left: 1.6em;
    text-indent: -1.6em;
    font-size: 15.5px;
}
/* 조 제목 바로 다음 첫 항은 위쪽 간격 없이 붙임 */
.law-body .law-line-first { margin-top: 0; }

/* "가. 나. 다." 목 항목: 호(1.2.3.)보다 한 단계 더 안쪽으로 들여쓰기 */
.law-body .law-line-sub {
    padding-left: 4.4em;
    text-indent: -1.4em;
}


/* ============================================================
   새 안내 형식 (script.js renderStructuredGuide)
   - 4개 섹션 모두 같은 모양의 박스 + 같은 모양의 소제목(검정 네모 + 17px 굵게)
   - 지금은 4개 모두 흰 배경 + 회색 테두리 (섹션별로 바꾸려면 --sg-bg·--sg-bd만 지정)
============================================================ */
.sg { display: flex; flex-direction: column; gap: 28px; }
.sg-item { display: flex; flex-direction: column; gap: 14px; }
.sg-item + .sg-item { padding-top: 24px; border-top: 1px solid var(--border); }

.sg-title {
    margin: 0 0 2px;
    color: var(--kisa-dark-blue);
    font-size: 17px;  /* 소제목(.sg-label)과 같은 크기 */
    font-weight: 800;
    line-height: 1.4;
    letter-spacing: -.2px;
    word-break: keep-all;
}

/* 섹션 박스 공통 */
.sg-sec {
    --sg-bg: #ffffff;
    --sg-bd: var(--border);
   
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid var(--sg-bd);
    background: var(--sg-bg);
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* 소제목 공통: 검정 네모 + 글자 */
.sg-label {
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.4;
}
.sg-label::before {
    /* 상담 유형 목록의 네모(.cat-swatch)와 같은 모양, 전부 검정 */
    content: "";
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--text);
}

.sg-text {
    margin: 0;
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.75;
}
.sg-text + .sg-text { margin-top: 4px; }
/* "(사업자)", "(개인)"처럼 대상을 나누는 줄: 굵게, 앞 문단과 간격을 둠 */
.sg-text.sg-audience { font-weight: 750; }
* + .sg-text.sg-audience { margin-top: 14px; }
.sg a { color: var(--kisa-blue); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* 섹션별 색·아이콘 */
.sg-case    { --sg-bg: #ffffff;   --sg-bd: var(--border); }
.sg-check   { --sg-bg: #ffffff;   --sg-bd: var(--border); }
.sg-steps   { --sg-bg: #ffffff;   --sg-bd: var(--border); }
.sg-contact { --sg-bg: #ffffff;   --sg-bd: var(--border); }

/* 이렇게 예방·대응하세요 — 번호 단계 */
.guide-panel .sg-steps-list { margin: 4px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.guide-panel .sg-steps-list li {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: start;  /* 번호 동그라미는 문장 첫 줄 옆에 */
    gap: 10px;
    margin: 0;
    font-size: 15.5px;
    line-height: 1.7;
}
.sg-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;  /* 문장 줄간격(1.7)을 물려받으면 숫자가 원 가운데서 어긋남 */
    font-variant-numeric: tabular-nums;
    margin-top: 4px;  /* 첫 줄 높이(15.5px × 1.7 ≈ 26px)의 가운데에 18px 원이 오도록 */
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--kisa-dark-green);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 800;
}

/* 해결되지 않는다면? — 문의처 */
.sg-contact-list { margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.sg-contact-row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.sg-contact-row dt {
    padding: 2px 0;
    border-radius: 6px;
    background: var(--border-soft);
    color: var(--soft);
    font-size: 12.5px;
    font-weight: 800;
    text-align: center;
}
.sg-contact-row dd { margin: 0; color: var(--text); font-size: 14.5px; line-height: 1.65; }

/* 자유 형식 블록 (renderRichLines): ▶ 소제목, ①② 목록, ▷/- 점 목록, ※ 참고 */
.sg-sub {
    margin: 14px 0 6px;
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    line-height: 1.5;
}
.sg-sec > .sg-label + .sg-sub { margin-top: 0; }
.guide-panel .sg-list { margin: 4px 0 6px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.guide-panel .sg-li {
    display: grid;
    grid-template-columns: 1.3em minmax(0, 1fr);
    margin: 0;
    color: var(--text);
    font-size: 14.5px;
    line-height: 1.65;
}
.guide-panel .sg-li.is-sub { padding-left: 1.3em; color: #3d4757; }
.sg-mk { color: var(--soft); }
.sg-note {
    margin: 6px 0 0;
    color: var(--soft);
    font-size: 13.5px;
    line-height: 1.6;
}

/* ============================================================
   COMMON
============================================================ */

.hidden { display: none !important; }

.error-state {
    min-height: 160px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: var(--light);
    font-size: 11.5px;
    text-align: center;
}

.error-state strong { color: var(--soft); font-size: 13.5px; }

/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 1250px) {
    :root { --sidebar: 198px; }
    .main { padding: 32px 27px 60px; }
}

@media (max-width: 960px) {
    .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .sidebar { display: none; }
    .main { width: 100%; margin-left: 0; padding: 25px 16px 50px; }
    .top10-row {
        grid-template-columns: 30px minmax(220px, 1fr);
    }
    .top-navbar { padding: 0 16px; }
    .navbar-title { font-size: 17.5px; }
    .info-bar { padding: 10px; flex-wrap: wrap; }
    .info-card { flex: 1 1 45%; }
    .page-header p { white-space: normal; }

    /* 사이드바가 숨겨지는 화면에서는 바로가기를 상단에 고정 노출 (리모컨처럼 화면에 떠 있음) */
    .mobile-quicknav {
        display: flex;
        position: sticky;
        top: var(--navbar-height);
        z-index: 90;
        gap: 8px;
        padding: 10px 16px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        background: #ffffff;
        border-bottom: 1px solid var(--border);
        box-shadow: 0 4px 10px rgba(16, 24, 40, .05);
    }
    .mobile-quicknav-link {
        flex: 0 0 auto;
        padding: 8px 14px;
        border-radius: 999px;
        background: var(--kisa-blue-soft);
        color: var(--navy);
        font-size: 12.5px;
        font-weight: 700;
        white-space: nowrap;
        text-decoration: none;
    }
    .mobile-quicknav-link:active { opacity: .8; }

    /* 유형 클릭·바로가기로 이동했을 때 섹션 제목이 고정 상단바와 바로가기 바에 가리지 않도록 */
    .dashboard-card, #lawSection { scroll-margin-top: calc(var(--navbar-height) + 66px); }
}

@media (max-width: 650px) {
    :root { --navbar-height: 76px; }
    .top10-row { grid-template-columns: 26px 1fr; }
    .navbar-meta-label { display: none; }
    .info-bar { flex-direction: column; }
    .info-card { flex: 1 1 auto; }
}


/* ============================================================
   118 챗봇상담 바로가기 — 화면 오른쪽 아래 고정 버튼
============================================================ */
.chatbot-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 90;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px 9px 12px;
    border-radius: 999px;
    background: var(--kisa-main-blue);
    color: #ffffff;
    font-size: 13.5px;
    font-weight: 800;
    letter-spacing: -.2px;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(0, 40, 100, .28);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.chatbot-fab:hover {
    background: var(--kisa-blue);
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 40, 100, .34);
}
.chatbot-fab:focus-visible { outline: 3px solid var(--kisa-green); outline-offset: 3px; }
.chatbot-fab-icon { width: 19px; height: 19px; flex: 0 0 auto; color: #ffffff; }
@media (max-width: 650px) {
    .chatbot-fab { right: 14px; bottom: 14px; padding: 8px 13px 8px 10px; font-size: 13px; gap: 6px; }
    .chatbot-fab-icon { width: 17px; height: 17px; }
}
@media print { .chatbot-fab { display: none; } }

/* 맨 위로 버튼 — 모바일에서만, 챗봇상담 버튼 바로 위 (스크롤을 조금 내리면 나타남) */
.to-top-fab { display: none; }
@media (max-width: 960px) {
    .to-top-fab {
        position: fixed;
        right: 24px;
        bottom: 74px;
        z-index: 90;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        padding: 0;
        border: 1px solid var(--border);
        border-radius: 50%;
        background: #ffffff;
        color: var(--kisa-main-blue);
        box-shadow: 0 6px 18px rgba(0, 40, 100, .18);
        cursor: pointer;
        opacity: 0;
        visibility: hidden;
        transform: translateY(8px);
        transition: opacity .2s ease, transform .2s ease, visibility .2s;
    }
    .to-top-fab.is-visible { opacity: 1; visibility: visible; transform: none; }
    .to-top-fab svg { width: 20px; height: 20px; }
    .to-top-fab:focus-visible { outline: 3px solid var(--kisa-green); outline-offset: 3px; }
}
@media (max-width: 650px) {
    .to-top-fab { right: 14px; bottom: 60px; width: 40px; height: 40px; }
}
@media print { .to-top-fab { display: none; } }

/* ============================================================
   PC: 상담 유형(왼쪽)과 예방 및 조치방법(오른쪽)을 따로 스크롤
   두 카드를 화면 높이에 맞추고, 제목·검색창은 고정한 채 목록/안내 영역만 스크롤
============================================================ */
@media (min-width: 961px) {
    .charts-grid { align-items: start; }
    .main { padding-bottom: 24px; }
    #typeSection,
    #guide {
        height: calc(100vh - var(--header-offset) - 38px - 24px);
        min-height: 480px;
        margin-bottom: 0;
    }
    #typeSection .card-header,
    #guide .card-header { flex: 0 0 auto; }
    #typeSection .top10-list,
    #guide .guide-panel {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: #c9d1dc transparent;
    }
}
@media (min-width: 961px) and (max-width: 1250px) {
    #typeSection, #guide { height: calc(100vh - var(--header-offset) - 32px - 24px); }
}

/* 챗봇상담 일시 중단 — 오른쪽 아래 '챗봇상담하기' 버튼 숨김, 맨 위로 버튼을 그 자리로 내림
   다시 운영할 때는 이 블록(아래 3줄)만 지우면 됩니다. */
.chatbot-fab { display: none !important; }
@media (max-width: 960px) { .to-top-fab { bottom: 24px; } }
@media (max-width: 650px) { .to-top-fab { bottom: 14px; } }

.guide-home-link{flex-shrink:0;color:#00387f;padding:8px;text-decoration:underline;font:13px sans-serif;}
