:root { --base: #F3F0EB; --ink: #1E1E1E; --sub: #666; --line: #ccc; }
* { box-sizing: border-box; }
body { margin: 0; background: #fff; color: var(--ink); font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; line-height: 1.5; }
#app { max-width: 480px; margin: 0 auto; padding: 20px 16px 40px; }
.screen { display: flex; flex-direction: column; gap: 12px; }
h1 { font-size: 28px; text-align: center; margin: 8px 0 0; }
h2 { font-size: 21px; text-align: center; margin: 4px 0; }
h3 { font-size: 18px; margin: 4px 0; }
.sub, .note { text-align: center; color: var(--sub); font-size: 14px; margin: 0; }
.error { color: #b00020; text-align: center; min-height: 1.5em; margin: 0; font-size: 14px; }
.btn { display: block; text-align: center; padding: 13px; border: 2px solid var(--ink); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.solid { background: var(--ink); color: #fff; }
.link { background: none; border: none; color: var(--sub); text-align: center; font: inherit; text-decoration: underline; cursor: pointer; }
.grid16 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.grid16 figure { margin: 0; background: var(--base); border-radius: 8px; overflow: hidden; }
.grid16 img { width: 100%; height: auto; aspect-ratio: 720 / 894; object-fit: contain; display: block; }
.grid16 figcaption { font-size: 10.5px; text-align: center; padding: 2px 0 4px; }
.grid16 .pick { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: pointer; }
fieldset { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 700; padding: 0 6px; }
.ymd { display: flex; align-items: center; gap: 6px; }
.ymd select { width: 0; flex: 1; font: inherit; font-size: 17px; padding: 10px 2px; border: 2px solid #999; border-radius: 10px; background: #fff; color: var(--ink); text-align: center; }
.ymd select:first-child { flex: 1.5; }
.row { display: flex; gap: 8px; }
/* 음력·윤달·성별 = 폰에서 누르기 쉬운 버튼 모양(높이 44px↑, 줄 전체가 누르는 곳). 켜지면 검게 칠함 */
.row label, .gender label { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; min-width: 88px; padding: 0 16px; border: 2px solid #999; border-radius: 22px; background: #fff; font-size: 16px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.row label[hidden] { display: none; }
.gender label { min-width: 72px; }
.row label:has(input:checked), .gender label:has(input:checked) { background: var(--ink); border-color: var(--ink); color: #fff; }
.row label input, .gender label input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.time { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--sub); }
.time select { flex: 1; min-width: 0; }
.gender { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.gender > span { color: var(--sub); }
input[type=time], select { font: inherit; font-size: 16px; padding: 10px; border: 2px solid #999; border-radius: 10px; background: #fff; color: var(--ink); }
.types { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.type-btn { padding: 11px 0; border: 1.5px solid #999; border-radius: 8px; background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.divider { text-align: center; color: #888; margin: 4px 0; }
.card { background: var(--bg); color: var(--ink); border-radius: 16px; padding: 12px 12px 16px; text-align: center; border: 1px solid rgba(0, 0, 0, .08); }
.card img { width: 100%; height: auto; display: block; }
.card h2 { color: var(--ink); margin: 6px 0 2px; }
.line { margin: 0; }
.why { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.why img { width: 40%; height: auto; border-radius: 10px; background: var(--base); }
.why p { margin: 0; }
.actions { display: flex; gap: 8px; }
.actions .btn { flex: 1; }
.more { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.more p { margin: 0; }
.pair { display: flex; align-items: center; gap: 8px; }
.partner { display: inline-flex; align-items: center; gap: 6px; }
.partner img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; object-position: center 30%; background: var(--base); }
.tags { font-weight: 700; }
.progress { text-align: center; color: var(--sub); margin: 0; font-size: 14px; }
.qbar { height: 6px; background: var(--base); border-radius: 3px; overflow: hidden; }
.qbar i { display: block; height: 100%; background: var(--ink); }
.qtext { min-height: 3em; display: flex; align-items: center; justify-content: center; line-height: 1.4; }
.likert { display: flex; flex-direction: column; gap: 8px; }
.likert .btn { padding: 14px 12px; }
.quiz-start { width: 100%; }
.clarity { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.clarity h3 { margin: 0; }
.pct-line { display: grid; grid-template-columns: 16px 38px 1fr 38px 16px; align-items: center; gap: 4px; font-size: 13px; }
.pct-line b { text-align: center; }
.pct-line b.off { color: #bbb; }
.pct { text-align: center; }
.pct-track { display: flex; height: 12px; background: var(--base); }
.pct-track i { display: block; height: 100%; }
.pct-track i.on { background: var(--ink); }
.pct-track i.off { background: #d9d9d9; }
.habit-line { grid-template-columns: 44px 38px 1fr 38px 44px; }  /* 이름표가 두세 글자(안으로·움직임) */
.habit-head { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.habit-head img { width: 64px; height: auto; flex: none; border-radius: 8px; background: var(--base); }
.habit-saju { font-size: 14px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.reading { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; }
.fold { border-bottom: 1px solid var(--line); padding: 10px 0; }
.fold summary { font-weight: 700; cursor: pointer; }
.fold p { margin: 6px 0 0; }
.fold-note { font-size: 13px; color: var(--sub); }
.fold-sub { font-weight: 700; font-size: 14px; margin: 12px 0 0; }
.fold-list { margin: 6px 0 0; padding-left: 20px; }
.fold-list li { margin: 2px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { background: var(--base); border-radius: 999px; padding: 2px 10px; font-size: 13px; }
.engine { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0 2px; text-align: center; font-size: 12px; line-height: 1.35; }
.engine .fn { border-radius: 12px; padding: 8px 4px; }
.engine .fn b { display: block; font-size: 13px; margin-bottom: 2px; }
.engine .fn1 { background: var(--ink); color: #fff; }
.engine .fn2 { background: #5a5a5a; color: #fff; }
.engine .fn3 { background: #d9d6d0; }
.engine .fn4 { background: var(--base); border: 1px dashed #aaa; }
.refs { font-size: 12px; color: #888; }
.refs summary { font-size: 13px; font-weight: 700; cursor: pointer; }
.refs ul { margin: 0; padding-left: 18px; }
.refs h4 { font-size: 12px; margin: 8px 0 2px; }
.refs p { margin: 4px 0 0; }
.pair { display: flex; gap: 8px; }
.panel { flex: 1; background: var(--bg); border-radius: 12px; }
.panel img { width: 100%; height: auto; display: block; }
.badge { border: 1.5px dashed var(--ink); border-radius: 10px; padding: 8px; text-align: center; margin: 0; }
.grade { font-size: 22px; font-weight: 800; text-align: center; margin: 0; }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .9); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; z-index: 10; }
.modal img { max-width: 100%; max-height: 64vh; border-radius: 12px; }
.modal .btn { width: 100%; max-width: 360px; }
.modal .note { color: #eee; max-width: 360px; }
.modal .note b { font-size: 17px; }
.source { font-size: 11px; color: var(--sub); }
.modal .pledge { color: #fff; max-width: 360px; text-align: center; word-break: keep-all; }  /* 낱말 중간에서 줄이 안 끊기게('아니에/요.' X) */
.modal .pledge h3 { margin: 0 0 10px; font-size: 20px; }
.modal .pledge p { margin: 8px 0; line-height: 1.6; }
.modal .pledge .small { color: #ccc; font-size: 14px; }
.modal .source { color: #bbb; margin: 0; max-width: 360px; text-align: center; }
.modal .btn.solid { background: #fff; color: var(--ink); border-color: #fff; }
.modal .btn:not(.solid) { background: transparent; color: #fff; border-color: #fff; }
.disclaimer { font-size: 12px; color: #888; text-align: center; margin: 16px 0 0; }
.disclaimer .ver { display: block; margin-top: 4px; }
.guest-band { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.guest-band b { background: var(--ink); color: #fff; border-radius: 6px; padding: 2px 6px; font-size: 12px; }
.modal.guest-modal { justify-content: flex-start; overflow-y: auto; }
.modal.guest-modal img { max-height: 40vh; }
.more.guest .why img { width: 32%; }
.new-badge { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--base); color: var(--ink); text-decoration: none; font-size: 14px; }
.new-badge b { background: var(--ink); color: #fff; border-radius: 6px; padding: 2px 6px; font-size: 12px; }
.pillars { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: center; }
.pillars th { font-size: 12px; color: var(--sub); font-weight: 600; padding: 4px 0; line-height: 1.3; }
.pillars thead th:first-child, .pillars tbody th { width: 34px; }
.pillars th small { display: block; font-size: 10px; font-weight: 400; }
.pillars td { border: 1.5px solid var(--ink); padding: 6px 2px; background: var(--c, #fff); color: var(--t, var(--ink)); }
.pillars td.me { outline: 3px solid var(--t, var(--ink)); outline-offset: -6px; }
.pillars .glyph { display: block; line-height: 1.15; }
.pillars .ch { font-size: 30px; font-weight: 700; }
.pillars .rd { font-size: 13px; font-weight: 700; margin-left: 2px; }
.pillars .el, .pillars .god { display: block; font-size: 11px; line-height: 1.3; }
.bars { display: flex; gap: 4px; }
.bar { flex: 1; text-align: center; font-size: 13px; font-weight: 700; padding: 6px 0; border: 1.5px solid var(--ink); background: var(--c); color: var(--t); }
.bar b, .bar small { display: block; }
.bar small { font-size: 10.5px; font-weight: 400; line-height: 1.3; }
.bar.zero { background: repeating-linear-gradient(45deg, #fff, #fff 5px, #e6e6e6 5px, #e6e6e6 10px); color: var(--ink); }
.easy { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.easy summary { font-weight: 700; cursor: pointer; }
.easy p { margin: 8px 0 0; }
.easy-list { margin: 8px 0 0; padding-left: 18px; }
.easy-list li { margin: 3px 0; }
.relmap { display: block; width: 100%; max-width: 360px; height: auto; margin: 10px auto 0; }
.relmap rect { stroke: var(--ink); stroke-width: 1.5; }
.relmap .me rect { stroke-width: 3.5; }
.relmap .me.dark rect { stroke: #fff; }
.term-edge { border: 2px solid var(--ink); border-radius: 12px; padding: 10px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 8px; }
.term-edge p { margin: 0; }
.term-pick { display: flex; gap: 6px; }
.term-pick .btn { flex: 1; padding: 10px 4px; font-size: 14px; }
.relmap .zero rect { stroke-dasharray: 5 4; }
.relmap line { stroke: var(--ink); stroke-width: 2; }
.relmap marker path { fill: var(--ink); }
.kicker { display: block; font-size: 15px; font-weight: 600; color: var(--sub); }
.saju-reading { border-top: 1px solid var(--line); padding-top: 4px; }
.dayun { margin: 6px 0 0; padding-left: 22px; }
.dayun li { margin: 2px 0; }
.pair-lines p { margin: 2px 0; font-size: 15px; }
.compat-detail { border-top: 1px solid var(--line); padding-top: 4px; }
.axis-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 14px; }
.axis-table th, .axis-table td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; }
.axis-table th { width: 56px; color: var(--sub); font-weight: 600; }
.axis-table td:nth-child(2) { width: 52px; font-weight: 700; }
.ddi-row { background: #eee; border-radius: 8px; padding: 8px 10px; font-weight: 700; text-align: center; }
