@charset "UTF-8";
/* ============================================================
   AI 챗봇 '민방이' — 메인 우측 컬럼
   기준: ai 챗봇 디자인문서 v1.0 (2026-07-16), 시안 15a
        + 민방이(SMARTY) 웹 적용 개발 명세서 v1.0 (2026-07-27)
   캐릭터는 인라인 SVG(include/minbangiBot.ejs) — 이미지 자산 없음
   ============================================================ */

/* ── 1. 상단 2단 레이아웃 (좌 지역선택 / 우 민방이) ───────────── */
.cdec_m0 {
    max-width: 1080px;
    margin: 0 auto 20px;
}

.cdec_m0 .cdec_m1 {
    max-width: none;
    margin: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.cdec_m0 .cdec_m1 .area-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

.cdec_m0 .cdec_m1 .area_box_wrap {
    flex: 1 1 auto;
}

/* ── 2. 카드 셸 ──────────────────────────────────────────────── */
.mb-card {
    /* 명세 3절 컬러 토큰 — 스테이지·캐릭터 전용 */
    --mb-green-900: #0c2a1c;
    --mb-green-900b: #123f2c;
    --mb-green-900c: #1a5c3e;
    --mb-green-body: #40bd8b;
    --mb-green-bodyb: #1e7a4f;
    --mb-green-bodyc: #124a30;
    --mb-mint: #7dffbe;
    --mb-visor: #0a2317;
    --mb-visorb: #133f2b;
    --mb-pupil: #0c2418;
    --mb-orange: #f5920f;
    --mb-orangeb: #ec7211;
    --mb-chat-bg: #f4f8f5;
    --mb-chat-bg2: #ebf1ed;
    /* 사이트 브랜드 토큰 — UI(CTA·포커스·사용자 말풍선)는 이쪽에 맞춘다 */
    --mb-brand: var(--lms-primary, #059669);
    --mb-brand-lt: var(--lms-primary-light, #10B981);
    --mb-brand-dk: var(--lms-primary-dark, #047857);
    --mb-accent: var(--lms-accent, #F59E0B);

    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 690px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--mb-chat-bg);
    box-shadow: var(--cdec-shadow-lg, 0 10px 30px rgba(0, 0, 0, .12));
    border: 1px solid rgba(5, 150, 105, .18);
    animation: mainFadeIn .4s ease;
}

/* ── 3. 헤더 ─────────────────────────────────────────────────── */
.mb-head {
    flex: 0 0 auto;
    padding: 16px 20px 14px;
    background: linear-gradient(165deg, var(--mb-green-900) 0%, var(--mb-green-900b) 60%, var(--mb-green-900c) 100%);
    color: #fff;
}

.mb-head-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    /* 좁은 폭에서 배지들이 겹치지 않도록 — 마지막 안전장치 */
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.mb-head-ident {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.mb-badge {
    display: inline-block;
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid rgba(125, 255, 190, .45);
    background: rgba(125, 255, 190, .1);
    color: var(--mb-mint);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.mb-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(245, 146, 15, .16);
    border: 1px solid rgba(245, 146, 15, .45);
    color: #ffd9a3;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.mb-status > i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mb-orange);
    animation: mbPulseDot 1.2s ease-in-out infinite;
}

.mb-head-tools {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.mb-nation,
.mb-reset {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 11px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .28);
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s ease, border-color .2s ease;
}

.mb-nation:hover,
.mb-reset:hover {
    background: rgba(255, 255, 255, .2);
    border-color: rgba(125, 255, 190, .6);
    color: #fff;
}

/* 새 대화 버튼은 대화 중에만 */
.mb-reset {
    display: none;
}

.mb-card.is-chatting .mb-reset {
    display: inline-flex;
}

.mb-title {
    margin: 0 0 6px;
    font-size: 21px;
    font-weight: 900;
    line-height: 1.35;
    letter-spacing: -.3px;
}

/* 대화 시작 시 헤더 축소 */
.mb-card.is-chatting .mb-title {
    display: none;
}

.mb-card.is-chatting .mb-head {
    padding: 12px 16px;
}

.mb-card.is-chatting .mb-head-top {
    margin-bottom: 0;
}

/* 미니 아바타 (대화 중에만) */
.mb-avatar {
    position: relative;
    width: 0;
    height: 40px;
    opacity: 0;
    overflow: hidden;
    border-radius: 50%;
    flex: 0 0 auto;
    pointer-events: none;
    transition: width .35s ease, opacity .35s ease;
}

.mb-card.is-chatting .mb-avatar {
    width: 40px;
    opacity: 1;
}

.mb-avatar img { width: 40px; height: 40px; object-fit: contain; }

/* ── 4. 캐릭터 스테이지 ──────────────────────────────────────── */
.mb-stage {
    position: relative;
    /* 공간이 모자라면 스테이지가 먼저 양보한다 — 입력바·고지 문구는 절대 잘리면 안 된다 */
    flex: 0 1 auto;
    height: 268px;
    overflow: hidden;
    /* 명세 §7.3(A) 인트로 상태 — 라이트 민트. radial 은 홀로그램 링이 앉을 바닥을 만든다.
       실제로 이 배경이 보이는 곳은 서브페이지 모달이다(메인은 mainRenew.css 에서 background:none 팝아웃). */
    background:
        radial-gradient(120% 70% at 50% 100%, rgba(56, 216, 133, .10) 0%, transparent 62%),
        var(--ui-chat-bg);
    border-bottom: 1px solid rgba(56, 216, 133, .16);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: height .45s cubic-bezier(.4, 0, .2, 1), opacity .3s ease;
}

.mb-card.is-chatting .mb-stage {
    height: 0;
    opacity: 0;
}

.mb-stage-chips {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.mb-sc {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    /* 라이트 스테이지 위 — 흰 칩 + 그린 텍스트로 대비 4.5:1 확보(명세 §11) */
    background: #fff;
    border: 1px solid rgba(56, 216, 133, .45);
    box-shadow: 0 2px 8px rgba(13, 31, 19, .08);
    color: var(--mb-brand-dk);
    font-size: 11px;
    font-weight: 700;
}

.mb-sc > i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--smarty-mint-500);
    animation: mbPulseDot var(--mb-think-dur) ease-in-out infinite;
}

/* ⑫ 반짝임 — 명세상 1개만 허용 */
.mb-sparkle {
    position: absolute;
    top: 26px;
    right: 30px;
    color: var(--smarty-mint-500);
    font-size: 15px;
    opacity: .7;
    animation: mbSparkleTwinkle 3.2s ease-in-out infinite;
}

/* ── 5. 캐릭터 '민방이(SMARTY)' — 3D 렌더 PNG + 벡터 표정 오버레이 ──────
   본체는 명세서 v1.0 의 3D 렌더 에셋(public/img/smarty/front.png) 한 장,
   표정 12종만 바이저 위에 SVG 로 얹는다. 마크업은 minbangiBot.ejs.
   슬롯 .mb-bot 는 스테이지/히어로/아바타/FAB 공용. */
:root {
    --smarty-body: #F4F4F4;
    --smarty-mint-100: #D1F5E0;
    --smarty-mint-300: #4FEC9B;
    --smarty-mint-500: #38D885;
    --smarty-orange: #FC7734;
    --smarty-ink: #0D1F13;
    --smarty-glow: 0 0 24px rgba(56, 216, 133, .45);
    /* 가슴 엠블럼 내부 삼각(§4.2 "블루 포인트") — 명세 §3.1 토큰표에 HEX 가 없다.
       공식 민방위 로고 청색 확정 전까지의 임시값. */
    --smarty-emblem-blue: #2B7FD4;

    /* 렌더 에셋 안에서 '두 눈을 합친 사각형'이 차지하는 자리 — .mb-bot 박스 기준 %.
       front.png(499×700)를 object-fit:contain 으로 176×222 에 넣었을 때의 실측값이다.
       ★ 에셋을 교체하면 이 6개만 다시 재면 표정·플래시 위치가 맞는다. */
    --sm-eyes-x: 29.27%;
    --sm-eyes-y: 24.96%;
    --sm-eyes-w: 42.22%;
    --sm-eyes-h: 13.86%;
    --sm-tip-x: 50.53%;
    --sm-tip-y: 3.07%;

    /* 명세 §3.2 UI 팔레트 — 챗봇 패널/스테이지 배경 */
    --ui-chat-bg: linear-gradient(180deg, #E8F8F5 0%, #FFFFFF 100%);
    /* thinking 표정 ↔ 타이핑 인디케이터 동기화 주기(§8) */
    --mb-think-dur: 1.2s;
}

.mb-bot {
    position: relative;
    width: 176px;
    height: 222px;
    flex: 0 0 auto;
}

.sm-rig {
    position: absolute;
    inset: 0;
}

/* 스택 — 팔·몸통·바이저·안테나가 한 덩어리로 기울어야 한다.
   CSS 애니메이션은 한 요소의 transform 을 하나만 쓸 수 있어 부유(.sm-rig)와 스웨이를 분리했다. */
.sm-stack {
    position: absolute;
    inset: 0;
}

/* Frames are rendered from the supplied GLB in SmartyFace.CODES order. */
.sm-poster {
    position: absolute;
    inset: 0;
    background: var(--minbang-poster, url('/characters/minbang/faces.webp?v=6')) 0 0 / 400% 100% no-repeat;
}
.mb-bot[data-expr="wink"] .sm-poster { background-position-x: 33.333333%; }
.mb-bot[data-expr="heart"] .sm-poster { background-position-x: 66.666667%; }
.mb-bot[data-expr].mb-bot--static .sm-poster { background-position-x: 0; }
.mb-bot[data-expr="happy"]:not(.mb-bot--static) .sm-poster { background-position-x: 100%; }

/* 본체 렌더 레이어 (몸통 / 좌팔 / 우팔) */
.sm-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
}

/* 그림자는 몸통에만 — 레이어마다 걸면 팔 그림자가 몸통 위에 겹쳐 보인다.
   확산 그림자이며 하드 섀도·윤곽선이 아니다(명세 §4.3). */
.sm-body {
    filter: drop-shadow(0 10px 18px rgba(13, 31, 19, .16));
}

/* 팔 — 어깨(렌더에서 실측한 관절 위치)를 축으로 돈다.
   팔은 몸통보다 뒤에 깔려 있어 회전해도 이음새가 몸통 어깨에 가려진다. */
.sm-arm--l {
    transform-origin: 25.76% 67.14%;
    animation: smartyArmL 4.6s ease-in-out infinite;
}

.sm-arm--r {
    transform-origin: 73.52% 67.14%;
    animation: smartyArmR 5.3s ease-in-out infinite;
}

/* 표정 오버레이 — 에셋의 바이저는 눈이 비어 있어 이 레이어 하나만 얹으면 된다.
   viewBox(두 눈을 합친 사각형)와 이 박스의 비율이 같아 도트는 정사각을 유지한다. */
.sm-visor {
    position: absolute;
    left: var(--sm-eyes-x);
    top: var(--sm-eyes-y);
    width: var(--sm-eyes-w);
    height: var(--sm-eyes-h);
    overflow: visible;
}

/* 픽셀 아이 — 명세 §4.2 는 #D1F5E0~#FFFFFF 발광 */
.mb-bot .sm-eye       { fill: var(--smarty-mint-100); }
.mb-bot .sm-eye-blush { fill: var(--smarty-mint-100); opacity: .75; }

/* 안테나 팁 — 렌더에 이미 그려져 있다. 이 레이어는 상태 전환 플래시(§8)만 얹는다. */
.sm-tip {
    position: absolute;
    left: var(--sm-tip-x);
    top: var(--sm-tip-y);
    width: 10%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--smarty-mint-300);
    opacity: 0;
    pointer-events: none;
}

/* 홀로그램 링 (정체성 요소, 제거 금지 §13) — 렌더 에셋에 없어 CSS 로 그린다 */
.sm-ring {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 60%;
    height: 12%;
    transform: translateX(-50%);
    border-radius: 50%;
    pointer-events: none;
    background:
        radial-gradient(closest-side, rgba(209, 245, 224, .9) 0%, rgba(56, 216, 133, .5) 44%, rgba(56, 216, 133, 0) 74%),
        radial-gradient(closest-side, rgba(56, 216, 133, .3) 0%, rgba(56, 216, 133, 0) 80%);
}

/* ── 표정 12종 전환 (명세 §5) ─────────────────────────────────
   .mb-bot[data-expr] 한 곳만 바꾸면 모든 인스턴스가 같은 표정이 된다.
   visibility 를 함께 묶어 페이드가 끝난 표정은 페인트 대상에서 빠지게 한다. */
.mb-bot .sm-face {
    opacity: 0;
    visibility: hidden;
    transition: opacity .15s linear, visibility 0s linear .15s;   /* 크로스페이드 150ms (§8) */
}

.mb-bot:not([data-expr]) .sm-face--default,
.mb-bot[data-expr="default"]    .sm-face--default,
.mb-bot[data-expr="wink"]       .sm-face--wink,
.mb-bot[data-expr="thinking"]   .sm-face--thinking,
.mb-bot[data-expr="focus"]      .sm-face--focus,
.mb-bot[data-expr="worried"]    .sm-face--worried,
.mb-bot[data-expr="displeased"] .sm-face--displeased,
.mb-bot[data-expr="shy"]        .sm-face--shy,
.mb-bot[data-expr="heart"]      .sm-face--heart,
.mb-bot[data-expr="curious"]    .sm-face--curious,
.mb-bot[data-expr="neutral"]    .sm-face--neutral,
.mb-bot[data-expr="angry"]      .sm-face--angry,
.mb-bot[data-expr="happy"]      .sm-face--happy {
    opacity: 1;
    visibility: visible;
    transition: opacity .15s linear, visibility 0s;
}

/* default 1종만 렌더한 인스턴스(FAB·히어로)는 어떤 data-expr 이 와도 default 를 유지한다 */
.mb-bot--static .sm-face--default {
    opacity: 1;
    visibility: visible;
}

/* ── 5-b. 3D 레이어 ──────────────────────────────────────────────────────
   PNG 리그가 마크업 기본값이자 로딩 포스터다. 3D 는 런타임에 canvas 를 얹고
   .is-3d 를 붙일 뿐이라, 클래스를 떼면 즉시 오늘 화면으로 돌아온다.
   .mb-bot 이 176×222 고정 박스라 전환에 리플로우가 없다(3D 명세 §15.1).
   .smarty-float 는 절대 끄지 말 것 — 캐릭터 본체 래퍼라 통째로 사라진다. */
.mb-bot .sm-3d {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity .2s linear;
    pointer-events: none;
    border: 0;
}

.mb-bot.is-3d .sm-3d {
    opacity: 1;
}

.mb-bot.is-3d .sm-poster,
.mb-bot.is-3d .sm-ring,
.mb-bot.is-3d .sm-layer,
.mb-bot.is-3d .sm-visor,
.mb-bot.is-3d .sm-tip {
    display: none;
}

/* thinking 은 타이핑 인디케이터(.mb-dots)와 같은 주기로 호흡한다(§8) */
.mb-bot[data-expr="thinking"] .sm-face--thinking {
    animation: smartyThink var(--mb-think-dur) ease-in-out infinite;
}

/* 모션: 부유 / 스웨이 / 눈동자 / 링 펄스 / 눈깜빡임 / 안테나 플래시 */
.mb-bot .smarty-float {
    animation: smartyFloat 3.2s ease-in-out infinite;
}

/* 스웨이는 부유(.smarty-float)와 다른 요소·다른 주기에 걸어야 서로 안 덮어쓴다.
   7.5s 는 3.2s 와 정수배가 아니라 두 모션이 겹치는 패턴이 잘 안 보인다. */
.mb-bot .sm-stack {
    animation: smartySway 7.5s ease-in-out infinite;
    transform-origin: center 85%;      /* 발밑을 축으로 기울인다 */
}

/* 히어로 전용 연출(비행·뱅킹·부유 템포)은 이 파일이 아니라 mainRenew.css 가 정한다.
   여기 있던 .mr-hero-stage 규칙 2개(smartyHop·smartyWave)는 거기서 더 높은 명시도로
   덮여 한 번도 적용된 적이 없는 죽은 코드였다 — 2026-08-06 모션 정리 때 키프레임까지
   함께 제거했다. 히어로는 이제 관절 동작 대신 좌우 비행으로 움직인다.
   (인사 동작의 각도값은 git 이력과 docs/smarty-3d-spec.md §8.2 에 남아 있다 —
    3D 로 넘어가면 팔에 깊이가 생겨 어색함 없이 되살릴 수 있다.) */

/* 눈동자는 표정 컨테이너가 아니라 바이저 레이어에 건다 —
   .smarty-face 의 transform 은 깜빡임(scaleY)이 이미 쓰고 있다. */
.mb-bot .sm-visor {
    animation: smartyGlance 9s ease-in-out infinite;
}

.mb-bot .sm-tip {
    animation: smartyTipIdle 2.6s ease-in-out infinite;
}

/* 호버 반응 — 마우스를 올리면 살짝 커지며 반긴다(포인터 있는 기기만) */
@media (hover: hover) and (pointer: fine) {
    .mb-bot .sm-rig {
        transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
    }

    .mb-fab:hover .sm-rig,
    .mb-stage:hover .sm-rig,
    .mr-hero-stage:hover .sm-rig {
        transform: scale(1.06) translateY(-4px);
    }
}

.mb-bot .smarty-ring {
    animation: smartyRing 2.4s ease-in-out infinite;
}

/* 깜빡임은 표정 컨테이너 전체를 눌러 12종 모두에 동일하게 먹인다.
   fill-box 는 숨은 표정까지 포함한 합집합 bbox 가 기준이 되므로 쓰지 않는다. */
.mb-bot .smarty-face {
    transform-box: view-box;
    transform-origin: 207px 86px;        /* viewBox(0 0 414 172) 중앙 — smartyFaces.GRID 와 같이 움직인다 */
    transition: transform .06s linear;   /* 60ms in + 60ms out = 슬릿 120ms (§8) */
    filter: drop-shadow(0 0 2px var(--smarty-mint-300));
}

.mb-bot.is-blink .smarty-face {
    transform: scaleY(.12);
}

/* 표정 전환 플래시 → 끝나면 대기 발광으로 복귀.
   is-expr-flash 는 다음 전환까지 붙어 있으므로 idle 을 이어 붙이지 않으면 발광이 죽는다. */
.mb-bot.is-expr-flash .smarty-antenna-tip {
    animation: smartyTipFlash .35s ease-out,
               smartyTipIdle 2.6s ease-in-out .35s infinite;
}

/* 부유 — 단순 상하 이동만 하면 인형처럼 뻣뻣하다.
   올라갈 때 살짝 늘리고 내려올 때 눌러(스쿼시&스트레치) 숨 쉬는 느낌을 준다. */
@keyframes smartyFloat {
    0%, 100% { transform: translateY(0) scale(1, 1); }
    30%      { transform: translateY(-7px) scale(.985, 1.015); }
    50%      { transform: translateY(-10px) scale(.99, 1.01); }
    75%      { transform: translateY(-3px) scale(1.012, .988); }
}

/* 몸통 기울이기 — 부유와 주기를 어긋나게 잡아야 패턴이 반복돼 보이지 않는다 */
@keyframes smartySway {
    0%, 100% { transform: rotate(0deg); }
    25%      { transform: rotate(1.5deg); }
    60%      { transform: rotate(-1.8deg); }
}

/* 팔 흔들기 — 좌우 주기를 다르게(4.6s / 5.3s) 잡아 기계처럼 동기화되지 않게 한다.
   어깨가 축이라 각도가 작아도 손끝은 크게 움직인다. */
@keyframes smartyArmL {
    0%, 100% { transform: rotate(0deg); }
    30%      { transform: rotate(-7deg); }
    65%      { transform: rotate(4deg); }
}

@keyframes smartyArmR {
    0%, 100% { transform: rotate(0deg); }
    35%      { transform: rotate(7deg); }
    70%      { transform: rotate(-4deg); }
}

/* 눈동자 두리번거리기 — 오래 보고 있어도 지루하지 않게 하는 가장 싼 연출.
   대부분의 시간은 정면이고 가끔 곁눈질한다. */
@keyframes smartyGlance {
    0%, 22%   { transform: translate(0, 0); }
    28%, 36%  { transform: translate(-7%, 0); }
    42%, 50%  { transform: translate(0, 0); }
    56%, 64%  { transform: translate(7%, -2%); }
    70%, 100% { transform: translate(0, 0); }
}

/* 안테나 팁 — 느리게 숨 쉬듯 발광(대기 중이라는 신호) */
@keyframes smartyTipIdle {
    0%, 100% { opacity: .18; transform: translate(-50%, -50%) scale(1); }
    50%      { opacity: .5;  transform: translate(-50%, -50%) scale(1.25); }
}

/* 링은 translateX(-50%) 로 가운데 정렬돼 있다 — 키프레임에서 그걸 유지해야 튀지 않는다 */
@keyframes smartyRing {
    0%, 100% { opacity: .5; transform: translateX(-50%) scale(1); }
    50%      { opacity: .9; transform: translateX(-50%) scale(1.06); }
}

@keyframes smartyThink {
    0%, 100% { opacity: 1; }
    50%      { opacity: .55; }
}

@keyframes smartyTipFlash {
    0%, 100% { opacity: 0;   transform: translate(-50%, -50%) scale(1);   filter: none; }
    35%      { opacity: .85; transform: translate(-50%, -50%) scale(1.5); filter: drop-shadow(0 0 9px var(--smarty-mint-300)); }
}

@media (prefers-reduced-motion: reduce) {
    .mb-bot .smarty-float,
    .mb-bot .smarty-ring,
    .mb-bot .smarty-antenna-tip,
    .mb-bot .sm-stack,
    .mb-bot .sm-arm,
    .mb-bot .sm-visor,
    .mb-bot .sm-tip,
    .mb-bot[data-expr="thinking"] .sm-face--thinking {
        animation: none !important;
    }

    .mb-bot .sm-rig {
        transition: none !important;
    }

    /* 표정 전환은 즉시(§8). 깜빡임은 JS 스케줄러가 아예 시작하지 않는다. */
    .mb-bot .sm-face {
        transition: none !important;
    }

    .mb-bot .smarty-face {
        transform: none !important;
        transition: none !important;
    }
}

/* ── 6. 키프레임 (UI 전용) ──────────────────────────────────
   캐릭터 모션은 §5 로 이관됐다. 구 순수-CSS 캐릭터용 키프레임 7종
   (mbBotFloat/mbHeadTurnSoft/mbBlinkEye/mbAntennaGlow/mbRingExpand/mbFloorSpin/mbBeamPulse)은
   참조처가 하나도 남지 않아 제거했다. */
@keyframes mbBubbleIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes mbInputGlow {
    0%, 100% { box-shadow: 0 0 0 rgba(5, 150, 105, 0); }
    50%      { box-shadow: 0 0 5px rgba(5, 150, 105, .55); }
}

@keyframes mbPulseDot {
    0%, 100% { opacity: .35; transform: scale(.8); }
    50%      { opacity: 1; transform: scale(1); }
}

@keyframes mbSparkleTwinkle {
    0%, 100% { opacity: .25; transform: scale(.85); }
    50%      { opacity: .9;  transform: scale(1.15); }
}

/* ── 7. 대화 영역 ────────────────────────────────────────────── */
.mb-log {
    flex: 1 1 auto;
    /* 말풍선 한 개는 늘 보여야 한다 — 카드가 좁을 때 0 으로 찌그러지는 것 방지 */
    min-height: 92px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px 16px 4px;
    background: linear-gradient(to bottom, var(--mb-chat-bg) 0%, var(--mb-chat-bg2) 100%);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mb-msg {
    display: flex;
    max-width: 100%;
}

.mb-msg--bot {
    justify-content: flex-start;
}

.mb-msg--bot::before {
    content: '';
    flex: 0 0 28px;
    height: 28px;
    margin: 6px 6px 0 0;
    background: var(--minbang-portrait, url('/characters/minbang/face.webp')) center / contain no-repeat;
}

.mb-msg--user {
    justify-content: flex-end;
}

.mb-bubble {
    max-width: 88%;
    padding: 12px 15px;
    font-size: 13.5px;
    line-height: 1.75;
    letter-spacing: -.01em;
    color: #33413c;                             /* 흰 배경 대비 10.7:1 (AAA) — 순검정보다 부드럽다 */
    word-break: break-word;
    background: #fff;
    border: 1px solid rgba(5, 150, 105, .10);   /* .14 → 테두리를 옅게 */
    border-radius: 6px 16px 16px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    animation: mbBubbleIn .6s ease both;
}

/* 한 줄이 길면 눈이 다음 줄 머리를 놓친다. 챗봇이 전폭(100%)으로 넓어져도 본문은 묶어 둔다.
   ※ ch 는 쓰지 않는다 — ch 는 '0' 글자폭(≈0.5em)이라 한글(1글자 ≈ 1em)에는 절반으로 먹는다.
     42em(13.5px 기준 567px) - 좌우 패딩 30px ≈ 한 줄 한글 40자.
     모달(.mb-modal-panel width:440px)에서는 88% 가 먼저 걸려 아무 영향이 없다. */
.mb-msg--bot .mb-bubble {
    max-width: min(calc(100% - 34px), 42em);
}

.mb-msg--user .mb-bubble {
    max-width: 75%;
    border: 0;
    background: linear-gradient(135deg, var(--mb-brand-lt) 0%, var(--mb-brand) 60%, var(--mb-brand-dk) 100%);
    color: #fff;
    border-radius: 15px 4px 15px 15px;
    box-shadow: 0 3px 10px rgba(5, 150, 105, .28);
}

/* 최초 진입 스태거 */
.mb-log > .mb-msg:first-child .mb-bubble { animation-delay: .2s; }

/* 타이핑 점 3개 */
.mb-dots {
    display: flex;
    gap: 4px;
    padding: 2px 0;
}

.mb-dots > i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--mb-brand);
    /* thinking 표정과 같은 주기 — 둘이 함께 보일 때 박자가 맞는다(§8) */
    animation: mbPulseDot var(--mb-think-dur) ease-in-out infinite;
}

.mb-dots > i:nth-child(2) { animation-delay: .2s; }
.mb-dots > i:nth-child(3) { animation-delay: .4s; }

/* 신뢰 배지 */
.mb-tag {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.5;
}

.mb-tag--official {
    background: rgba(5, 150, 105, .12);
    border: 1px solid rgba(5, 150, 105, .35);
    color: var(--mb-brand-dk);
}

.mb-tag--src {
    background: rgba(245, 158, 11, .12);
    border: 1px solid rgba(245, 158, 11, .4);
    color: #B45309;
}

/* 답변 본문 — 스트리밍 중에는 원문 줄바꿈을 그대로 보여야 한다.
   완료 후 삽입되는 서식 HTML 에는 개행 문자가 없어 pre-wrap 이 영향을 주지 않는다. */
.mb-answer {
    white-space: pre-wrap;
}

/* 줄간격 1.75 에 맞춘 문단 리듬 — 간격이 좁으면 늘어난 줄간격과 어긋나 답답해 보인다 */
.mb-p {
    margin: 0 0 6px;
}

.mb-p:last-child {
    margin-bottom: 0;
}

.mb-br {
    display: block;
    height: 6px;
}

.mb-ul {
    margin: 6px 0 8px;
    padding-left: 17px;
}

.mb-ul > li {
    margin-bottom: 4px;
}

.mb-cite {
    margin-left: 1px;
    color: var(--mb-brand);
    font-size: 10px;
    font-weight: 800;
}

/* 일정 리스트 카드 */
.mb-sched {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mb-sched-row {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border: 1px solid rgba(5, 150, 105, .14);
    border-radius: 10px;
    background: rgba(5, 150, 105, .04);
}

.mb-sched-date {
    flex: 0 0 auto;
    width: 48px;
    text-align: center;
    padding: 4px 0;
    border-radius: 8px;
    background: var(--mb-brand);
    color: #fff;
    line-height: 1.2;
}

.mb-sched-date > strong {
    display: block;
    font-size: 14px;
    font-weight: 900;
}

.mb-sched-date > span {
    display: block;
    font-size: 10px;
    opacity: .9;
}

.mb-sched-info {
    min-width: 0;
}

.mb-sched-info > p {
    margin: 0;
}

/* ① 사람이 먼저 찾는 건 '어느 동'이다 — 지역을 가장 강하게 둔다 */
.mb-sched-where {
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.35;
    color: #1E293B;
}

/* ② 시간 · 장소 · 대상을 한 줄에 — 넘치면 말줄임하고 전문은 title 속성으로 남긴다.
   예전처럼 3줄로 펼치면 한 건이 세로를 다 먹어 목록이 화면을 넘어간다. */
.mb-sched-sub {
    font-size: 11.5px;
    line-height: 1.35;
    color: #64748B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 4번째 이후는 접어둔다 — 건수는 버튼에 명시 */
.mb-sched-row.is-more {
    display: none;
}

.mb-sched.is-open .mb-sched-row.is-more {
    display: flex;
}

.mb-sched-more {
    margin-top: 6px;
    padding: 6px 12px;
    border: 1px solid rgba(5, 150, 105, .3);
    border-radius: 999px;
    background: #fff;
    color: var(--mb-brand-dk);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.mb-sched-more:hover {
    background: rgba(5, 150, 105, .08);
}

.mb-sched-more:focus-visible {
    outline: 3px solid var(--mb-brand);
    outline-offset: 2px;
}

/* 출처 칩 */
.mb-sources {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px dashed rgba(5, 150, 105, .22);
}

.mb-src {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(5, 150, 105, .07);
    border: 1px solid rgba(5, 150, 105, .2);
    color: #475569;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

a.mb-src:hover {
    background: rgba(5, 150, 105, .14);
    color: var(--mb-brand-dk);
}

/* 답변 내 액션 버튼 (명세 7절: 1~3개) */
.mb-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.mb-act {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border: 0;
    border-radius: 10px;
    background: var(--mb-brand);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: var(--cdec-transition, all .25s ease);
}

.mb-act:hover {
    background: var(--mb-brand-dk);
    color: #fff;
    transform: translateY(-1px);
}

.mb-act--ghost {
    background: #fff;
    border: 1px solid rgba(5, 150, 105, .35);
    color: var(--mb-brand-dk);
}

.mb-act--ghost:hover {
    background: rgba(5, 150, 105, .08);
    color: var(--mb-brand-dk);
}

.mb-act:focus-visible {
    outline: 3px solid var(--mb-brand);
    outline-offset: 2px;
}

/* 피드백 */
.mb-fb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.mb-fb-label {
    font-size: 11px;
    color: #64748B;
}

.mb-fb-btn {
    padding: 3px 9px;
    border: 1px solid rgba(5, 150, 105, .25);
    border-radius: 999px;
    background: #fff;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: var(--cdec-transition, all .25s ease);
}

.mb-fb-btn:hover:not(:disabled) {
    background: rgba(5, 150, 105, .1);
    border-color: var(--mb-brand);
}

.mb-fb-btn:disabled {
    opacity: .45;
    cursor: default;
}

.mb-fb-btn:focus-visible {
    outline: 3px solid var(--mb-brand);
    outline-offset: 2px;
}

.mb-fb-note {
    font-size: 11px;
    font-weight: 700;
    color: var(--mb-brand);
}

/* ── 8. 추천 질문 칩 (2×3 그리드) ───────────────────────────── */
.mb-chips {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    padding: 12px 16px;
    background: var(--mb-chat-bg2);
}

.mb-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(5, 150, 105, .22);
    border-radius: 12px;
    background: #fff;
    color: #1E293B;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    line-height: 1.3;
    cursor: pointer;
    transition: var(--cdec-transition, all .25s ease);
    animation: mbBubbleIn .6s ease both;
}

.mb-chips .mb-chip:nth-child(1) { animation-delay: .50s; }
.mb-chips .mb-chip:nth-child(2) { animation-delay: .58s; }
.mb-chips .mb-chip:nth-child(3) { animation-delay: .66s; }
.mb-chips .mb-chip:nth-child(4) { animation-delay: .74s; }
.mb-chips .mb-chip:nth-child(5) { animation-delay: .82s; }
.mb-chips .mb-chip:nth-child(6) { animation-delay: .90s; }

.mb-chip:hover {
    border-color: var(--mb-brand);
    background: rgba(5, 150, 105, .06);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, .16);
}

.mb-chip-ico {
    font-size: 16px;
    flex: 0 0 auto;
}

.mb-chip-txt {
    min-width: 0;
    /* 한국어는 어절 단위로 끊어야 한다 — 기본값은 '안 돼/요' 처럼 낱말 중간에서 잘린다 */
    word-break: keep-all;
}

/* 대화 중: 콤팩트 가로 스크롤 (네이티브 스크롤바는 감추고 우측 페이드로 더 있음을 알린다) */
.mb-card.is-chatting .mb-chips {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 6px;
    padding: 10px 16px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 0, #000 92%, transparent 100%);
    mask-image: linear-gradient(to right, #000 0, #000 92%, transparent 100%);
}

.mb-card.is-chatting .mb-chips::-webkit-scrollbar {
    display: none;
}

.mb-card.is-chatting .mb-chip {
    flex: 0 0 auto;
    padding: 7px 11px;
    font-size: 12px;
    border-radius: 999px;
    animation: none;
}

.mb-card.is-chatting .mb-chip-ico {
    font-size: 13px;
}

/* ── 9. 입력바 ───────────────────────────────────────────────── */
.mb-form {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    padding: 0 16px 10px;
    background: var(--mb-chat-bg2);
    animation: mbBubbleIn .6s ease both;
    animation-delay: 1.0s;
}

.mb-input {
    flex: 1 1 auto;
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 1.5px solid rgba(5, 150, 105, .28);
    border-radius: 12px;
    background: #fff;
    font-size: 14px;
    color: #1E293B;
    animation: mbInputGlow 3s ease-in-out infinite;
}

.mb-input::placeholder {
    color: #94A3B8;
}

.mb-input:focus {
    outline: 3px solid var(--mb-brand);
    outline-offset: 2px;
    border-color: var(--mb-brand);
    animation: none;
}

.mb-send {
    flex: 0 0 auto;
    height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--mb-accent) 0%, #e07c0a 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 158, 11, .35);
    transition: var(--cdec-transition, all .25s ease);
}

.mb-send:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, .45);
}

.mb-send:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* ── 10. 고지 ────────────────────────────────────────────────── */
.mb-foot {
    flex: 0 0 auto;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 0 16px 12px;
    background: var(--mb-chat-bg2);
}

.mb-notice {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
    color: #64748B;
    /* 한글은 기본값이면 글자 단위로 꺾여 '개 / 인정보 입력 금지' 처럼 낱말이 갈라진다 */
    word-break: keep-all;
}

.mb-notice a {
    color: #64748B;
    text-decoration: underline;
}

/* ── 11. 포커스 링 (KWCAG) ──────────────────────────────────── */
/* 명세 §11 은 퀵리플라이 칩·전송 버튼에 2px solid #38D885 를 지정한다.
   다만 #38D885 는 흰 배경 대비 약 1.9:1 이라 2px 아웃라인 단독으로는 KWCAG 2.4.7 이 위태롭다.
   명세값을 그대로 쓰되 4px 민트 헤일로를 덧대어 가시성을 보전한다. */
.mb-chip:focus-visible,
.mb-send:focus-visible {
    outline: 2px solid var(--smarty-mint-500);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(56, 216, 133, .3);
}

.mb-nation:focus-visible,
.mb-reset:focus-visible {
    outline: 3px solid var(--mb-mint);
    outline-offset: 2px;
}

/* ── 11-b. 플로팅 버튼 · 모달 ───────────────────────────────
   외부 상담 챗봇은 기본 우하단 자리를 사용한다.
   온라인 문의는 외부 상담 챗봇 바로 위, 민방이는 그 위에 둔다.
   ─────────────────────────────────────────────────────────── */
.mb-fab-wrap {
    position: fixed;
    z-index: 100;
    right: 20px;
    bottom: calc(env(safe-area-inset-bottom) + 160px);
    display: flex;
    align-items: center;
    gap: 8px;
}

.external-chat-fab-wrap {
    position: fixed;
    z-index: 100;
    right: 20px;
    bottom: calc(env(safe-area-inset-bottom) + 20px);
}

.external-chat-fab {
    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #03a65a;
    box-shadow: 0 6px 18px rgba(0, 83, 45, .3);
    cursor: pointer;
    transition: transform .18s ease-out, box-shadow .18s ease-out;
}

.external-chat-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 83, 45, .36);
}

.external-chat-fab:focus-visible {
    outline: 3px solid #05603a;
    outline-offset: 3px;
}

.external-chat-fab svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: #fff;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.external-chat-fab circle {
    fill: #fff;
    stroke: none;
}

/* 상담 챗봇과 온라인 문의를 12px 간격으로 묶고 민방이는 그 위에 둔다. */
.online-inquiry-btn.is-stacked {
    right: 22px;
    bottom: calc(env(safe-area-inset-bottom) + 92px);
}

@media screen and (max-width: 768px) {
    .mb-fab-wrap {
        bottom: calc(env(safe-area-inset-bottom) + 142px);
    }

    .online-inquiry-btn.is-stacked {
        right: 25px;
        bottom: calc(env(safe-area-inset-bottom) + 86px);
    }

    .online-inquiry-btn.is-stacked button,
    .online-inquiry-btn.is-stacked img {
        width: 44px;
        height: 44px;
    }
}

.mb-fab-wrap {
    transition: bottom .25s ease, transform .25s ease;
}

/* ── 13. 교육 진입 · 이수증 화면 ────────────────────────────── */
.ai-service-page .ai-service-shell {
    padding: 44px 24px 0;
}

.ai-service-page .sec_box1 {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: 24px;
    max-width: 1180px;
    margin-bottom: 32px;
}

.ai-service-page .sec_box1 > .col-lg-6 {
    width: auto;
    max-width: none;
    padding: 0;
}

.ai-service-page .log {
    min-height: 690px;
    padding: 32px;
    border-top-width: 1px;
    border-radius: 16px;
    box-shadow: var(--cdec-shadow-lg, 0 10px 30px rgba(15, 23, 42, .1));
}

.ai-service-page .sec_box1 > .log {
    padding: 32px;
}

.ai-service-page .log::before {
    content: '';
    width: 44px;
    height: 4px;
    margin-bottom: 22px;
    border-radius: 999px;
    background: var(--lms-primary, #059669);
}

.ai-service-page .log_title {
    margin-bottom: 14px;
    font-size: 26px;
    line-height: 1.35;
    text-align: left;
    text-wrap: balance;
}

.ai-service-page .sec_box1_2 {
    padding-left: 0;
}

.ai-service-page .ai-service-chat .mb-card {
    width: 100%;
    min-height: 690px;
    scroll-margin-top: 24px;
}

.esu-service-page .service-eyebrow {
    margin: 0 0 7px;
    color: var(--lms-primary-dark, #047857);
    font-size: 13px;
    font-weight: 800;
}

.esu-service-page .service-form-help {
    margin: 0;
    color: var(--lms-text-muted, #64748b);
    font-size: 14px;
    line-height: 1.7;
    word-break: keep-all;
    text-wrap: pretty;
}

.esu-service-page .esu_box_wrap {
    margin-top: 24px;
    padding: 28px;
    border: 1px solid rgba(5, 150, 105, .16);
    border-radius: 16px;
    background: #f4f9f6;
}

.esu-service-page .esu_box {
    gap: 12px;
    margin-bottom: 18px;
}

.esu-service-page .esu_box_sel_wrap {
    flex: 1 1 0;
    width: auto;
    margin-right: 0;
}

.esu-service-page .esu_box_title,
.esu-service-page .pw5_box_title {
    display: block;
    margin-bottom: 8px;
    color: var(--lms-text, #1e293b);
    font-size: 15px;
    font-weight: 700;
}

.esu-service-page .esu_box_sel,
.esu-service-page .pw5_box_in {
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--lms-border, #cbd5e1);
    border-radius: 10px;
    background: #fff;
    color: var(--lms-text, #1e293b);
    font-size: 15px;
    font-weight: 500;
}

.esu-service-page .esu_box_sel:focus,
.esu-service-page .pw5_box_in:focus {
    border-color: var(--lms-primary, #059669);
    outline: 3px solid rgba(5, 150, 105, .14);
    outline-offset: 1px;
    box-shadow: none;
}

.esu-service-page .esu_btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    margin-top: 26px;
    border-radius: 10px;
    background: var(--lms-primary, #059669);
    font-size: 16px;
    font-weight: 800;
    transition: transform .18s ease-out, background .18s ease-out, box-shadow .18s ease-out;
}

.esu-service-page .esu_btn:hover {
    background: var(--lms-primary-dark, #047857);
    transform: translateY(-2px);
}

.esu-service-page .esu_btn:focus-visible {
    outline: 3px solid var(--lms-primary-dark, #047857);
    outline-offset: 3px;
}

@media screen and (max-width: 992px) {
    .ai-service-page .ai-service-shell {
        padding: 28px 18px 0;
    }

    .ai-service-page .sec_box1 {
        grid-template-columns: minmax(0, 1fr);
        max-width: 720px;
    }

    .ai-service-page .log,
    .ai-service-page .ai-service-chat .mb-card {
        min-height: 0;
    }

    .ai-service-page .ai-service-chat .mb-card {
        height: 640px;
    }
}

@media screen and (max-width: 576px) {
    .ai-service-page .ai-service-shell {
        padding: 20px 14px 0;
    }

    .ai-service-page .sec_box1 {
        gap: 18px;
        margin-bottom: 24px;
    }

    .ai-service-page .log {
        padding: 22px 18px;
    }

    .ai-service-page .sec_box1 > .log {
        padding: 22px 18px;
    }

    .ai-service-page .log::before {
        margin-bottom: 18px;
    }

    .ai-service-page .log_title {
        font-size: 23px;
    }

    .esu-service-page .esu_box_wrap {
        padding: 20px 16px;
    }

    .esu-service-page .esu_box {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .ai-service-page .ai-service-chat .mb-card {
        height: 620px;
    }
}

/* 인라인 채팅이 보이면 민방이 런처만 숨기고 별도 상담·온라인 문의는 유지한다. */
.mb-fab-wrap:is(.is-chat-visible, .is-input-active) {
    display: none;
}

/* PC의 인라인 입력바 옆에서는 상담 버튼을 바깥 여백에 맞춘다. */
@media screen and (min-width: 993px) {
    .mb-fab-wrap:is(.is-chat-visible, .is-input-active) ~ :is(.external-chat-fab-wrap, .online-inquiry-btn.is-stacked) {
        right: 0;
    }

    .mb-fab-wrap:is(.is-chat-visible, .is-input-active) ~ .online-inquiry-btn.is-stacked {
        bottom: calc(env(safe-area-inset-bottom) + 76px);
    }

    .mb-fab-wrap:is(.is-chat-visible, .is-input-active) ~ .external-chat-fab-wrap .external-chat-fab,
    .mb-fab-wrap:is(.is-chat-visible, .is-input-active) ~ .online-inquiry-btn.is-stacked button,
    .mb-fab-wrap:is(.is-chat-visible, .is-input-active) ~ .online-inquiry-btn.is-stacked img {
        width: 44px;
        height: 44px;
    }
}

.mb-fab-label {
    padding: 7px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(5, 150, 105, .25);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .12);
    color: #1E293B;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.mb-fab {
    position: relative;
    width: 60px;
    height: 60px;
    padding: 0;
    border: 2px solid rgba(125, 255, 190, .5);
    border-radius: 50%;
    background: linear-gradient(165deg, #0c2a1c 0%, #123f2c 60%, #1a5c3e 100%);
    box-shadow: 0 6px 18px rgba(0, 32, 20, .4);
    cursor: pointer;
    overflow: hidden;
    transition: var(--cdec-transition, all .25s ease);
}

.mb-fab:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0, 32, 20, .5);
}

.mb-fab:focus-visible {
    outline: 3px solid #7dffbe;
    outline-offset: 3px;
}

.mb-fab-bot {
    position: absolute;
    inset: 0;
}

.mb-fab-bot .mb-bot {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(.36) translateY(35px);
}

/* 60px 원 안에서는 링이 배경 그린과 뭉개진다 */
.mb-fab-bot .sm-ring {
    display: none;
}

/* 헤드가 원을 꽉 채우는 크롭이라 몸통을 기울이면 잘려 나간다 — 스웨이만 뺀다.
   부유·눈동자·안테나 발광은 그대로 둬서 살아 있는 느낌을 유지한다.
   팔은 크롭 밖이라 흔들어도 보이지 않으므로 같이 정지시킨다(불필요한 페인트 방지). */
.mb-fab-bot .sm-stack,
.mb-fab-bot .sm-arm {
    animation: none;
}

/* 모달 (메인 외 페이지) — 사이트의 .issues_popup 스택 규칙을 따른다 */
.mb-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.mb-modal[hidden] {
    display: none;
}

.mb-modal-panel {
    position: relative;
    z-index: 2001;
    width: 440px;
    max-width: 100%;
    height: 720px;
    max-height: 88vh;
    animation: mbBubbleIn .3s ease both;
}

.mb-modal .mb-card {
    min-height: 0;
    height: 100%;
}

/* 모달은 높이가 고정이다. 스테이지를 줄여 대화 영역과 고지 문구가 잘리지 않게 한다.
   (헤더 부제 .mb-sub 는 마크업에서 제거됐다) */
.mb-modal .mb-stage {
    height: 170px;
}

.mb-modal .mb-bot {
    transform: scale(.68);
}

@media screen and (max-height: 780px) {
    .mb-modal .mb-stage {
        height: 120px;
    }

    .mb-modal .mb-bot {
        transform: scale(.5);
    }
}

.mb-modal-close {
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 2;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .25);
    color: #1E293B;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.mb-modal-close:focus-visible {
    outline: 3px solid var(--lms-primary, #059669);
    outline-offset: 2px;
}

@media screen and (max-width: 768px) {
    .mb-fab-label {
        display: none;
    }

    .mb-fab {
        width: 54px;
        height: 54px;
    }

    .external-chat-fab {
        width: 54px;
        height: 54px;
    }

    .mb-modal-close {
        top: 4px;
        right: 4px;
    }
}

/* ── 12. 반응형 ──────────────────────────────────────────────── */
@media screen and (max-width: 992px) {
    .cdec_m0 {
        max-width: 720px;
    }

    .cdec_m0 .cdec_m1 {
        margin-bottom: 15px;
    }

    .mb-card {
        min-height: 0;
    }

    /* 명세 8절 — 모바일은 스테이지 축소 */
    .mb-stage {
        height: 150px;
    }

    /* .mb-bot 단독 transform 은 두지 않는다 — .mb-avatar/.mb-fab-bot/.mb-modal/.page-main 이
       전부 더 높은 명시도로 transform 을 재선언하므로 승산이 없다(무효 규칙). */

    .mb-log {
        max-height: 320px;
    }

    /* 칩은 2×3 그리드를 유지한다 — 세로 스크롤은 어차피 하지만,
       가로 스크롤로 밀어 넣으면 6개 중 2개만 보여 나머지의 존재를 모른다. */
    .mb-chips {
        gap: 6px;
        padding: 10px 14px;
    }

    .mb-chip {
        padding: 9px 10px;
        font-size: 12px;
    }
}

@media screen and (max-width: 768px) {
    .mb-title {
        font-size: 18px;
    }

    .mb-foot {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* 대화 중 헤더는 한 줄이다. 좁은 폭에서는 아바타·이름·새 대화만 남기고
   보조 배지(24시간 응답)와 전국일정 링크는 접는다 — 겹쳐 보이는 것보다 낫다. */
@media screen and (max-width: 560px) {
    .mb-card.is-chatting .mb-status,
    .mb-card.is-chatting .mb-nation {
        display: none;
    }

    /* 일정 부제는 데스크톱에서 '시간 · 장소 · 대상'을 한 줄에 넣고 넘치면 말줄임한다(§7).
       모바일에서는 그 한 줄이 너무 짧아 «14:00 ~ 18:00 · 호계3동 민방위…» 처럼
       정작 중요한 장소·대상이 통째로 잘린다.
       두 줄까지 허용해 되살린다 — 3줄로 펼치면 한 건이 세로를 다 먹는다는
       원래 우려는 line-clamp 2 로 막힌다. overflow:hidden 은 위에서 이미 걸려 있다. */
    .mb-sched-sub {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        word-break: keep-all;
    }
}

@media screen and (max-width: 462px) {
    .mb-head {
        padding: 14px 14px 12px;
    }

    .mb-log,
    .mb-chips,
    .mb-form,
    .mb-foot {
        padding-left: 12px;
        padding-right: 12px;
    }

    .mb-send {
        padding: 0 14px;
    }
}

/* 지역 선택 후 문의: 입력바는 고정하고 답변 영역만 스크롤한다. */
.mb-region-support {
    max-width: 1080px;
    margin: 24px auto;
}

.mb-region-support .mb-card {
    height: clamp(520px, calc(100svh - 120px), 640px);
    min-height: 0;
}

.mb-region-support .mb-log {
    min-height: 0;
    max-height: none;
}

.mb-region-support .mb-form {
    padding-top: 12px;
    animation: none;
}

@media screen and (max-width: 992px) {
    .mb-region-support {
        max-width: 720px;
    }
}

@media screen and (min-width: 993px) {
    .mb-region-support .mb-card {
        height: 480px;
    }

    .mb-region-support .mb-card:not(.is-chatting) .mb-stage {
        height: 150px;
        flex-shrink: 0;
    }

    .mb-region-support .mb-stage > .mb-bot {
        width: 112px;
        height: 142px;
    }

    .mb-region-support .mb-stage-chips {
        display: none;
    }
}

/* 교육 안내와 문의를 한 화면에서 확인한다. AI를 끈 화면에는 적용하지 않는다. */
.region-support-layout {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(0, 1.7fr);
    gap: 24px;
    max-width: 1080px;
    margin: 0 auto 24px;
}

.region-support-layout > .sec_box1,
.region-support-layout > .mb-region-support {
    min-width: 0;
    width: 100%;
    max-width: none;
    margin: 0;
}

.region-support-layout > .sec_box1 {
    display: block;
}

.region-support-layout .sec_box1 > .col-12,
.region-support-layout .log6_outer {
    height: 100%;
    padding: 0;
}

.region-support-layout .log6_box_wrap {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100%;
    max-width: none;
    margin: 0;
    padding: 28px 24px;
    background: var(--lms-card, #fff);
    box-shadow: none;
}

.region-support-layout .log6_box_wrap::before {
    background: var(--lms-primary, #059669);
}

.region-support-layout .log6_box_wrap::after,
.region-support-layout .log6_sparkle {
    display: none;
}

.region-support-layout .log6_visual {
    margin-bottom: 20px;
}

.region-support-layout .log6_icon_cal {
    width: 56px;
    height: 56px;
    animation: none;
}

.region-support-layout .log6_txt {
    font-size: 16px;
    line-height: 1.6;
    word-break: keep-all;
    text-wrap: balance;
}

.region-support-layout .log6_sub {
    margin-bottom: 20px;
    font-size: 13px;
    word-break: keep-all;
}

.region-support-layout .edu_da {
    width: 100%;
    max-width: none;
    padding: 18px 14px;
    border-width: 1px;
    background: #f2faf6;
    box-shadow: none;
    animation: none;
    overflow-wrap: anywhere;
}

.region-support-layout .log_wrap {
    min-height: 100%;
    padding: 0;
}

.region-support-layout .log5_box_wrap {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
    margin: 0;
    padding: 28px 24px;
    border: 0;
    background: transparent;
}

.region-support-layout .di_txt {
    margin: 0;
    font-size: 20px;
    line-height: 1.6;
    word-break: keep-all;
    text-wrap: balance;
}

.region-support-layout .di_btn {
    min-height: 44px;
    max-width: 100%;
}

@media screen and (max-width: 992px) {
    .region-support-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        max-width: 720px;
    }

    .region-support-layout .log6_box_wrap,
    .region-support-layout .log5_box_wrap {
        padding: 20px;
    }

    .region-support-layout .log6_visual,
    .region-support-layout .log6_txt,
    .region-support-layout .log6_sub {
        display: none;
    }

    .region-support-layout .di_txt {
        font-size: 17px;
    }
}

/* 지역 문의 카드에서는 PC에서도 민방이 런처가 입력바를 덮지 않는다. */
.mb-fab-wrap.is-region-chat:is(.is-chat-visible, .is-input-active) {
    display: none;
}

/* ── 13. 동작 줄이기 (KWCAG / 명세 8절) ─────────────────────── */
@media (prefers-reduced-motion: reduce) {

    /* 캐릭터(.mb-bot) 쪽 동작 정지는 §5 의 reduced-motion 블록이 담당한다 */
    .mb-card,
    .mb-sparkle,
    .mb-status > i,
    .mb-sc > i,
    .mb-input {
        animation: none !important;
    }

    /* 말풍선·칩·입력바는 페이드만 */
    .mb-bubble,
    .mb-chip,
    .mb-form {
        animation-name: mbFadeOnly !important;
    }

    .mb-stage {
        transition: none !important;
    }

    .mb-avatar {
        transition: none !important;
    }

    .mb-chip:hover,
    .mb-send:hover:not(:disabled) {
        transform: none;
    }
}

.mb-mobile-back { display: none; }

/* The existing conversation occupies the mobile viewport without a new page. */
.mb-mobile-dialog {
    position: fixed;
    inset: var(--mb-viewport-top, 0px) 0 auto;
    margin: 0;
    padding: 0;
    border: 0;
    width: 100%;
    max-width: none;
    height: var(--mb-viewport-height, 100dvh);
    max-height: none;
    overflow: hidden;
    background: #f4f8f5;
}
.mb-mobile-dialog::backdrop { background: #f4f8f5; }
.mb-mobile-dialog #mbCard {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100% !important;
    min-height: 0;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    animation: none;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}
.mb-mobile-dialog .mb-mobile-back {
    display: block;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #cbded2;
    border-radius: 10px;
    background: #fff;
    color: #047857;
    font-size: 13px;
    font-weight: 700;
}
.mb-mobile-dialog .mb-head { padding: 12px 16px; }
.mb-mobile-dialog .mb-head > .mb-mobile-back { margin-bottom: 8px; }
.mb-mobile-dialog .chat-heading { flex: 0 0 auto; padding: 10px 12px; gap: 10px; }
.mb-mobile-dialog .chat-heading h2 { font-size: 18px; }
.mb-mobile-dialog .chat-avatar { width: 36px; height: 36px; }
.mb-mobile-dialog .chat-avatar img { width: 34px; height: 34px; }
.mb-mobile-dialog .chat-toggle,
.mb-mobile-dialog .mb-stage { display: none; }
.mb-mobile-dialog #mbLog {
    flex: 1 1 0;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 16px 24px;
    scroll-padding-bottom: 24px;
}
.mb-mobile-dialog .chat-compose,
.mb-mobile-dialog .mb-form,
.mb-mobile-dialog .mb-foot { flex: 0 0 auto; }
.mb-mobile-dialog .chat-compose { padding: 12px 12px 8px; }
.mb-mobile-dialog .mb-form { margin: 12px 12px 0; }
.mb-mobile-dialog .mb-foot { padding: 8px 12px; }
.mb-mobile-dialog #mbInput { font-size: 16px; }
.mb-mobile-dialog #mbSend { min-height: 44px; }

@keyframes mbFadeOnly {
    from { opacity: 0; }
    to   { opacity: 1; }
}
