/* 나도스터디 회원·결제·문의(acct.js) + AI 선생님(ai.js) 공용 스타일 — 색은 app.css 변수만 쓴다 */

/* ================= 회원 공통 ================= */
.ac { max-width: 560px; margin: 0 auto; }
.ac .page-h h1 { font-size: 24px; }
.ac-card { padding: 22px 22px; }
.ac-card + .ac-card { margin-top: 12px; }
.ac-center { text-align: center; }
.ac-card h2, .ac-h2 { font-size: 18px; font-weight: 800; margin: 0 0 6px; }
.ac-ico { width: 56px; height: 56px; margin: 4px auto 12px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.ac-ico svg { width: 26px; height: 26px; }
.ac-ico.ok { background: var(--ok-soft); color: var(--ok); }
.ac-ico.bad { background: var(--bad-soft); color: var(--bad); }
.ac-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.ac-btns.left { justify-content: flex-start; margin-top: 12px; }
.ac-btns .btn.lg { min-width: 130px; }
.ac-wait { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 48px 16px; color: var(--muted); font-size: 14.5px; }
.ac-spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); animation: ac-rot .8s linear infinite; display: inline-block; flex: none; }
.ac-spin.sm { width: 14px; height: 14px; }
@keyframes ac-rot { to { transform: rotate(360deg); } }
.ac-note { margin: 12px 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 14px; line-height: 1.6; }
.ac-note.ac-warn { background: var(--warn-soft); color: var(--warn); }
.ac-note a { color: var(--accent-ink); font-weight: 700; text-decoration: underline; }

/* 폼 */
.ac-form { display: flex; flex-direction: column; gap: 14px; }
.ac-f { display: flex; flex-direction: column; gap: 6px; }
.ac-l { font-size: 13.5px; font-weight: 700; color: var(--text-2); }
.ac-l em { color: var(--bad); font-style: normal; }
.ac-in {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 11px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px; /* 16px: iOS 확대 방지 */
  transition: border-color .12s, box-shadow .12s;
}
.ac-in:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.ac-ta { height: auto; min-height: 160px; padding: 12px 14px; line-height: 1.6; resize: vertical; }
.ac-help { font-size: 12.5px; color: var(--muted); }
.ac-err { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-size: 14px; font-weight: 600; }
.ac-err[hidden] { display: none; }
.ac-links { display: flex; justify-content: center; gap: 8px; font-size: 14px; color: var(--muted); }
.ac-links a { color: var(--accent-ink); font-weight: 700; }
.ac-form .btn[disabled] { opacity: .7; cursor: default; }

/* 약관 동의 */
.ac-agrees { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; background: var(--surface-2); }
.ac-agree { display: flex; align-items: flex-start; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.ac-chk { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; font-size: 14.5px; cursor: pointer; }
.ac-chk.all { padding: 12px 0; font-size: 15.5px; }
.ac-chk input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 0; }
.ac-chk .ac-req { color: var(--accent-ink); }
.ac-chk .ac-opt { color: var(--muted); }
.ac-doc { flex-basis: auto; }
.ac-doc summary { list-style: none; cursor: pointer; font-size: 13px; color: var(--muted); text-decoration: underline; padding-top: 1px; }
.ac-doc summary::-webkit-details-marker { display: none; }
.ac-doc[open] { flex-basis: 100%; }
.ac-doc[open] summary { display: none; }
.ac-doc-in { margin-top: 8px; max-height: 220px; overflow-y: auto; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); line-height: 1.65; }
.ac-doc-in p { margin: 0 0 6px; }

/* 계정 찾기 */
.ac-steps { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; }
.ac-steps li b { display: block; font-size: 15px; }
.ac-steps li span { font-size: 14px; color: var(--text-2); }
.ac-steps a { color: var(--accent-ink); font-weight: 700; }

/* 내 정보 */
.ac-prof { display: flex; align-items: center; gap: 14px; }
.ac-avatar { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 22px; font-weight: 800; color: #fff; background: radial-gradient(circle at 30% 25%, #6fe6e0, var(--brand, #2dc4c4) 55%, #139899); }
.ac-prof b { display: block; font-size: 18px; }
.ac-prof span { display: block; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.ac-course + .ac-course { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.ac-course-h { display: flex; align-items: center; gap: 12px; }
.ac-course-h .grow { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ac-course-h b { font-size: 16px; }
.ac-cico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.ac-cico svg { width: 20px; height: 20px; }
.ac-course-p { margin: 10px 0 0; font-size: 14px; color: var(--text-2); }
.ac-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--surface-2); color: var(--muted); white-space: nowrap; flex: none; }
.ac-badge.ok { background: var(--ok-soft); color: var(--ok); }
.ac-badge.wait { background: var(--warn-soft); color: var(--warn); }
.ac-menu { overflow: hidden; }
.ac-mi { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 18px; border-top: 1px solid var(--line); text-align: left; background: none; }
.ac-mi:first-child { border-top: 0; }
.ac-mi:hover { background: var(--surface-2); }
.ac-mi > svg { width: 20px; height: 20px; color: var(--accent-ink); flex: none; }
.ac-mi b { display: block; font-size: 15px; }
.ac-mi .grow span { display: block; font-size: 12.5px; color: var(--muted); }
.ac-arr { font-style: normal; color: var(--muted); font-size: 20px; line-height: 1; }
.ac-fold, .ac-card.ac-fold { padding: 0; }
.ac-fold > summary { list-style: none; cursor: pointer; padding: 16px 18px; display: flex; align-items: baseline; gap: 10px; }
.ac-fold > summary::-webkit-details-marker { display: none; }
.ac-fold > summary::after { content: '›'; margin-left: auto; color: var(--muted); transform: rotate(90deg); transition: transform .15s; }
.ac-fold[open] > summary::after { transform: rotate(-90deg); }
.ac-fold > .ac-form { padding: 4px 18px 20px; }
.ac-danger { border: 0; background: none; }
.ac-danger > summary { color: var(--muted); font-size: 13.5px; padding: 8px 4px; justify-content: center; }
.ac-danger > summary::after { display: none; }
.ac-danger > .ac-form { padding: 14px 16px 18px; border: 1px solid color-mix(in srgb, var(--bad) 30%, var(--line)); border-radius: var(--radius); background: var(--surface); }
.ac-btn-danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); height: 46px; }
.ac-btn-danger:hover { background: var(--bad-soft); }

/* 1:1 문의 */
.ac-ql { margin-top: 14px; }
.ac-list { overflow: hidden; }
.ac-li { display: flex; align-items: center; gap: 12px; padding: 15px 18px; border-top: 1px solid var(--line); }
.ac-li:first-child { border-top: 0; }
.ac-li:hover { background: var(--surface-2); }
.ac-li .grow { min-width: 0; }
.ac-li b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ac-li .small { display: block; }
.ac-qv { margin-top: 10px; }
.ac-qhead { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ac-qt { font-size: 19px; font-weight: 800; margin: 0; }
.ac-qbody { margin-top: 12px; font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
.ac-ans { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface)); }
.ac-ans-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ac-ans-h b { color: var(--accent-ink); }

/* 수강신청 · 결제 */
.ac-test { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; padding: 11px 14px; border-radius: 11px; background: var(--warn-soft); color: var(--warn); font-size: 13.5px; line-height: 1.55; border: 1px dashed color-mix(in srgb, var(--warn) 45%, transparent); }
.ac-test svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.ac-test b { margin-right: 4px; }
.ac-test.sm { display: inline-flex; margin: 12px auto 0; padding: 6px 12px; font-size: 12.5px; font-weight: 700; }
.ac-pay { padding: 0; overflow: hidden; }
.ac-pay-top { padding: 22px 22px 16px; background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 30%, var(--surface))); }
.ac-pay-top h2 { font-size: 22px; margin: 4px 0 6px; }
.ac-pay-top p { margin: 0; font-size: 14px; }
.ac-kicker { font-size: 12px; font-weight: 800; color: var(--accent-ink); letter-spacing: .02em; }
.ac-inc { list-style: none; margin: 0; padding: 8px 22px; }
.ac-inc li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ac-inc li:first-child { border-top: 0; }
.ac-inc li > svg { width: 22px; height: 22px; color: var(--accent-ink); flex: none; margin-top: 2px; }
.ac-inc b { display: block; font-size: 15px; }
.ac-inc span span, .ac-inc li > span { font-size: 13.5px; color: var(--muted); }
.ac-inc li > span b { color: var(--text); }
.ac-pay-bot { padding: 16px 22px 22px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.ac-pay-bot p { margin: 0; }
.ac-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ac-price b { font-size: 28px; font-weight: 900; letter-spacing: -0.03em; }
.ac-price span { font-size: 14px; color: var(--muted); }
.ac-have { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--ok); font-weight: 600; }
.ac-have svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.ac-result { padding-top: 30px; padding-bottom: 28px; }
.ac-done-acc { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 0; font-size: 15px; }

@media (max-width: 520px) {
  .ac-card { padding: 18px 16px; }
  .ac-pay-top, .ac-inc, .ac-pay-bot { padding-left: 16px; padding-right: 16px; }
  .ac-btns .btn.lg { flex: 1; min-width: 0; }
}

/* ================= AI 선생님 — 바텀 시트 (ai.js) ================= */
/* 뒤 화면을 어둡게 덮고, 아래 메뉴 바로 위에서 밀려 올라온다. 아래 메뉴는 시트보다 위에 둔다(가운데 AI 버튼으로 닫기). */
.aits { position: fixed; inset: 0; z-index: 101; pointer-events: none; }
.aits[hidden] { display: none; }
.aits-bg { position: absolute; inset: 0; pointer-events: auto; background: rgba(6, 22, 24, .5); opacity: 0; transition: opacity .25s ease; }
.aits.on .aits-bg { opacity: 1; }
.aits-panel {
  position: fixed; left: 0; right: 0; z-index: 1; pointer-events: auto;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  height: 72vh; height: min(72dvh, calc(100dvh - var(--tab-h) - env(safe-area-inset-bottom) - 12px));
  display: flex; flex-direction: column; overflow: hidden; outline: none;
  background: var(--bg); border: 1px solid var(--line); border-bottom: 0; border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .22);
  transform: translateY(calc(100% + var(--tab-h) + 40px));
  transition: transform .25s cubic-bezier(.2, .8, .2, 1);
}
.aits.on .aits-panel { transform: none; }
.aits-panel.dragging { transition: none; }
.aits-panel.kb { border-radius: 18px 18px 0 0; }   /* 키보드가 올라오면 ai.js 가 bottom·max-height 를 맞춘다 */
body.ait-open .tabbar { z-index: 103 !important; }
body.ait-open .tabbar .tab-ai .ai-dot { box-shadow: 0 6px 18px rgba(0, 0, 0, .2), 0 0 0 4px var(--brand), 0 0 0 7px rgba(255, 255, 255, .55) !important; }

/* 머리: 손잡이 + 제목 (여기를 아래로 끌면 닫힘) */
.aits-grab { flex: none; padding-top: 8px; background: var(--surface); border-bottom: 1px solid var(--line); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.aits-panel.dragging .aits-grab { cursor: grabbing; }
.aits-handle { display: block; width: 42px; height: 5px; border-radius: 3px; margin: 0 auto 4px; background: var(--line-2); }
.aits-head { display: flex; align-items: center; gap: 10px; padding: 4px 12px 10px 16px; }
.aits-head .grow { flex: 1; min-width: 0; }
.aits-head h2 { margin: 0; font-size: 16.5px; font-weight: 800; line-height: 1.3; }
.aits-head .ait-av { width: 38px; height: 38px; }
.aits-head .ait-av svg { width: 19px; height: 19px; }
.aits-head .ait-meta { font-size: 12px; line-height: 1.45; }
.aits-new { flex: none; }
.aits-x { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); background: var(--surface-2); }
.aits-x:hover { color: var(--text); }
.aits-x svg { width: 18px; height: 18px; }

/* 맥락 칩: "📘 3. 토지의 정착물 공부 중 ✕" */
.aits-ctx { flex: none; padding: 8px 14px; background: var(--surface); border-bottom: 1px solid var(--line); }
.aits-ctx[hidden], .aits-sug[hidden] { display: none; }
.aits-cc { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 5px 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--accent-soft); color: var(--accent-ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.aits-cc .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aits-cc button { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; line-height: 1; color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.aits-cc button:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }

.aits-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 14px 14px 10px; }
.aits-sug { flex: none; display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 2px; scrollbar-width: none; }
.aits-sug::-webkit-scrollbar { display: none; }
.aits-sug .ait-chip { flex: none; white-space: nowrap; font-size: 13px; padding: 7px 12px; background: var(--surface); }
/* 입력창: 시트 바닥 고정. 아래 26px 은 가운데 AI 버튼 동그라미가 올라오는 자리 */
.aits-bar { flex: none; padding: 8px 12px 26px; background: var(--bg); }
.aits-panel.kb .aits-bar { padding-bottom: 8px; }

@media (min-width: 720px) {
  .aits-panel { width: min(680px, calc(100% - 32px)); margin: 0 auto; height: min(74vh, 740px); }
}
@media (min-width: 1024px) {
  /* PC: 옆으로 넓게 — 답·표를 한눈에 */
  .aits-panel { width: min(920px, calc(100% - 64px)); height: min(78vh, 820px); }
  .aits-panel .ait-bub { max-width: 80%; font-size: 15.5px; }
}
@media (orientation: landscape) and (max-height: 520px) {
  .aits-bar { padding-bottom: 8px; }
  body[data-route="lec"] .aits-panel { bottom: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .aits-bg, .aits-panel { transition: none; }
  .ait-bub { animation: none; }
}
@media print { .aits { display: none !important; } }

/* 대화 말풍선 */
.ait-av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; background: radial-gradient(circle at 30% 25%, #6fe6e0, var(--brand, #2dc4c4) 55%, #139899); }
.ait-av svg { width: 22px; height: 22px; }
.ait-meta { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.ait-meta b { color: var(--accent-ink); }
.ait-meta a { color: var(--accent-ink); font-weight: 700; text-decoration: underline; }

.ait-log { display: flex; flex-direction: column; gap: 12px; }
.ait-row { display: flex; }
.ait-row.me { flex-direction: column; align-items: flex-end; }
.ait-cl { font-size: 11.5px; font-weight: 700; color: var(--muted); margin: 0 6px 3px; max-width: 86%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ait-bub { max-width: 86%; padding: 12px 15px; border-radius: 18px; font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; animation: ait-in .18s ease-out; }
.ait-row.me .ait-bub { background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.ait-row.bot .ait-bub { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: var(--shadow); }
.ait-bub p { margin: 0; }
.ait-bub p + p, .ait-bub ul + p, .ait-bub p + ul { margin-top: 6px; }
.ait-bub ul { margin: 4px 0; padding-left: 20px; }
.ait-bub li + li { margin-top: 2px; }
.ait-bub.intro { background: var(--accent-soft) !important; border-color: color-mix(in srgb, var(--accent) 30%, var(--line)) !important; }
.ait-sm { font-size: 12.5px; color: var(--muted); }
.ait-bh { margin-bottom: 6px; }
.ait-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800; }
/* 나도스터디 AI(자체 답변) = 티파니블루 / AI 심화 설명(Claude) = 차분한 회색 */
.ait-badge.local { background: #81d8d0; color: #064e4b; }
.ait-badge.claude { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.ait-bub p.ait-src { font-size: 13.5px; font-weight: 700; color: var(--accent-ink); margin-bottom: 4px; }
.ait-bub p.ait-tip { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; }
.ait-tw { overflow-x: auto; margin: 6px 0; -webkit-overflow-scrolling: touch; }
.ait-tb { border-collapse: collapse; font-size: 13px; line-height: 1.5; min-width: 100%; }
.ait-tb th, .ait-tb td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
.ait-tb th { background: var(--surface-2); font-weight: 700; white-space: nowrap; }
.ait-more { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.ait-more .btn { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 35%, transparent); font-weight: 800; }
.ait-more span { font-size: 12px; color: var(--muted); }
.ait-cite { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 11.5px; color: var(--muted); }
.ait-cite span { font-weight: 700; }
.ait-cite a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.ait-appeal { margin-top: 10px; }
.ait-appeal span { font-size: 12.5px; color: var(--muted); }
.ait-mq { font-size: 12px; opacity: .9; }
.ait-bub.refuse { background: var(--surface-2) !important; color: var(--text-2); box-shadow: none !important; }
.ait-scope { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); font-size: 13px; }
.ait-scope b { display: block; color: var(--text); margin-bottom: 2px; }
.ait-scope span { color: var(--muted); }
.ait-bub.err { background: var(--bad-soft) !important; border-color: color-mix(in srgb, var(--bad) 30%, var(--line)) !important; color: var(--bad); font-size: 14px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.ait-refs { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); display: flex; flex-direction: column; gap: 6px; }
.ait-ref { display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; border-radius: 12px; line-height: 1.4; text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--accent-soft); color: var(--accent-ink); }
.ait-ref b { font-size: 13.5px; }
.ait-ref span { font-size: 12.5px; color: var(--text-2); }
.ait-ref i { font-style: normal; color: var(--muted); }
.ait-rate { display: flex; gap: 4px; margin-top: 8px; }
.ait-rate button { width: 34px; height: 28px; border-radius: 8px; font-size: 14px; border: 1px solid var(--line); background: var(--surface); filter: grayscale(1); opacity: .75; }
.ait-rate button:hover:not([disabled]) { opacity: 1; filter: none; }
.ait-rate button.on { filter: none; opacity: 1; border-color: var(--accent); background: var(--accent-soft); }
.ait-rate button[disabled] { opacity: .35; cursor: default; }

.ait-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 2px 0 4px; }
.ait-chip { padding: 8px 13px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--surface); color: var(--accent-ink); font-size: 13.5px; font-weight: 600; text-align: left; line-height: 1.4; }
.ait-chip:hover { background: var(--accent-soft); }

.ait-bub.typing { display: inline-flex; gap: 5px; align-items: center; padding: 15px 18px; }
.ait-bub.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: ait-dot 1.2s infinite ease-in-out; }
.ait-bub.typing i:nth-child(2) { animation-delay: .15s; }
.ait-bub.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ait-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes ait-in { from { opacity: 0; transform: translateY(6px); } }

.ait-bar-in { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--line-2); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow); }
.ait-bar-in:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.ait-bar-in textarea { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--text); font: inherit; font-size: 16px; line-height: 1.5; padding: 7px 0; max-height: 120px; }
.ait-send { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--accent); color: #fff; }
.ait-send svg { width: 20px; height: 20px; }
.ait-send[disabled] { opacity: .45; cursor: default; }

@media (max-width: 520px) {
  .ait-bub { max-width: 92%; font-size: 14.5px; }
  .aits-head { padding-left: 14px; padding-right: 10px; }
}

/* 「AI에게 묻기」 단추 — 문제 카드·풀이 팝업·단락 제목 줄 */
.btn.ai-ask { color: var(--accent-ink); }
.btn.ai-ask svg { color: var(--accent); }
.modal-f .btn.ai-ask { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); font-weight: 800; }
.sec-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.ai-ask-sec { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent-ink); font-weight: 800; }
.btn.ai-ask-sec:hover { filter: brightness(1.03); }
@media (max-width: 860px) {
  .sec-btns { width: 100%; }
  .sec-btns .btn { flex: 1; width: auto !important; justify-content: center; padding: 12px; }
}

/* 추가: 마케팅 동의 토글(내 정보) · 결제 완료 주문 요약 */
.ac-mk { font-size: 14px; padding: 2px 0; }
.ac-done-order { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 12px auto 0; padding: 12px 16px; max-width: 320px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.ac-done-order[hidden] { display: none; }
.ac-done-order b { font-size: 20px; }

/* 이용약관 · 개인정보처리방침 페이지 */
.ac-docpage { max-width: 760px; margin: 0 auto; }
.ac-h1 { font-size: 24px; font-weight: 900; letter-spacing: -0.03em; margin: 4px 0 14px; }
.ac-doc-full { padding: 22px 24px; }
.ac-doc-full p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.75; color: var(--text-2); }
.ac-doc-full p:last-child { margin-bottom: 0; }

/* ================= 내 정보: 가입일 · 수강신청 내역 · 환불 신청 ================= */
.ac-prof .ac-joined { margin-top: 2px; font-size: 12.5px; }
.ac-wait.sm { padding: 24px 12px; font-size: 14px; }
.ac-badge.ref { background: color-mix(in srgb, var(--accent) 14%, var(--surface-2)); color: var(--accent-ink); }
.ac-badge.bad { background: var(--bad-soft); color: var(--bad); }

/* 결제 건 카드 (목록은 카드 하나 안에 줄로) */
.ac-ords { padding: 0; overflow: hidden; }
.ac-ord { padding: 18px 20px; min-width: 0; }
.ac-ords .ac-ord + .ac-ord { border-top: 1px solid var(--line); }
.ac-ord-h { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ac-ord-h .grow { min-width: 0; }
.ac-ord-h .grow b { display: block; font-size: 16px; }
.ac-ord-h .grow span { display: block; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.ac-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0 0; font-size: 14px; }
.ac-kv dt { color: var(--muted); white-space: nowrap; }
.ac-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.ac-dl { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.ac-ord-b { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ac-ord-b .btn { height: 36px; padding: 0 14px; font-size: 13.5px; }
.ac-ord-one { padding: 0; }

/* 결제 건에 붙는 환불 상태 한 줄 */
.ac-rfm { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin-top: 12px; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; background: var(--surface-2); color: var(--text-2); }
.ac-rfm b { font-weight: 800; }
.ac-rfm.open { background: var(--warn-soft); color: var(--warn); }
.ac-rfm.done { background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); color: var(--accent-ink); }
.ac-rfm.rej { background: var(--bad-soft); color: var(--bad); }
.ac-rfm-note { flex-basis: 100%; color: var(--text-2); overflow-wrap: anywhere; }

/* 아직 신청하지 않은 과정 바로가기 */
.ac-other { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.ac-other-a { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--surface); }
.ac-other-a:hover { background: var(--surface-2); }
.ac-other-a svg { width: 20px; height: 20px; color: var(--accent-ink); flex: none; }
.ac-other-a b { flex: 1; min-width: 0; font-size: 15px; }
.ac-other-a span { color: var(--accent-ink); font-size: 13.5px; font-weight: 700; white-space: nowrap; }

/* 환불 신청 화면 */
.ac-rfs-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ac-rfs-h .ac-h2 { margin: 0; }
.ac-rsteps { list-style: none; display: flex; margin: 16px 0 4px; padding: 0; counter-reset: s; }
.ac-rsteps li { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 700; text-align: center; }
.ac-rsteps li::before { content: ''; position: absolute; top: 14px; left: -50%; width: 100%; height: 2px; background: var(--line-2); z-index: 0; }
.ac-rsteps li:first-child::before { display: none; }
.ac-rsteps li i { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px; background: var(--surface-2); border: 2px solid var(--line-2); color: var(--muted); }
.ac-rsteps li.done, .ac-rsteps li.on { color: var(--text); }
.ac-rsteps li.done::before, .ac-rsteps li.on::before, .ac-rsteps li.rej::before { background: var(--accent); }
.ac-rsteps li.done i { background: var(--accent); border-color: var(--accent); color: #fff; }
.ac-rsteps li.on i { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); }
.ac-rsteps li.rej { color: var(--bad); }
.ac-rsteps li.rej i { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.ac-rules { margin: 8px 0 8px; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 13.5px; color: var(--text-2); line-height: 1.6; }
.ac-terms-a { font-size: 13.5px; color: var(--accent-ink); font-weight: 700; }
.ac-est { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.ac-est-l { font-size: 13px; font-weight: 800; color: var(--accent-ink); }
.ac-est-v { font-size: 28px; font-weight: 900; letter-spacing: -0.03em; color: var(--text); }
.ac-est-v.na { font-size: 18px; }
.ac-est-why { margin: 4px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); line-height: 1.55; }
.ac-est-n { font-size: 12.5px; color: var(--muted); }
.ac-rf-ok { align-items: flex-start; font-size: 14px; line-height: 1.55; }
.ac-rf-ok input { margin-top: 2px; }
.ac-rfs .ac-note b { color: var(--text); }

@media (max-width: 520px) {
  .ac-ord { padding: 16px; }
  .ac-kv { gap: 5px 12px; font-size: 13.5px; }
  .ac-ord-b .btn { flex: 1 1 auto; }
  .ac-est-v { font-size: 25px; }
}

/* ===== 이용현황 (#/me/usage) · 기기 등록 (#/me/devices) — v17, 2026-09-29 ===== */
.ac-us-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ac-us-grid .ac-card + .ac-card { margin-top: 0; }
.ac .ac-us, .ac .ac-dev-slot, .ac .ac-dev-block { margin-top: 12px; }
.ac-us-grid .ac-us { margin-top: 0; }
.ac-us-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ac-us-h b { font-size: 16px; font-weight: 800; }
.ac-us-big { font-size: 34px; font-weight: 900; letter-spacing: -0.03em; line-height: 1.1; color: var(--text); }
.ac-us-big small { font-size: 14px; font-weight: 700; color: var(--muted); margin-left: 4px; letter-spacing: 0; }
.ac-bar { height: 10px; margin: 10px 0 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ac-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); min-width: 2px; }
.ac-us-row { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); }
.ac-us-sub { margin: 6px 0 0; font-size: 14px; color: var(--text-2); line-height: 1.55; }
.ac-us-sub b { color: var(--text); }
.ac-us-note { margin: 8px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.ac-us-more { margin-top: 10px; font-size: 14px; }
.ac-us-more summary { cursor: pointer; font-weight: 700; color: var(--accent-ink); }
.ac-us-list { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; max-height: 280px; overflow-y: auto; }
.ac-us-list li a { color: var(--text); text-decoration: none; }
.ac-us-list li a:hover { text-decoration: underline; }
.ac-us-list li small { margin-left: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.ac-us-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ac-us-tiles.two { grid-template-columns: 1fr 1fr; }
.ac-us-tile { display: flex; flex-direction: column; gap: 4px; padding: 12px 12px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.ac-us-tile b { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; color: var(--text); }
.ac-us-tile b.dt { font-size: 16px; }
.ac-us-tile b small { font-size: 12.5px; font-weight: 700; color: var(--muted); margin-left: 3px; }
.ac-us-tile span { font-size: 12.5px; color: var(--muted); }
.ac-us-pdf { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-height: 360px; overflow-y: auto; }
.ac-us-pdf li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ac-us-pdf li:first-child { border-top: 0; }
.ac-us-pdf li .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ac-us-pdf li small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ac-us-foot { margin: 14px 2px 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.ac-us-foot a { color: var(--accent-ink); font-weight: 700; }
.ac-cal-h { display: flex; align-items: center; justify-content: space-between; margin: 14px 0 8px; }
.ac-cal-h b { font-size: 15px; }
.ac-cal-nav { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 18px; cursor: pointer; }
.ac-cal-nav:disabled { opacity: .35; cursor: default; }
.ac-cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.ac-cal span { display: grid; place-items: center; height: 34px; border-radius: 9px; font-size: 13px; color: var(--text-2); }
.ac-cal span.w { height: 22px; font-size: 12px; font-weight: 700; color: var(--muted); }
.ac-cal span.d { background: var(--surface-2); }
.ac-cal span.on { background: var(--accent); color: #fff; font-weight: 800; }
.ac-cal span.today { box-shadow: inset 0 0 0 2px var(--accent-ink); }
.ac-cal-key { margin-left: 8px; font-size: 12px; color: var(--muted); }
.ac-cal-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent); margin-right: 4px; vertical-align: -1px; }
.ac-devnote { display: flex; align-items: flex-start; gap: 8px; }
.ac-devnote svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.ac-note.ac-ok { background: var(--ok-soft); color: var(--ok); display: flex; align-items: center; gap: 6px; }
.ac-note.ac-ok svg { width: 18px; height: 18px; flex: none; }
.ac-note.ac-ok b { color: var(--text); }
.ac-dev-block { border: 1px solid var(--warn); background: var(--warn-soft); }
.ac-dev-block p { margin: 6px 0 0; line-height: 1.6; }
.ac-badge.bad { background: var(--bad-soft); color: var(--bad); }
.ac-dev-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ac-us-h + .ac-dev-row { border-top: 0; }
.ac-dev-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ac-dev-row .grow b { font-size: 15px; overflow-wrap: anywhere; }
.ac-dev-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); color: var(--accent-ink); flex: none; }
.ac-dev-ic svg { width: 20px; height: 20px; }
.ac-dev-reqs { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; }
.ac-dev-reqs li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.ac-dev-reqs li .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.ac-dev-reqs li small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.ac-dev-reqs li .grow small { white-space: normal; }
.ac select.ac-in, .ac textarea.ac-in { width: 100%; }
@media (max-width: 720px) {
  .ac-us-grid { grid-template-columns: 1fr; }
  .ac-us-tiles { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .ac-us-big { font-size: 30px; }
  .ac-us-tile b { font-size: 20px; }
  .ac-dev-row .btn { flex: none; }
}
.ac-test[hidden] { display: none !important; }   /* 라이브 모드·라이브 주문에서는 테스트 안내를 숨긴다(2026-09-30) */

/* ===== 나도AI 티처스: AI 선생님 창 캐릭터 (2026-10-01) ===== */
.aits-head .ait-av.nf2 { width: auto; height: auto; background: none; display: flex; align-items: center; }
.aits-head .ait-av.nf2 svg, .ait-row.bot > .nf-av svg { width: 40px !important; height: 40px !important; border-radius: 50%; background: #eaf6ff; border: 2px solid var(--surface, #fff); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.aits-head .ait-av.nf2 svg + svg { margin-left: -10px; }
.ait-row.bot { display: flex; align-items: flex-start; gap: 8px; }
.ait-row.bot > .nf-av { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.ait-row.bot > .ait-bub { flex: 1; min-width: 0; }
