/* T-쳐 맞는 사주 공통 스타일 — 모바일 우선 (iOS Safari · 삼성 인터넷 · Chrome) */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

:root {
  --ink: #18241d;
  --ink-2: #4a5850;
  --muted: #7a857e;
  --line: #e3dccd;
  --paper: #faf6ee;
  --card: #ffffff;
  --chalk: #1d4433;
  --chalk-2: #2a5a45;
  --yellow: #f4d35e;
  --yellow-soft: #fdf3c8;
  --coral: #e2725b;
  --coral-soft: #fbe6e0;
  --wood: #4f9a6a; --fire: #e2725b; --earth: #c9a24a; --metal: #8b98a5; --water: #3f78b5;
  --radius: 18px;
  --shadow: 0 6px 24px rgba(24, 36, 29, .08);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --col: 480px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  font-size: 16px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
.col { width: 100%; max-width: var(--col); margin: 0 auto; }
.pad { padding-left: 20px; padding-right: 20px; }

/* 상단 바 */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(250, 246, 238, .92); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); padding-top: var(--safe-t); }
.topbar-in { height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-weight: 800; letter-spacing: -.03em; font-size: 17px; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.brand .t { width: 28px; height: 28px; border-radius: 9px; background: var(--chalk); color: var(--yellow); display: grid; place-items: center; font-size: 14px; font-weight: 900; }
.icon-btn { min-width: 44px; height: 44px; border: 0; background: none; display: grid; place-items: center; font-size: 15px; font-weight: 700; color: var(--ink-2); cursor: pointer; text-decoration: none; }

/* 버튼 */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 56px; padding: 0 20px; border: 0; border-radius: 16px; background: var(--chalk); color: #fff; font-size: 17px; font-weight: 800; letter-spacing: -.02em; text-decoration: none; cursor: pointer; transition: transform .12s ease, opacity .12s; }
.btn:active { transform: scale(.98); }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn small { font-size: 13px; font-weight: 600; opacity: .8; }

/* 하단 고정 CTA (안전 영역 포함) */
.sticky-cta { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 12px 16px calc(12px + var(--safe-b)); background: linear-gradient(to top, var(--paper) 70%, rgba(250, 246, 238, 0)); transition: transform .25s ease; }
.sticky-cta.hide { transform: translateY(120%); }
.sticky-cta .col { display: flex; flex-direction: column; gap: 6px; }
.sticky-cta .note { text-align: center; font-size: 12px; color: var(--muted); }
.cta-space { height: calc(110px + var(--safe-b)); }

/* 섹션 공통 */
.section { padding: 44px 0; }
.eyebrow { font-size: 13px; font-weight: 800; color: var(--coral); letter-spacing: .02em; margin-bottom: 8px; }
.h2 { font-size: 26px; line-height: 1.32; letter-spacing: -.04em; font-weight: 800; margin: 0 0 12px; }
.lead { font-size: 16px; color: var(--ink-2); margin: 0; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 20px; }

/* T-쳐 화자 말풍선 */
.teacher { display: flex; gap: 10px; align-items: flex-start; }
.teacher .avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; background: url('tcheo.svg') center/cover no-repeat; font-size: 0; color: transparent; box-shadow: 0 3px 10px rgba(29, 68, 51, .18); }
.teacher .bubble { background: var(--card); border-radius: 4px 18px 18px 18px; padding: 12px 15px; box-shadow: var(--shadow); font-size: 16px; line-height: 1.55; }
.teacher .who { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }

/* 유형 카드 */
.type-card { position: relative; overflow: hidden; border-radius: 26px; background: var(--chalk); color: #fff; padding: 26px 22px 22px; box-shadow: 0 14px 40px rgba(29, 68, 51, .28); }
.type-card:after { content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(244, 211, 94, .28), rgba(244, 211, 94, 0) 70%); }
.type-card .tc-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .7); }
.type-card .tc-icon { font-size: 54px; line-height: 1; margin: 18px 0 10px; }
.type-card .tc-name-pre { font-size: 15px; color: rgba(255, 255, 255, .8); font-weight: 600; }
.type-card .tc-name { font-size: 32px; font-weight: 900; letter-spacing: -.05em; line-height: 1.2; color: var(--yellow); margin: 2px 0 8px; }
.type-card .tc-tag { font-size: 15px; color: rgba(255, 255, 255, .88); margin: 0 0 16px; }
.type-card .tc-keys { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.type-card .tc-keys span { font-size: 13px; font-weight: 700; padding: 5px 11px; border-radius: 99px; background: rgba(255, 255, 255, .12); }
.type-card .tc-line { background: var(--yellow); color: var(--ink); border-radius: 14px; padding: 14px 15px; font-size: 16px; font-weight: 800; line-height: 1.5; letter-spacing: -.02em; }
.type-card .tc-foot { margin-top: 14px; font-size: 12px; color: rgba(255, 255, 255, .6); display: flex; justify-content: space-between; }

/* 칩·선택지 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 48px; padding: 10px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); font-size: 16px; font-weight: 600; cursor: pointer; text-align: left; line-height: 1.4; transition: border-color .12s, background .12s; }
.chip.on { border-color: var(--chalk); background: #e8f1ec; color: var(--chalk); }
.chip.block { width: 100%; }

/* 폼 요소: iOS 확대 방지를 위해 16px 이상 */
.field { width: 100%; min-height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); padding: 0 14px; font-size: 17px; color: var(--ink); outline: none; -webkit-appearance: none; appearance: none; }
.field:focus { border-color: var(--chalk); }
select.field { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }

/* 원국 표 */
.chart { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chart .pl { text-align: center; }
.chart .pl-label { font-size: 12px; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.chart .ch { border-radius: 12px; padding: 8px 0 6px; color: #fff; margin-bottom: 6px; }
.chart .ch b { display: block; font-size: 24px; line-height: 1.1; font-weight: 700; font-family: 'Noto Serif KR', serif; }
.chart .ch span { font-size: 12px; opacity: .92; }
.chart .god { font-size: 11px; color: var(--muted); margin-top: -2px; margin-bottom: 6px; }
.chart .unknown { border: 1.5px dashed var(--line); color: var(--muted); background: transparent; }
.el-wood { background: var(--wood); } .el-fire { background: var(--fire); } .el-earth { background: var(--earth); } .el-metal { background: var(--metal); } .el-water { background: var(--water); }
.el-bars { display: grid; gap: 8px; }
.el-bar { display: grid; grid-template-columns: 54px 1fr 28px; align-items: center; gap: 8px; font-size: 14px; }
.el-bar .track { height: 10px; border-radius: 99px; background: #eee7d8; overflow: hidden; }
.el-bar .fill { height: 100%; border-radius: 99px; }

/* 잠긴 목차 */
.toc { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.toc li { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: 14px; padding: 14px 14px; box-shadow: var(--shadow); }
.toc .no { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--yellow-soft); color: var(--ink); font-size: 13px; font-weight: 800; display: grid; place-items: center; }
.toc .tt { font-size: 15.5px; font-weight: 700; line-height: 1.4; }
.toc .hint { font-size: 13px; color: var(--muted); margin-top: 2px; }
.toc .lock { margin-left: auto; flex: none; font-size: 14px; opacity: .55; }

.fade-in { animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fade-in { animation: none; } }

.footer { padding: 32px 0 calc(130px + var(--safe-b)); font-size: 12px; line-height: 1.75; color: var(--muted); border-top: 1px solid var(--line); }
.footer a { text-decoration: underline; }
