/* ============================================================
   국자 — 화면 모양
   색·글자 크기를 바꾸려면 아래 :root 값만 고치면 전체가 바뀝니다.
   ============================================================ */
:root {
  --bg: #F6F4EF;
  --card: #FFFFFF;
  --ink: #17201C;
  --sub: #6C736E;
  --line: #E8E4DB;
  --pri: #173F35;
  --pri-d: #0F2C25;
  --pri-l: #EAF0EC;
  --acc: #B08D57;
  --acc-l: #F6F0E4;
  --red: #A8402A;
  --red-l: #F8ECE8;
  --r: 18px;
  --fs: 17px;
  --serif: "Noto Serif KR", "Nanum Myeongjo", serif;
  --shadow: 0 1px 2px rgba(23, 32, 28, .04), 0 8px 24px rgba(23, 32, 28, .05);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: var(--fs); }
body {
  margin: 0; background: #ECE9E2; color: var(--ink);
  font-family: Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.wrap { max-width: 520px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }
.wrap.app { padding-bottom: 92px; }

/* ---------- 공통 부품 ---------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 56px; padding: 12px 18px; border: 0; border-radius: 14px; cursor: pointer;
  font-weight: 700; font-size: 1.06rem; background: #fff; color: var(--ink); border: 1.5px solid var(--line);
}
.btn.pri { background: var(--pri); color: #fff; border-color: var(--pri); }
.btn.pri:active { background: var(--pri-d); }
.btn.acc { background: var(--acc); border-color: var(--acc); }
.btn.sm { min-height: 44px; width: auto; font-size: .94rem; padding: 8px 14px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--red); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.card { background: var(--card); border-radius: var(--r); padding: 18px; margin: 12px 16px; border: 1px solid var(--line); }
.card h2 { font-size: 1.12rem; margin-bottom: 10px; }
.card h3 { font-size: 1rem; margin: 14px 0 6px; }
.sub { color: var(--sub); font-size: .92rem; }
.note { background: var(--acc-l); border-radius: 12px; padding: 12px 14px; font-size: .9rem; margin-top: 12px; }
.note.red { background: var(--red-l); }
.note.green { background: var(--pri-l); }
.sec { padding: 6px 20px 0; font-size: .9rem; font-weight: 700; color: var(--sub); margin-top: 18px; }
.tag { display: inline-block; font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--pri-l); color: var(--pri-d); }
.tag.y { background: var(--acc-l); color: #7A5F2E; }
.tag.r { background: var(--red-l); color: var(--red); }
.big-num { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.pos { color: var(--pri-d); } .neg { color: var(--red); }

/* 입력 */
.fld { display: block; margin: 12px 0; }
.fld > span { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.fld small { display: block; color: var(--sub); font-size: .84rem; margin-top: 5px; }
.inrow { display: flex; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; }
.inrow:focus-within { border-color: var(--pri); }
.inrow input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 14px; background: transparent; font-size: 1.06rem; }
.inrow input.big { font-size: 1.5rem; font-weight: 800; }
.inrow em { font-style: normal; color: var(--sub); padding-right: 14px; white-space: nowrap; }
select, textarea, .fld > input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; font-size: 1.04rem; outline: 0;
}
select:focus, textarea:focus { border-color: var(--pri); }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 46px; padding: 8px 16px; border-radius: 99px; border: 1.5px solid var(--line); background: #fff;
  font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--pri); border-color: var(--pri); color: #fff; }
.chip input { display: none; }
label.chip:has(input:checked) { background: var(--pri); border-color: var(--pri); color: #fff; }

/* 체크리스트 */
ul.ck, ul.plain { list-style: none; margin: 0; padding: 0; }
ul.ck li { border-top: 1px solid var(--line); }
ul.ck li:first-child { border-top: 0; }
ul.ck label { display: flex; gap: 12px; padding: 13px 0; cursor: pointer; align-items: flex-start; }
ul.ck input { width: 26px; height: 26px; flex: none; accent-color: var(--pri); margin: 1px 0 0; }
ul.ck span { flex: 1; font-weight: 600; }
ul.ck small { display: block; font-weight: 400; color: var(--sub); font-size: .86rem; margin-top: 2px; }
ul.ck input:checked + span { color: var(--sub); text-decoration: line-through; text-decoration-color: #B9C2BB; }
ul.ck input:checked + span small { text-decoration: none; }
ul.dot { margin: 6px 0 0; padding-left: 20px; }
ul.dot li { margin: 7px 0; }
ol.steps { margin: 6px 0 0; padding-left: 0; list-style: none; counter-reset: s; }
ol.steps li { counter-increment: s; position: relative; padding: 10px 0 10px 42px; border-top: 1px solid var(--line); }
ol.steps li:first-child { border-top: 0; }
ol.steps li::before { content: counter(s); position: absolute; left: 0; top: 10px; width: 30px; height: 30px; border-radius: 50%; background: var(--pri); color: #fff; font-weight: 800; display: grid; place-items: center; font-size: .9rem; }

/* 막대 */
.bar { height: 12px; background: #EEEBE4; border-radius: 99px; overflow: hidden; margin: 6px 0 2px; }
.bar i { display: block; height: 100%; background: var(--pri); border-radius: 99px; }
.bar i.y { background: var(--acc); } .bar i.r { background: var(--red); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.kv:first-of-type { border-top: 0; }
.kv b { white-space: nowrap; }
.out { background: var(--pri-l); border-radius: 14px; padding: 16px; margin-top: 14px; }
.out pre, pre.txt { white-space: pre-wrap; font: inherit; margin: 0; }
pre.txt { background: #FAF9F5; border: 1px dashed #CFCABB; border-radius: 12px; padding: 14px; margin: 10px 0; font-size: .96rem; }

/* ---------- 앱 틀 ---------- */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); display: flex; align-items: center; gap: 8px; padding: 12px 16px; min-height: 60px; }
.top h1 { font-size: 1.22rem; font-weight: 800; flex: 1; }
.top .back { width: 44px; height: 44px; display: grid; place-items: center; font-size: 2rem; line-height: 1; margin-left: -10px; border-radius: 12px; }
.logo { display: inline-flex; align-items: center; gap: 7px; font-size: 1.3rem; font-weight: 800; color: var(--pri-d); }
.logo svg { width: 34px; height: 34px; }
.tabs {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; z-index: 6;
  display: flex; background: #fff; border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 0; font-size: .8rem; font-weight: 700; color: #8B948D; border-radius: 12px; }
.tabs a i { font-style: normal; font-size: 1.45rem; filter: grayscale(1); opacity: .6; }
.tabs a.on { color: var(--pri-d); }
.tabs a.on i { filter: none; opacity: 1; }

/* 홈 */
.hello { padding: 6px 20px 4px; }
.hello h2 { font-size: 1.45rem; font-weight: 800; line-height: 1.3; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-height: 104px; display: flex; flex-direction: column; gap: 4px; }
.tile i { font-style: normal; font-size: 1.7rem; }
.tile b { font-size: 1.04rem; }
.tile span { font-size: .84rem; color: var(--sub); }
.menu { margin: 12px 16px; background: #fff; border-radius: var(--r); border: 1px solid var(--line); overflow: hidden; }
.menu a { display: flex; align-items: center; gap: 14px; padding: 16px; border-top: 1px solid var(--line); }
.menu a:first-child { border-top: 0; }
.menu a i { font-style: normal; font-size: 1.7rem; width: 38px; text-align: center; }
.menu a div { flex: 1; }
.menu a b { display: block; font-size: 1.06rem; }
.menu a span { font-size: .87rem; color: var(--sub); }
.menu a::after { content: "›"; font-size: 1.5rem; color: #B5BDB7; }

/* 장부 */
.month { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 4px 0; }
.month b { font-size: 1.15rem; min-width: 130px; text-align: center; }
.month button { width: 48px; height: 48px; border: 0; background: transparent; font-size: 1.4rem; cursor: pointer; border-radius: 12px; }
.chart { display: flex; align-items: flex-end; gap: 8px; height: 130px; margin-top: 10px; }
.chart div { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: .76rem; color: var(--sub); gap: 4px; }
.chart i { display: block; width: 100%; background: #D3DDD7; border-radius: 6px 6px 0 0; min-height: 3px; }
.chart div.on i { background: var(--pri); }
.entry { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; }
.entry .e-i { font-size: 1.3rem; width: 30px; text-align: center; }
.entry .e-m { flex: 1; min-width: 0; }
.entry .e-m small { display: block; color: var(--sub); font-size: .82rem; }
.entry button { border: 0; background: transparent; color: #A5ADA7; font-size: 1.1rem; width: 40px; height: 40px; cursor: pointer; }

/* 바닥 시트 */
.sheet-bg { position: fixed; inset: 0; background: rgba(20, 28, 23, .5); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--bg); width: 100%; max-width: 520px; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 20px 18px calc(22px + env(safe-area-inset-bottom)); }
.sheet h2 { font-size: 1.25rem; margin-bottom: 4px; }
.sheet .x { float: right; border: 0; background: transparent; font-size: 1.5rem; width: 44px; height: 44px; margin: -8px -8px 0 0; cursor: pointer; }
#toast { position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%); background: #1B241F; color: #fff; padding: 12px 20px; border-radius: 99px; font-weight: 600; font-size: .95rem; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; max-width: 90vw; text-align: center; }
#toast.on { opacity: 1; }

/* 점수 */
.score { display: flex; align-items: center; gap: 16px; }
.score .ring { --p: 0; width: 96px; height: 96px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--pri) calc(var(--p) * 1%), #E8E4DB 0); }
.score .ring b { width: 74px; height: 74px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 1.5rem; font-weight: 800; }
table.cuts { width: 100%; border-collapse: collapse; font-size: .93rem; margin-top: 8px; }
table.cuts td { padding: 9px 6px; border-top: 1px solid #D3DDD7; vertical-align: top; }
table.cuts td:first-child { white-space: nowrap; font-weight: 800; color: var(--pri-d); }
table.cuts small { display: block; color: var(--sub); }

/* ---------- 소개(랜딩) ---------- */
.pub .ptop { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; }
.hero { padding: 26px 22px 30px; }
.hero h1 { font-size: 2.15rem; line-height: 1.22; font-weight: 800; letter-spacing: -.03em; }
.hero h1 mark { background: linear-gradient(transparent 62%, var(--acc) 62%); color: inherit; }
.hero p { margin: 16px 0 24px; font-size: 1.08rem; color: var(--sub); }
.hero .fine { text-align: center; font-size: .86rem; color: var(--sub); margin: 10px 0 0; }
.band { padding: 30px 22px; }
.band.w { background: #fff; }
.band.g { background: var(--pri-d); color: #fff; }
.band h2 { font-size: 1.5rem; font-weight: 800; line-height: 1.3; margin-bottom: 16px; letter-spacing: -.02em; }
.pain li { background: var(--bg); border-radius: 14px; padding: 14px 16px; margin: 8px 0; font-weight: 600; list-style: none; }
.pain li::before { content: ""; }
.feat { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.feat div { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 14px; }
.feat i { font-style: normal; font-size: 1.8rem; }
.feat b { display: block; margin: 6px 0 4px; }
.feat span { font-size: .86rem; color: var(--sub); }
.plan { background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); padding: 18px; margin: 12px 0; color: var(--ink); }
.plan.hi { border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-l); }
.plan .p { font-size: 1.6rem; font-weight: 800; }
.plan ul { margin: 10px 0 0; padding-left: 20px; font-size: .94rem; }
.plan li { margin: 4px 0; }
.foot { padding: 26px 22px 40px; font-size: .84rem; color: var(--sub); text-align: center; }

@media (min-width: 560px) {
  .wrap { box-shadow: 0 0 40px rgba(0, 0, 0, .08); }
}

/* ============================================================
   고급 테마 — 차분한 딥그린 + 브라스, 선 아이콘, 명조 제목
   ============================================================ */
svg.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; display: block; }
body { letter-spacing: -.01em; }
.card, .menu, .tile, .feat div, .plan { border-color: transparent; box-shadow: var(--shadow); }
.card h2 { font-weight: 700; letter-spacing: -.02em; }
.btn { border-radius: 12px; font-weight: 600; border-width: 1px; letter-spacing: 0; }
.btn.pri { box-shadow: 0 6px 16px rgba(23, 63, 53, .18); }
.chip { border-width: 1px; font-weight: 500; }
.tag { font-weight: 600; letter-spacing: .01em; }
.tag.y { background: var(--acc-l); color: #7A5F2E; }
.big-num { font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kv b, .entry b { font-variant-numeric: tabular-nums; font-weight: 600; }
.sec { font-size: .8rem; letter-spacing: .08em; color: var(--acc); font-weight: 700; }
.note { background: var(--acc-l); border-left: 2px solid var(--acc); border-radius: 4px 12px 12px 4px; color: #4A4335; }
.note.red { background: var(--red-l); border-left-color: var(--red); color: #5A2A1E; }
.note.green { background: var(--pri-l); border-left-color: var(--pri); color: var(--pri-d); }
.out { background: #F1F4F1; border: 1px solid #DFE6E1; }
.bar { height: 6px; }
ol.steps li::before { background: transparent; color: var(--acc); border: 1px solid var(--acc); font-weight: 700; font-family: var(--serif); }
.score .ring { background: conic-gradient(var(--acc) calc(var(--p) * 1%), #E8E4DB 0); }
.score .ring b { font-family: var(--serif); }

/* 틀 */
.top { background: rgba(246, 244, 239, .88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.top h1 { font-weight: 700; letter-spacing: -.02em; }
.logo { color: var(--pri); font-family: var(--serif); font-weight: 700; letter-spacing: .02em; }
.logo svg { width: 30px; height: 30px; }
.tabs { border-top: 0; box-shadow: 0 -1px 0 var(--line), 0 -8px 24px rgba(23, 32, 28, .04); background: rgba(255, 255, 255, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.tabs a { font-weight: 500; font-size: .74rem; color: #9AA09B; gap: 4px; }
.tabs a i, .tabs a.on i { filter: none; opacity: 1; font-size: 1.5rem; }
.tabs a.on { color: var(--pri); font-weight: 700; }

/* 홈 · 목록 */
.hello h2 { font-family: var(--serif); font-weight: 700; font-size: 1.5rem; letter-spacing: -.02em; }
.tile { padding: 18px; gap: 6px; }
.tile i, .feat i, .menu a i { width: 42px; height: 42px; border-radius: 12px; background: var(--pri-l); color: var(--pri); display: grid; place-items: center; font-size: 1.35rem; margin-bottom: 6px; }
.menu a i { margin-bottom: 0; flex: none; }
.menu a::after { color: #C5C9C5; font-size: 1.3rem; }
.entry .e-i { width: 34px; height: 34px; border-radius: 10px; background: var(--bg); color: var(--sub); display: grid; place-items: center; font-size: 1.1rem; }
.chart i { border-radius: 4px 4px 0 0; }
.chart div.on { color: var(--ink); font-weight: 600; }

/* 소개 */
.pub .ptop { background: var(--pri-d); }
.pub .ptop .logo { color: #F4EFE4; }
.pub .ptop .btn { background: transparent; border-color: rgba(244, 239, 228, .35); color: #F4EFE4; box-shadow: none; }
.hero { background: linear-gradient(180deg, var(--pri-d), var(--pri)); color: #F4EFE4; padding: 34px 24px 44px; }
.hero h1 { font-family: var(--serif); font-weight: 700; font-size: 2.05rem; line-height: 1.34; letter-spacing: -.02em; }
.hero h1 mark { background: none; color: #D9B97E; }
.hero p { color: rgba(244, 239, 228, .74); }
.hero .tag.y { background: transparent; border: 1px solid rgba(217, 185, 126, .6); color: #D9B97E; letter-spacing: .06em; }
.hero .btn.pri { background: #C9A66B; border-color: #C9A66B; color: #14241F; box-shadow: 0 10px 24px rgba(0, 0, 0, .22); }
.hero .fine { color: rgba(244, 239, 228, .55); }
.band { padding: 40px 24px; }
.band h2 { font-family: var(--serif); font-weight: 700; font-size: 1.42rem; }
.band.g { background: var(--pri-d); color: #F4EFE4; }
.band.g li { color: rgba(244, 239, 228, .86); margin: 12px 0; }
.band.g li::marker { color: #C9A66B; }
.pain li { background: transparent; border-radius: 0; border-top: 1px solid var(--line); padding: 16px 2px; margin: 0; font-weight: 500; }
.pain li:first-child { border-top: 0; }
.plan.hi { border: 1px solid var(--acc); box-shadow: var(--shadow); }
.plan .p { font-family: var(--serif); font-weight: 700; }
.plan.hi .tag { background: var(--acc-l); color: #7A5F2E; }

/* 시작 화면은 밝게 */
.pub.light .ptop { background: none; }
.pub.light .ptop .logo { color: var(--pri); }
.pub.light .hero { background: none; color: var(--ink); }
.pub.light .hero p { color: var(--sub); }
.month button { font-size: 1.9rem; color: var(--sub); line-height: 1; }
.month b { font-family: var(--serif); }
