/* AskMind v2 공용 스타일 — 메인·로그인·스튜디오·만들기 */
:root {
  --ink: #15171C;
  --white: #FFFFFF;
  --surface: #F5F6F8;
  --line: #DCDEE3;
  --muted: #5A5F6B;
  --soft-line: #ECEDF1;
  --body: #3F4450;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: 'Noto Sans KR', system-ui, sans-serif;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--body); }
a:hover { color: var(--ink); }
button, input, select, textarea { font-family: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.logo { font-size: 20px; font-weight: 900; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }

/* 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 24px; border: 1px solid var(--ink); background: var(--ink); color: var(--white); font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { color: var(--white); opacity: .9; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.lg { min-height: 52px; padding: 0 28px; border-radius: 26px; }
.btn.ghost { background: var(--white); color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { color: var(--ink); border-color: var(--ink); }
.btn.sm { min-height: 40px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 500; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; min-height: 44px; font-size: 15px; color: var(--body); text-decoration: underline; cursor: pointer; }
.chip { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); color: #2B2F38; font-size: 14px; font-weight: 500; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }

/* 입력 */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .field legend { font-size: 14px; font-weight: 700; color: var(--body); }
.input, .textarea, .select { width: 100%; min-height: 52px; border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; font-size: 16px; color: var(--ink); background: var(--white); }
.textarea { padding: 14px 16px; line-height: 1.7; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { outline: 2px solid var(--ink); outline-offset: 1px; }

/* 메시지·배지 */
.note { margin: 0; font-size: 14px; line-height: 1.7; color: var(--muted); }
.msg { display: none; padding: 12px 16px; border-radius: 12px; font-size: 14px; line-height: 1.6; }
.msg.show { display: block; }
.msg.err { background: #FDECEC; color: #8A1C1C; }
.msg.ok { background: var(--surface); color: var(--ink); }
.badge { font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: 999px; background: #F1F2F4; color: var(--body); white-space: nowrap; }
.badge.dark { background: var(--ink); color: var(--white); }

/* 결제 안내 모달 */
.modal-bg { position: fixed; inset: 0; background: rgba(21, 23, 28, .45); display: none; align-items: center; justify-content: center; padding: 24px 16px; z-index: 50; }
.modal-bg.show { display: flex; }
.modal { width: 100%; max-width: 480px; background: var(--white); border-radius: 24px; padding: 32px; display: flex; flex-direction: column; gap: 24px; max-height: 100%; overflow: auto; }
.modal h2 { margin: 0; font-size: 22px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.4; }
.plan-box { border: 2px solid var(--ink); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.plan-box ul { margin: 0; padding: 0 0 0 18px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.6; color: #2B2F38; }

/* 토스트 */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--white); padding: 12px 18px; border-radius: 12px; font-size: 14px; display: none; z-index: 60; max-width: calc(100% - 32px); }
.toast.show { display: block; }

.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 불러오기 실패 · 다시 시도 */
.loadfail { color: var(--muted); font-size: 15px; }
.loadfail .link-btn { min-height: 0; font-size: 15px; }
.fatalbar { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 70; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; max-width: calc(100% - 32px); }

/* 대답에 붙은 사진 */
.thumbs { align-self: flex-start; display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); cursor: zoom-in; width: 120px; height: 90px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lightbox { margin: 0; max-width: min(960px, 100%); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.lightbox img { max-width: 100%; max-height: 75vh; border-radius: 12px; background: var(--white); }
.lightbox figcaption { color: var(--white); font-size: 14px; }

/* 입구 카드 색 토큰(E3). 이름은 services/entrance.COLORS 와 같다. 아이콘은 currentColor(= --cc-fg). */
.cc-c1 { --cc-bg: #E6EEFB; --cc-fg: #1F4FA3; }
.cc-c2 { --cc-bg: #E5F4EC; --cc-fg: #1E6B43; }
.cc-c3 { --cc-bg: #FDEEDD; --cc-fg: #A0520D; }
.cc-c4 { --cc-bg: #EFE8FB; --cc-fg: #5B33A6; }
.cc-c5 { --cc-bg: #E2F3F4; --cc-fg: #16676D; }
.cc-c6 { --cc-bg: #FBE8EE; --cc-fg: #A22E55; }
.cicon { display: flex; align-items: center; justify-content: center; background: var(--cc-bg, var(--surface)); color: var(--cc-fg, var(--ink)); }
.cicon svg { width: 44%; height: 44%; }
