/* 유원 홈페이지 AI 상담 창 — 색·모서리는 홈페이지(f.css)의 변수를 그대로 쓰고, 없으면 밝은 값으로 대신한다(시안 단독 열기용). 글자 최소 12px, 누르는 곳 44px 이상. */
.ct { --ct-bg: var(--surface, #fff); --ct-bg2: var(--surface-2, #eaf9ff); --ct-bg3: var(--surface-3, #d4efff); --ct-line: var(--border, #e1e5e9); --ct-text: var(--text, #111417); --ct-mut: var(--muted, #606467);
      --ct-acc: var(--hero-b, #1273de); --ct-on-acc: #fff; --ct-acc-text: var(--accent-text, #005fa0); --ct-focus: var(--focus, #1273de); --ct-warn: var(--warn-text, #9a5200); --ct-warn-line: var(--warn-line, #e8c28f);
      font: 14px/1.55 "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif; color: var(--ct-text); }
.ct *, .ct *::before, .ct *::after { box-sizing: border-box; }
.ct svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ct button { font: inherit; color: inherit; cursor: pointer; }
.ct :focus-visible { outline: 2px solid var(--ct-focus); outline-offset: 2px; }

/* 열기 단추: 오른쪽 아래. 넓은 화면은 아이콘+글자 알약, 좁은 화면은 아이콘만 */
.ct-launch { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 60; display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 26px;
  background: var(--ct-acc); color: var(--ct-on-acc); font-weight: 700; font-size: 15px; box-shadow: 0 8px 24px rgba(11, 61, 145, .28); transition: transform .18s ease, box-shadow .18s ease; }
.ct-launch:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(11, 61, 145, .34); }
.ct-launch:active { transform: scale(.97); }
.ct-launch[aria-expanded="true"] { display: none; }

/* 창 */
.ct-win { position: fixed; right: max(20px, env(safe-area-inset-right, 0px)); bottom: max(20px, env(safe-area-inset-bottom, 0px)); z-index: 61; width: 380px; height: min(580px, calc(100dvh - 40px)); display: flex; flex-direction: column; background: var(--ct-bg); border: 1px solid var(--ct-line); border-radius: 14px; box-shadow: 0 16px 40px rgba(11, 61, 145, .22); overflow: hidden; }
.ct-win[hidden] { display: none; }
.ct-head { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 6px 0 16px; background: var(--ct-bg2); border-bottom: 1px solid var(--ct-line); }
.ct-head svg { color: var(--ct-acc-text); }
.ct-head b { flex: 1; font-size: 15px; }
.ct-x { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 10px; background: transparent; }
.ct-x:hover { background: var(--ct-bg3); }

/* 대화 영역 */
.ct-log { flex: 1; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.ct-msg { max-width: 88%; padding: 9px 12px; border-radius: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.ct-msg.ai { align-self: flex-start; background: var(--ct-bg2); border-top-left-radius: 4px; }
.ct-msg.you { align-self: flex-end; background: var(--ct-acc); color: var(--ct-on-acc); border-top-right-radius: 4px; }
.ct-note { align-self: flex-start; max-width: 92%; display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--ct-warn-line); font-size: 13px; line-height: 1.5; }
.ct-note svg { margin-top: 2px; width: 18px; height: 18px; color: var(--ct-warn); }
.ct-note.priv { align-self: stretch; max-width: none; border-color: var(--ct-line); background: var(--ct-bg2); }
.ct-note.priv svg { color: var(--ct-acc-text); }
.ct-note .btns { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.ct-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--ct-acc); background: var(--ct-bg); color: var(--ct-acc-text); font-weight: 700; text-decoration: none; }
.ct-btn:hover { background: var(--ct-bg2); }
.ct-btn.solid { background: var(--ct-acc); color: var(--ct-on-acc); }
.ct-dots { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; padding: 12px 14px; border-radius: 14px; border-top-left-radius: 4px; background: var(--ct-bg2); }
.ct-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ct-mut); animation: ctd 1.1s infinite ease-in-out; } .ct-dots i:nth-child(2) { animation-delay: .15s; } .ct-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ctd { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.ct-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 입력줄 */
.ct-priv1 { display: flex; align-items: center; gap: 6px; margin: 0 14px; padding: 6px 10px; border-radius: 8px; background: var(--ct-bg2); color: var(--ct-mut); font-size: 12px; line-height: 1.4; }
.ct-priv1 svg { width: 16px; height: 16px; color: var(--ct-acc-text); }
.ct-priv1 span { flex: 1; }
.ct-priv1 button { min-height: 32px; padding: 0 6px; border: 0; background: none; color: var(--ct-acc-text); font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.ct-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px 4px; }
.ct-compose textarea { flex: 1; min-height: 44px; max-height: 120px; resize: none; padding: 10px 12px; border: 1px solid var(--ct-line); border-radius: 12px; background: var(--ct-bg); color: var(--ct-text); font: inherit; line-height: 1.45; }
.ct-compose textarea::placeholder { color: var(--ct-mut); }
.ct-compose textarea:disabled { background: var(--ct-bg2); }
.ct-send { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: var(--ct-acc); color: var(--ct-on-acc); }
.ct-send:disabled { opacity: .4; cursor: default; }
.ct-keys { padding: 0 16px 2px; color: var(--ct-mut); font-size: 12px; }
.ct-foot { display: flex; align-items: center; gap: 6px; padding: 6px 16px 10px; border-top: 1px solid var(--ct-line); margin-top: 6px; font-size: 12px; color: var(--ct-mut); }
.ct-foot svg { width: 16px; height: 16px; }
.ct-foot a { color: var(--ct-acc-text); font-weight: 600; text-underline-offset: 2px; word-break: break-all; }

/* 좁은 화면(폰): 아래에서 올라오는 창, 거의 전체 높이. 입력칸 글자 16px(자동 확대 방지) */
@media (max-width: 640px) {
  .ct-launch { height: 56px; width: 56px; padding: 0; justify-content: center; border-radius: 50%; }
  .ct-launch .ct-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ct-win { right: 0; left: 0; bottom: 0; width: 100%; height: min(86dvh, 720px); border-radius: 16px 16px 0 0; border-left: 0; border-right: 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .ct-compose textarea { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .ct-launch, .ct-dots i { transition: none; animation: none; } .ct-launch:hover { transform: none; } }

.ct-keys { display: flex; justify-content: space-between; gap: 8px; } .ct-count { font-variant-numeric: tabular-nums; }
.ct-note .ct-btn svg { color: inherit; margin-top: 0; width: 20px; height: 20px; }

/* 구현본 추가 */
.ct-priv1[hidden], .ct-compose[hidden], .ct-keys[hidden], .ct-launch[hidden] { display: none; }
.ct-keys { display: flex; justify-content: space-between; gap: 8px; } .ct-count { font-variant-numeric: tabular-nums; }
.ct-note a, .ct-foot a { color: var(--ct-acc-text); }
.ct-priv1 svg, .ct-note svg, .ct-head svg { fill: none; }
.ct-note .ct-btn svg { color: inherit; margin-top: 0; width: 20px; height: 20px; }
/* 홈페이지 다크 모드: 밝은 파랑 바탕 + 어두운 글자(대비 7:1) */
[data-theme="dark"] .ct { --ct-acc: #5cb8ff; --ct-on-acc: #06223f; --ct-acc-text: #77c2ff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ct { --ct-acc: #5cb8ff; --ct-on-acc: #06223f; --ct-acc-text: #77c2ff; } }

/* 261018f 상담 창 수정: 안내 1개(자세히 접기) · 메일문의(틀 없는 오른쪽 링크) · 답변 속 링크 */
.ct-more { border: 0; background: none; padding: 0 2px; min-height: 28px; color: var(--ct-acc-text); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ct-priv-d { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--ct-line); font-size: 13px; line-height: 1.5; color: var(--ct-mut); }
.ct-note.plain { align-self: stretch; max-width: none; display: block; border: 0; background: none; padding: 2px 2px 0; color: var(--ct-mut); }
.ct-note.plain .ct-note-t { white-space: pre-wrap; overflow-wrap: anywhere; }
.ct-mailq { display: flex; justify-content: flex-end; margin-top: 6px; }
.ct-mailq a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 2px; color: var(--ct-acc-text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.ct-lnk { color: var(--ct-acc-text); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
.ct-msg.you .ct-lnk { color: inherit; }
.ct-foot, .ct-foot * { user-select: text; }
