/* AI 노만석 — 상담 창 (NeoLaw 디자인: 각진 형태, 먹·인주 색) */
.aic { display: flex; flex-direction: column; background: var(--paper); color: var(--ink); min-height: 0; }
.aic-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--rule); background: var(--ink); color: #fff; flex: none; }
.aic-ava { position: relative; width: 40px; height: 40px; flex: none; background: var(--side-2); overflow: hidden; }
.aic-ava img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; display: block; }
.aic-ava i { position: absolute; right: 0; bottom: 0; background: var(--seal); color: #fff; font: 700 9px/1 var(--f-sans); font-style: normal; padding: 2px 3px; letter-spacing: .04em; }
.aic-ava.sm { width: 28px; height: 28px; margin-top: 2px; }
.aic-who { min-width: 0; margin-right: auto; }
.aic-who b { display: block; font-size: 15px; letter-spacing: -.01em; }
.aic-who span { display: block; font-size: 11.5px; color: rgba(255,255,255,.66); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aic-ib { width: 34px; height: 34px; display: inline-grid; place-items: center; background: transparent; border: 1px solid rgba(255,255,255,.22); color: #fff; cursor: pointer; flex: none; }
.aic-ib:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.aic-ib svg, .aic-mic svg, .aic-send svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.aic-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; background: var(--canvas); scroll-behavior: smooth; overscroll-behavior: contain; }
.aic-msg { display: flex; gap: 8px; margin-bottom: 14px; align-items: flex-start; }
.aic-msg.me { justify-content: flex-end; }
.aic-col { min-width: 0; max-width: 88%; display: flex; flex-direction: column; gap: 8px; }
.aic-bub { background: var(--paper); border: 1px solid var(--rule); padding: 11px 14px; font-size: 14.5px; line-height: 1.72; word-break: keep-all; overflow-wrap: anywhere; }
.aic-msg.me .aic-bub { background: var(--ink); color: #fff; border-color: var(--ink); max-width: 82%; }
.aic-welcome { flex-direction: column; }
.aic-welcome .aic-bub { border-left: 3px solid var(--seal); }
.aic-bub p { margin: 0 0 .55em; } .aic-bub p:last-child { margin-bottom: 0; }
.aic-bub ul { margin: .2em 0 .6em; padding-left: 1.15em; } .aic-bub li { margin: .15em 0; }
.aic-bub b { font-weight: 700; }
.aic-mute { color: var(--ink-3); font-size: 13px; }
.aic-in { animation: aicIn .32s ease-out both; }
@keyframes aicIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.aic-ref { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 4px; margin-left: 2px; background: var(--ledger-bg); color: var(--ledger); font-size: 10.5px; font-weight: 700; vertical-align: 2px; text-decoration: none; border: 1px solid #c9d6ea; }
.aic-ref:hover { background: var(--ledger); color: #fff; text-decoration: none; }
.aic-warn { display: inline-block; font-size: 11px; padding: 0 5px; margin-left: 3px; background: var(--warn-bg); color: var(--warn); border: 1px solid #e8d6ae; vertical-align: 1px; }
.aic-src { list-style: none; margin: 0; padding: 8px 10px; background: var(--paper); border: 1px dashed var(--rule); font-size: 12.5px; }
.aic-src li { display: flex; gap: 6px; align-items: baseline; padding: 3px 0; flex-wrap: wrap; transition: background .4s; }
.aic-src li.flash { background: var(--ledger-bg); }
.aic-src-n { min-width: 17px; height: 17px; display: inline-grid; place-items: center; background: var(--ledger); color: #fff; font-size: 10.5px; font-weight: 700; }
.aic-src-t { color: var(--ink-3); font-size: 11.5px; }
.aic-src small { color: var(--ink-4); }
.aic-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.aic-chip { border: 1px solid var(--ink-2); background: var(--paper); color: var(--ink); padding: 6px 11px; font: 500 13px/1.3 var(--f-sans); cursor: pointer; text-align: left; }
.aic-chip:hover { background: var(--ink); color: #fff; }
.aic-urg { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; padding: 9px 12px; background: var(--seal-bg); border-left: 3px solid var(--seal); font-size: 13px; color: var(--seal-ink); }
.aic-urg.u2 { background: var(--warn-bg); border-left-color: var(--warn); color: #6d4c0d; }
.aic-urg span { flex: 1 1 160px; }
.aic-urg a { font-weight: 700; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.aic-handoff { margin: 4px 0 16px 36px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--ink-2); box-shadow: 4px 4px 0 rgba(24,32,46,.08); font-size: 13.5px; }
.aic-handoff > b { display: block; font-size: 14.5px; margin-bottom: 4px; }
.aic-handoff p { margin: 0 0 10px; color: var(--ink-2); }
.aic-hrow { display: flex; gap: 8px; flex-wrap: wrap; }
.aic-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--ink-2); background: var(--paper); color: var(--ink); font: 600 14px var(--f-sans); cursor: pointer; text-decoration: none; }
.aic-btn:hover { text-decoration: none; background: var(--hover); }
.aic-btn.pri { background: var(--seal); border-color: var(--seal); color: #fff; }
.aic-btn.pri:hover { background: var(--seal-ink); }
.aic-btn[disabled] { opacity: .6; cursor: progress; }
.aic-brief { border-left: 3px solid var(--rule); padding: 4px 0 4px 12px; margin: 8px 0 12px; font-size: 13px; max-height: 260px; overflow-y: auto; }
.aic-brief .t { font-weight: 700; font-size: 14px; color: var(--ink); }
.aic-brief .d { color: var(--ink); }
.aic-thinking .aic-bub { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 13px; }
.aic-dots { display: inline-flex; gap: 4px; } .aic-dots i { width: 6px; height: 6px; background: var(--seal); animation: aicDot 1.1s infinite ease-in-out; }
.aic-dots i:nth-child(2) { animation-delay: .15s; } .aic-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes aicDot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: none; } }
.aic-err { margin: 0 0 14px 36px; padding: 9px 12px; background: var(--seal-bg); color: var(--seal-ink); font-size: 13px; border: 1px solid #e6c3c5; }
.aic-form { flex: none; border-top: 1px solid var(--rule); padding: 10px 12px 8px; background: var(--paper); }
.aic-box { display: flex; gap: 6px; align-items: flex-end; border: 1px solid var(--ink-2); padding: 4px 4px 4px 12px; background: #fff; }
.aic-box:focus-within { outline: 2px solid var(--ledger); outline-offset: 1px; }
.aic-box textarea { flex: 1; border: 0; outline: 0; resize: none; font: 15px/1.55 var(--f-sans); padding: 7px 0; max-height: 160px; background: transparent; color: var(--ink); }
.aic-mic, .aic-send { width: 40px; height: 40px; display: grid; place-items: center; border: 0; cursor: pointer; flex: none; }
.aic-mic { background: transparent; color: var(--ink-3); }
.aic-mic:hover { color: var(--ink); background: var(--hover); }
.aic-mic.on { background: var(--seal); color: #fff; animation: aicRec 1.2s infinite; }
.aic-mic.wait { opacity: .5; cursor: progress; }
@keyframes aicRec { 50% { box-shadow: 0 0 0 5px rgba(164,38,44,.18); } }
.aic-send { background: var(--ink); color: #fff; }
.aic-send:disabled { opacity: .45; cursor: progress; }
.aic-note { margin: 6px 2px 0; font-size: 11px; line-height: 1.5; color: var(--ink-4); }

/* 도크: 오른쪽 아래 런처 + 창 */
.aic-dock { position: fixed; right: 20px; bottom: 20px; z-index: 90; }
.aic-launch { position: relative; display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; background: var(--ink); color: #fff; border: 0; cursor: pointer; box-shadow: 6px 6px 0 rgba(24,32,46,.18); font: 600 14px var(--f-sans); }
.aic-launch .aic-ava { width: 40px; height: 40px; }
.aic-launch small { display: block; font-weight: 400; font-size: 11px; color: rgba(255,255,255,.68); text-align: left; }
.aic-launch:hover { background: var(--ink-2); }
.aic-launch .pulse { position: absolute; left: 6px; top: 6px; width: 8px; height: 8px; background: #3ecf8e; box-shadow: 0 0 0 2px var(--ink); }
.aic-win { display: none; position: absolute; right: 0; bottom: 0; width: 420px; height: min(680px, calc(100vh - 40px)); border: 1px solid var(--ink-2); box-shadow: 8px 8px 0 rgba(24,32,46,.14); }
.aic-dock.open .aic-win { display: flex; }
.aic-dock.open .aic-launch { visibility: hidden; }
@media (max-width: 960px) { .aic-dock { bottom: calc(68px + env(safe-area-inset-bottom)); right: 12px; } .aic-launch small { display: none; } .aic-dock:not(.open) .aic-launch { display: none; } } /* 모바일은 하단 탭 'AI 상담'으로 */
@media (max-width: 700px) {
  .aic-dock.open { inset: 0; right: 0; bottom: 0; }
  .aic-dock.open .aic-win { position: fixed; inset: 0; width: auto; height: 100dvh; border: 0; box-shadow: none; }
  body.aic-open { overflow: hidden; }
}
@media print { .aic-dock { display: none; } }

/* /ai 전체 화면 */
.aic-page { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 0; border: 1px solid var(--ink-2); height: calc(100vh - 68px - 48px); min-height: 560px; margin: 24px auto; max-width: 1200px; }
.aic-page .aic { border-right: 1px solid var(--rule); }
.aic-side { padding: 22px 20px; overflow-y: auto; background: var(--paper); font-size: 13.5px; }
.aic-side h2 { font-size: 15px; margin: 0 0 10px; }
.aic-side ol, .aic-side ul { padding-left: 1.1em; margin: 0 0 18px; color: var(--ink-2); }
.aic-side li { margin: 4px 0; }
.aic-side .aic-card { border: 1px solid var(--rule); padding: 12px 14px; margin-bottom: 14px; }
@media (max-width: 960px) { .aic-page { grid-template-columns: 1fr; height: calc(100dvh - 68px - 64px); margin: 0; border: 0; } .aic-side { display: none; } }

/* 랜딩 히어로 AI 진입 */
.r-aic-cta { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 14px; border: 1px solid var(--ink-2); background: var(--paper); max-width: 560px; cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.r-aic-cta:hover { box-shadow: 4px 4px 0 rgba(24,32,46,.1); }
.r-aic-cta .aic-ava { width: 44px; height: 44px; }
.r-aic-cta b { display: block; font-size: 15.5px; }
.r-aic-cta span.s { display: block; font-size: 12.5px; color: var(--ink-3); }
.r-aic-cta .go { margin-left: auto; background: var(--seal); color: #fff; padding: 8px 12px; font-weight: 700; font-size: 13px; white-space: nowrap; }
.r-aic-ask { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; max-width: 560px; }
.r-aic-ask button { border: 1px dashed var(--ink-3); background: transparent; padding: 5px 10px; font: 13px var(--f-sans); color: var(--ink-2); cursor: pointer; }
.r-aic-ask button:hover { border-style: solid; color: var(--ink); background: var(--paper); }

/* 2단계 응답: 초안 말풍선 */
.aic-pre .aic-bub { border-style: dashed; }
.aic-verify { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 8px 10px; background: var(--canvas); color: var(--ink-3); font-size: 13px; }
.aic-cands { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.aic-cands b { font-weight: 600; color: var(--ink-2); margin-right: 2px; }
.aic-cands span { padding: 1px 7px; background: var(--ledger-bg); color: var(--ledger); }

/* 원문 대조 진행 표시 */
.aic-verify { display: block; }
.aic-vhead { display: flex; align-items: center; gap: 8px; }
.aic-vhead .aic-step { font-weight: 600; color: var(--ink-2, #333); flex: 1; min-width: 0; animation: aicFade .4s ease; }
.aic-sec { font-variant-numeric: tabular-nums; color: var(--ink-3); font-size: 12px; }
.aic-spin { width: 14px; height: 14px; border: 2px solid rgba(164,38,44,.2); border-top-color: var(--seal); border-radius: 50% !important; animation: aicSpin .8s linear infinite; flex: none; }
.aic-bar { position: relative; height: 4px; margin: 8px 0 6px; background: rgba(0,0,0,.07); overflow: hidden; border-radius: 2px; }
.aic-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--seal); transition: width .25s linear; }
.aic-bar::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); transform: translateX(-100%); animation: aicShim 1.4s infinite; }
.aic-steps { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 3px; font-size: 12px; }
.aic-steps li { position: relative; padding-left: 18px; color: var(--ink-4, #aaa); transition: color .3s; }
.aic-steps li::before { content: ''; position: absolute; left: 3px; top: 5px; width: 7px; height: 7px; border-radius: 50% !important; background: rgba(0,0,0,.15); }
.aic-steps li.on { color: var(--ink-2, #333); font-weight: 600; }
.aic-steps li.on::before { background: var(--seal); animation: aicPulse 1s infinite; }
.aic-steps li.ok { color: var(--ink-3); }
.aic-steps li.ok::before { content: '✓'; background: none; color: #2e7d32; font-size: 11px; font-weight: 700; left: 2px; top: -1px; width: auto; height: auto; }
.aic-cands span { transition: background .3s, color .3s, box-shadow .3s; }
.aic-cands span.on { background: rgba(164,38,44,.1); color: var(--seal); box-shadow: inset 0 0 0 1px rgba(164,38,44,.35); }
@keyframes aicSpin { to { transform: rotate(360deg); } }
@keyframes aicShim { to { transform: translateX(100%); } }
@keyframes aicPulse { 50% { transform: scale(1.5); opacity: .5; } }
@keyframes aicFade { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .aic-spin, .aic-bar::after, .aic-steps li.on::before, .aic-dots i { animation: none; } }

/* 판례·근거 표시: 진한 쿨톤 남색 */
.aic { --aic-navy: #1b2f52; --aic-navy-2: #2a4473; --aic-navy-bg: #e9eef7; --aic-navy-line: rgba(27,47,82,.32); }
.aic-ref { background: var(--aic-navy-bg); color: var(--aic-navy); }
.aic-ref:hover { background: var(--aic-navy); color: #fff; }
.aic-src { border-color: var(--aic-navy-line); }
.aic-src li.flash { background: var(--aic-navy-bg); }
.aic-src-n { background: var(--aic-navy); }
.aic-src a { color: var(--aic-navy); text-decoration-color: var(--aic-navy-line); }
.aic-src a:hover { color: var(--aic-navy-2); }
.aic-src-t { color: #4a5d7e; }
.aic-cands span { background: var(--aic-navy-bg); color: var(--aic-navy); }
.aic-cands span.on { background: var(--aic-navy); color: #fff; box-shadow: none; }


/* 내가 보낸 말풍선·보내기 버튼: 신뢰를 주는 남색 */
.aic-msg.me .aic-bub { background: var(--aic-navy, #1b2f52); border-color: var(--aic-navy, #1b2f52); }
.aic-send { background: var(--aic-navy, #1b2f52); }
.aic-send:hover { background: var(--aic-navy-2, #2a4473); }
.aic-box:focus-within { outline-color: var(--aic-navy-2, #2a4473); }
/* 지난 대화 */
.aic { position: relative; }
.aic-past { position: absolute; inset: 64px 10px auto 10px; max-height: calc(100% - 150px); z-index: 5; display: flex; flex-direction: column; background: var(--paper, #fff); border: 1px solid var(--aic-navy-line, rgba(27,47,82,.32)); border-radius: 14px !important; box-shadow: 0 16px 40px rgba(24,32,46,.18); overflow: hidden; animation: aicIn .18s ease; }
.aic-past-h { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--rule); }
.aic-past-h b { color: var(--aic-navy, #1b2f52); }
.aic-past-h .aic-ib { color: var(--ink-3); background: transparent; }
.aic-past-b { overflow: auto; padding: 6px; display: grid; gap: 4px; }
.aic-past-i { display: grid; gap: 2px; text-align: left; padding: 10px 12px; border: 1px solid transparent; background: transparent; border-radius: 10px !important; cursor: pointer; font: inherit; color: var(--ink); }
.aic-past-i:hover { background: var(--aic-navy-bg, #e9eef7); border-color: var(--aic-navy-line, rgba(27,47,82,.32)); }
.aic-past-i.cur { background: var(--aic-navy-bg, #e9eef7); }
.aic-past-i .t { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aic-past-i .m { font-size: 12px; color: var(--ink-3); }
.aic-past-i .m b { color: var(--aic-navy, #1b2f52); }
.aic-past-empty, .aic-past-note { margin: 10px 12px; font-size: 12.5px; color: var(--ink-3); }
.aic-newnote { margin: 4px 0 0 38px; font-size: 12px; color: var(--ink-3); }

/* 마우스를 올렸을 때(활성 표시)도 남색으로 통일 */
.aic-chip { border-color: var(--aic-navy-line, rgba(27,47,82,.32)); color: var(--aic-navy, #1b2f52); }
.aic-chip:hover, .aic-chip:focus-visible { background: var(--aic-navy, #1b2f52); border-color: var(--aic-navy, #1b2f52); color: #fff; }
.aic-btn:hover { background: var(--aic-navy-bg, #e9eef7); border-color: var(--aic-navy-line, rgba(27,47,82,.32)); color: var(--aic-navy, #1b2f52); }
.aic-mic:hover { color: var(--aic-navy, #1b2f52); background: var(--aic-navy-bg, #e9eef7); }
.aic-launch:hover { background: var(--aic-navy, #1b2f52); }
.r-aic-ask button:hover { border-color: var(--aic-navy, #1b2f52); color: var(--aic-navy, #1b2f52); background: var(--aic-navy-bg, #e9eef7); }
.aic-ib:focus-visible, .aic-chip:focus-visible, .aic-btn:focus-visible { outline: 2px solid var(--aic-navy-2, #2a4473); outline-offset: 2px; }
.r-aic-ask, .r-aic-cta { --aic-navy: #1b2f52; --aic-navy-2: #2a4473; --aic-navy-bg: #e9eef7; --aic-navy-line: rgba(27,47,82,.32); }

/* AI 상담 화면: 스크롤할 때 사이트 머리글이 대화창 위를 덮지 않도록 이 화면에서는 머리글을 고정하지 않는다 */
body:has(.aic-page) .site-h { position: relative; }

/* ══ NeoLaw 디자인 기준 복원 — 각진 형태, 먹·인주·장부 청색, 각진 그림자. 둥근 모서리·번지는 그림자·반짝임·깜빡이는 점·초록 체크 같은 장식은 쓰지 않는다 ══ */
.aic, .r-aic-ask, .r-aic-cta { --aic-navy: var(--ledger); --aic-navy-2: #1B3E6E; --aic-navy-bg: var(--ledger-bg); --aic-navy-line: rgba(36,80,140,.35); }
.aic *, .aic-launch, .aic-launch * , .aic-win, .aic-past, .aic-past * { border-radius: 0 !important; }
.aic-win { box-shadow: 8px 8px 0 rgba(24,32,46,.14) !important; }
.aic-launch { box-shadow: 6px 6px 0 rgba(24,32,46,.18) !important; }
.aic-past { box-shadow: 6px 6px 0 rgba(24,32,46,.12) !important; border-color: var(--ink-2); animation: none; }
/* 진행 표시: 동그라미 회전·반짝임·깜빡임 대신 각진 표식과 단색 막대 */
.aic-spin { width: 9px !important; height: 9px !important; border: 0 !important; background: var(--seal); animation: none !important; }
.aic-bar::after { display: none !important; }
.aic-steps li::before { width: 7px; height: 7px; background: transparent; border: 1px solid var(--ink-4); animation: none !important; }
.aic-steps li.on::before { background: var(--seal); border-color: var(--seal); animation: none !important; }
.aic-steps li.ok::before { content: ''; background: var(--ink-3); border-color: var(--ink-3); width: 7px; height: 7px; left: 3px; top: 5px; color: transparent; }
.aic-steps li.ok { color: var(--ink-3); text-decoration: none; }
.aic-dots i { animation: none !important; }
.aic-launch .pulse { animation: none; }

/* 마이크 안내 창: 상담 창(z 90) 위에, 사이트 대화 상자 모양 그대로 */
.aic-mic-modal { z-index: 10000; align-items: center; }
.aic-mic-modal .modal-box { max-width: 440px; min-height: 0; }
.aic-mic-modal .modal-b p { margin: 0 0 8px; line-height: 1.7; }
.aic-mic-x { border: 0; background: transparent; font-size: 16px; color: var(--ink-3); cursor: pointer; width: 32px; height: 32px; }
@media (max-width: 700px) { .aic-mic-modal { padding: 16px; } .aic-mic-modal .modal-box { min-height: 0; border: 1px solid var(--ink); } }
