/* 오니키키 매일 학습지 — 문구·플래너 톤
 * 종이색 바탕 + 짙은 남색 잉크 + 과목색은 채도 낮춘 포인트로만.
 * 구형 아이패드 사파리 대응: flex gap·aspect-ratio·inset·:has 안 씀. 간격은 grid gap 또는 margin. */
:root {
  --bg: #f4f1ea;
  --surface: #fffdf8;
  --ink: #1d2433;
  --ink-2: #4b5364;
  --mute: #8b909a;
  --line: rgba(29, 36, 51, .09);
  --line-2: rgba(29, 36, 51, .16);
  --gold: #c39228;
  --gold-soft: #f4e8c8;
  --ok: #2f7553;
  --ok-soft: #e5efe8;
  --bad: #b04e36;
  --bad-soft: #f7e6e0;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 11px;
  --shadow: 0 1px 2px rgba(29, 36, 51, .05), 0 10px 28px -16px rgba(29, 36, 51, .22);
  --shadow-up: 0 2px 4px rgba(29, 36, 51, .06), 0 18px 36px -18px rgba(29, 36, 51, .3);
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --serif: "Noto Serif KR", "AppleMyungjo", "Batang", serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.11 0 0 0 0 0.14 0 0 0 0 0.2 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: -0.01em;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; letter-spacing: inherit; }
input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--mute); }
.small { font-size: 13px; }
.center { text-align: center; }
.ic { display: inline-block; vertical-align: middle; flex: 0 0 auto; }

#app { max-width: 620px; margin: 0 auto; padding: 14px 20px calc(40px + env(safe-area-inset-bottom)); }

/* ── 상단 */
.top { display: flex; align-items: center; justify-content: space-between; min-height: 52px; margin-bottom: 18px; }
.top .left, .top .right { display: flex; align-items: center; min-width: 0; }
.top .left > * + * { margin-left: 10px; }
.top .right > * + * { margin-left: 8px; }
.top-title { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand { display: flex; align-items: center; }
.mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: #f4e8c8; font-family: var(--serif); font-weight: 700; font-size: 16px; margin-right: 10px; }
.mark.big { width: 56px; height: 56px; border-radius: 16px; font-size: 28px; margin: 0 0 22px; }
.brand .word { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.brand .word em { font-style: normal; color: var(--ink-2); font-weight: 500; }
.pill { display: inline-flex; align-items: center; height: 34px; padding: 0 12px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.pill b { font-weight: 700; color: var(--ink); margin: 0 1px 0 6px; }
.pill.streak { color: var(--bad); }
.pill.streak b { color: var(--ink); margin-left: 4px; }
.pill.coin b { margin-left: 7px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); flex: 0 0 auto; -webkit-transition: transform .15s, background .2s; transition: transform .15s, background .2s; }
.icon-btn:active { transform: scale(.94); }
.icon-btn.ghost { background: transparent; box-shadow: none; color: var(--mute); width: 34px; height: 34px; }

/* 코인 — 이모지 대신 CSS 금화 */
.cn { display: inline-block; width: 15px; height: 15px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f6dd94, #c8941f 72%); box-shadow: inset 0 0 0 1px rgba(120, 80, 0, .35), inset 0 -1px 0 rgba(120, 80, 0, .25); vertical-align: -2px; position: relative; flex: 0 0 auto; }
.cn:after { content: ""; position: absolute; left: 4px; top: 4px; right: 4px; bottom: 4px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(120, 80, 0, .3); }

/* ── 글자 위계 */
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; color: var(--mute); }
.eyebrow.sec { margin: 28px 2px 10px; }
.display { font-family: var(--serif); font-weight: 700; font-size: 34px; line-height: 1.22; letter-spacing: -0.03em; margin: 0 0 10px; word-break: keep-all; }
.display.sm { font-size: 27px; margin-bottom: 18px; }
.lede { margin: 0; color: var(--ink-2); font-size: 15px; max-width: 30em; word-break: keep-all; }
.hint { margin: 0 0 16px; color: var(--ink-2); font-size: 14px; }
.footnote { text-align: center; color: var(--mute); font-size: 13px; margin: 12px 0 0; }

/* ── 버튼 */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 16px; font-weight: 600; color: var(--ink); text-decoration: none; -webkit-transition: transform .15s, box-shadow .2s, background .2s; transition: transform .15s, box-shadow .2s, background .2s; }
.btn .ic { margin-left: 6px; }
.btn .ic:first-child { margin-left: 0; margin-right: 6px; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--ink); color: #fff; box-shadow: 0 10px 22px -12px rgba(29, 36, 51, .7); }
.btn.gold { background: var(--gold); color: #fff; box-shadow: none; }
.btn.danger { color: var(--bad); box-shadow: inset 0 0 0 1px rgba(176, 78, 54, .35); }
.btn.block { display: flex; width: 100%; }
.btn.sm { min-height: 38px; padding: 0 14px; border-radius: var(--r-sm); font-size: 14px; }
.btn[disabled] { opacity: .38; cursor: default; transform: none; }
.text-btn { display: inline-flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 8px 4px; }
.text-btn .ic { margin-right: 5px; }
.btn-row { display: grid; grid-template-columns: 1fr 1.4fr; grid-gap: 10px; margin-top: 22px; }

/* ── 홈: 오늘 */
.today { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 26px; }
.today-text { min-width: 0; padding-right: 12px; }
.ring { flex: 0 0 auto; }
.ring-num { font-family: var(--serif); font-weight: 700; font-size: 20px; fill: var(--ink); }
.ring-of { font-size: 12px; fill: var(--mute); font-family: var(--sans); font-weight: 600; }
.ring-label { font-size: 8.5px; fill: var(--mute); font-weight: 600; letter-spacing: .1em; }

.list { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; }
.list > * + * { box-shadow: inset 0 1px 0 var(--line); }
.row-task, .row-unit, .row-plain, .row-reward { display: flex; align-items: center; width: 100%; padding: 14px 16px; text-align: left; -webkit-transition: background .2s; transition: background .2s; }
.row-task:active, .row-unit:active { background: rgba(29, 36, 51, .035); }
.tile { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 13px; margin-right: 14px; flex: 0 0 auto; }
.body { flex: 1 1 auto; min-width: 0; display: block; }
.body .name { display: block; font-size: 16.5px; font-weight: 650; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
.body .meta { display: block; font-size: 13px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.stars { display: inline-flex; flex: 0 0 auto; margin-left: 10px; }
.stars svg { margin-left: 2px; }
.stars svg.on { fill: var(--gold); }
.stars svg.off { fill: rgba(29, 36, 51, .12); }
.go { flex: 0 0 auto; margin-left: 12px; min-width: 56px; height: 34px; padding: 0 14px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.row-task.done .go { background: var(--ok-soft); color: var(--ok); min-width: 34px; padding: 0; width: 34px; }
.row-task.done .name { color: var(--ink-2); }

/* 목표 보상 카드 */
.goal { display: block; width: 100%; margin-top: 18px; padding: 18px 20px 16px; border-radius: var(--r-lg); background: var(--ink); color: #f6f1e6; text-align: left; box-shadow: var(--shadow-up); position: relative; overflow: hidden; }
.goal:before { content: ""; position: absolute; right: -40px; top: -60px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(195, 146, 40, .35), rgba(195, 146, 40, 0) 70%); }
.goal-top { display: flex; align-items: center; justify-content: space-between; position: relative; }
.goal .eyebrow { color: rgba(246, 241, 230, .6); margin: 0; }
.goal-name { display: flex; align-items: center; font-family: var(--serif); font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 12px; position: relative; }
.goal-emoji { font-size: 24px; margin-right: 10px; }
.goal-bar { display: block; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; position: relative; }
.goal-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #b8861f, #f0cf7a); }
.goal-nums { display: flex; justify-content: space-between; margin-top: 9px; font-size: 13px; color: rgba(246, 241, 230, .7); position: relative; }
.goal-nums b { color: #fff; }
.goal.full .eyebrow { color: #f0cf7a; }

/* 하단 메뉴 */
.dock { display: grid; grid-template-columns: 1fr 1fr 1fr; grid-gap: 10px; margin-top: 14px; }
.dock button { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 84px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); font-size: 13.5px; font-weight: 600; -webkit-transition: transform .15s; transition: transform .15s; }
.dock button:active { transform: scale(.97); }
.dock .ic { margin-bottom: 6px; color: var(--ink); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; height: 18px; line-height: 18px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 700; text-align: center; margin-left: 2px; }

/* ── 처음 화면 */
.welcome { padding: 10vh 4px 0; }
.welcome .display { font-size: 40px; }
.welcome .lede { margin-bottom: 30px; }

/* ── 전체 과목 */
.subj-grid { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 12px; }
.subj { display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 18px 16px 16px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow); -webkit-transition: transform .15s; transition: transform .15s; min-width: 0; }
.subj:active { transform: scale(.98); }
.subj .tile { margin: 0 0 16px; }
.subj .name { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.subj .blurb { font-size: 13px; color: var(--mute); margin: 2px 0 14px; line-height: 1.4; }
.subj .prog { display: block; width: 100%; height: 4px; border-radius: 9px; background: rgba(29, 36, 51, .07); overflow: hidden; margin-top: auto; }
.subj .prog i { display: block; height: 100%; border-radius: 9px; }
.subj .meta { display: flex; justify-content: space-between; width: 100%; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.subj .meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }

/* ── 단원 목록 */
.row-unit .no { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; margin-right: 14px; flex: 0 0 auto; font-size: 13px; font-weight: 700; color: var(--ink-2); background: rgba(29, 36, 51, .05); }
.row-unit.current { position: relative; background: #fffaf0; }
.row-unit.current:before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--c); }
.row-unit.current .no { background: var(--ink); color: #fff; }
.row-unit.cleared .no { background: var(--ok-soft); color: var(--ok); }
.row-unit.locked { opacity: .45; }

/* ── 개념 카드 */
.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.panel > b:first-child { display: block; font-size: 15px; font-weight: 700; }
.story { font-family: var(--serif); font-size: 18px; line-height: 1.95; white-space: pre-line; word-break: keep-all; color: var(--ink); }
.panel .text-btn { margin-top: 10px; }
.hanja-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); grid-gap: 10px; }
.hanja-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 16px 8px 14px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); background: #fff; }
.hanja-card .hz { font-family: var(--serif); font-size: 50px; font-weight: 500; line-height: 1.1; }
.hanja-card .hm { font-size: 15px; font-weight: 600; margin-top: 6px; }
.hanja-card .tip { font-size: 11.5px; color: var(--mute); line-height: 1.4; margin-top: 6px; }
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); grid-gap: 10px; }
.word-card { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 14px 8px 12px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); background: #fff; }
.word-card .em { font-size: 34px; line-height: 1.2; }
.word-card .en { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; margin-top: 6px; }
.word-card .ko { font-size: 12.5px; color: var(--mute); }
.phrase { display: flex; align-items: center; width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 8px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); background: #fff; color: var(--mute); }
.phrase .en { display: block; font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.phrase .en.reply { margin-top: 8px; padding-top: 8px; box-shadow: inset 0 1px 0 var(--line); color: var(--ink-2); }
.phrase .ko { display: block; font-size: 13px; color: var(--mute); }

/* ── 문제 풀기 */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(10px, 1fr)); grid-gap: 5px; margin: -6px 0 16px; }
.steps i { display: block; height: 4px; border-radius: 4px; background: rgba(29, 36, 51, .1); }
.steps i.now { background: var(--ink); }
.steps i.ok { background: var(--ok); }
.steps i.no { background: var(--bad); }
.qcard { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px 20px 24px; margin-bottom: 16px; text-align: center; position: relative; }
.q-head { display: flex; align-items: center; justify-content: space-between; text-align: left; min-height: 34px; margin-bottom: 8px; }
.q-head .eyebrow { margin: 0; }
.passage { text-align: left; font-family: var(--serif); font-size: 16.5px; line-height: 1.9; padding: 14px 16px; margin-bottom: 16px; border-radius: var(--r-sm); background: #f8f4ea; color: var(--ink); white-space: pre-line; }
.listen { display: inline-flex; align-items: center; padding: 14px 24px; margin: 8px 0 18px; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; box-shadow: 0 12px 24px -14px rgba(29, 36, 51, .8); }
.listen .ic { margin-right: 10px; }
.q-emoji { font-size: 66px; line-height: 1.15; margin: 4px 0 12px; }
.q-fig { margin: 0 auto 14px; overflow-x: auto; }
.q-fig svg { max-width: 100%; height: auto; }
.q-big { font-size: 40px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 6px 0 14px; word-break: keep-all; }
.q-big.hz { font-family: var(--serif); font-weight: 500; font-size: 88px; letter-spacing: 0; }
.q { margin: 0; font-size: 21px; font-weight: 600; line-height: 1.5; letter-spacing: -0.025em; white-space: pre-line; word-break: keep-all; }

.choices { display: grid; grid-template-columns: 1fr; grid-gap: 10px; }
.choices.two, .choices.grid4 { grid-template-columns: 1fr 1fr; }
.choice { display: flex; align-items: center; width: 100%; min-height: 60px; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 17px; font-weight: 500; text-align: left; line-height: 1.4; word-break: keep-all; -webkit-transition: transform .12s, background .2s, box-shadow .2s, opacity .2s; transition: transform .12s, background .2s, box-shadow .2s, opacity .2s; }
.choice:active { transform: scale(.985); }
.choice .mk { flex: 0 0 auto; width: 22px; margin-right: 10px; color: var(--mute); font-size: 17px; }
.choice .tx { flex: 1 1 auto; }
.choice .ox { font-family: var(--serif); font-weight: 700; font-size: 26px; margin-right: 10px; }
.choices.two .choice { justify-content: center; min-height: 72px; }
.choices.grid4 .choice { justify-content: center; text-align: center; }
.choices.grid4 .choice .mk { position: absolute; left: 12px; top: 10px; width: auto; font-size: 13px; }
.choices.grid4 .choice { position: relative; min-height: 70px; }
.choices.grid4 .choice .tx { flex: 0 1 auto; }
.choices.emoji .choice .tx { font-size: 46px; line-height: 1.1; }
.choices.hanja .choice .tx { font-family: var(--serif); font-size: 44px; font-weight: 500; line-height: 1.15; }
.choices.en .choice .tx { font-weight: 600; letter-spacing: 0; }
.choice.right { background: var(--ok-soft); box-shadow: inset 0 0 0 2px var(--ok); }
.choice.right .mk { color: var(--ok); }
.choice.wrong { background: var(--bad-soft); box-shadow: inset 0 0 0 2px var(--bad); }
.choice.wrong .mk { color: var(--bad); }
.choice.dim { opacity: .4; }
.answered .choice { pointer-events: none; }

.ans-box { display: flex; align-items: center; justify-content: center; margin: 4px auto 16px; }
.ans-box .val { min-width: 170px; height: 64px; line-height: 64px; padding: 0 18px; border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--ink); font-size: 32px; font-weight: 700; text-align: center; letter-spacing: .02em; }
.ans-box .val .ph { color: rgba(29, 36, 51, .2); font-weight: 500; }
.ans-box .val.right { background: var(--ok-soft); box-shadow: inset 0 0 0 2px var(--ok); color: var(--ok); }
.ans-box .val.wrong { background: var(--bad-soft); box-shadow: inset 0 0 0 2px var(--bad); color: var(--bad); }
.ans-box .unit { font-size: 20px; font-weight: 600; margin-left: 10px; color: var(--ink-2); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); grid-gap: 8px; max-width: 360px; margin: 0 auto; }
.pad button { height: 60px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), 0 1px 2px rgba(29, 36, 51, .05); font-size: 24px; font-weight: 600; text-align: center; -webkit-transition: transform .1s, background .15s; transition: transform .1s, background .15s; }
.pad button:active { transform: scale(.95); background: #efe9dc; }
.pad .ok { background: var(--ink); color: #fff; font-size: 17px; box-shadow: none; }
.pad .del { font-size: 20px; color: var(--ink-2); }

.feedback { margin-top: 16px; padding: 16px 18px 18px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-up); }
.fb-head { display: flex; align-items: center; margin-bottom: 8px; }
.fb-ic { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; margin-right: 10px; color: #fff; }
.feedback.ok .fb-ic { background: var(--ok); }
.feedback.no .fb-ic { background: var(--bad); }
.fb-head b { font-size: 17px; font-weight: 700; }
.fb-answer { margin: 0 0 4px; font-size: 15px; color: var(--ink-2); }
.fb-answer b { color: var(--ink); }
.fb-ex { margin: 0 0 14px; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.feedback .btn { margin-top: 6px; }

/* ── 결과 */
.result { text-align: center; padding: 10px 0 6px; }
.result .score { font-family: var(--serif); font-weight: 700; font-size: 84px; line-height: 1; letter-spacing: -0.04em; }
.result .score span { font-size: 36px; color: var(--mute); margin-left: 4px; letter-spacing: 0; }
.headline { font-size: 18px; font-weight: 600; margin: 10px 0 14px; }
.stars-big .stars { margin: 0; }
.stars-big svg { margin: 0 3px; }
.result .hint { margin: 10px auto 0; max-width: 24em; font-size: 13px; color: var(--mute); }
.ledger { margin-top: 22px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 6px 20px; }
.ledger div { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; font-size: 15px; color: var(--ink-2); }
.ledger div + div { box-shadow: inset 0 1px 0 var(--line); }
.ledger .num { color: var(--ink); font-weight: 600; }
.ledger .total { font-weight: 700; color: var(--ink); font-size: 16px; }
.ledger .total b { font-size: 19px; }
.cleared-card { display: flex; align-items: center; margin-top: 14px; padding: 18px 20px; border-radius: var(--r-lg); background: var(--ink); color: #f6f1e6; }
.cleared-card .ic { color: #f0cf7a; margin-right: 14px; }
.cleared-card b { display: block; font-family: var(--serif); font-size: 18px; }
.cleared-card span { display: block; font-size: 13px; color: rgba(246, 241, 230, .7); }

/* ── 저금통 */
.balance { background: var(--ink); color: #f6f1e6; border-radius: var(--r-lg); padding: 22px 22px 20px; margin-bottom: 16px; position: relative; overflow: hidden; box-shadow: var(--shadow-up); }
.balance:before { content: ""; position: absolute; right: -50px; top: -70px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(195, 146, 40, .35), rgba(195, 146, 40, 0) 70%); }
.balance .eyebrow { color: rgba(246, 241, 230, .6); position: relative; }
.balance .bal { font-family: var(--serif); font-size: 44px; font-weight: 700; letter-spacing: -0.03em; position: relative; display: flex; align-items: center; }
.balance .bal .cn { width: 28px; height: 28px; margin-right: 12px; }
.balance .bal .cn:after { left: 7px; top: 7px; right: 7px; bottom: 7px; }
.balance p { margin: 6px 0 0; font-size: 13.5px; color: rgba(246, 241, 230, .72); position: relative; }
.row-reward .em { font-size: 28px; width: 44px; text-align: center; margin-right: 12px; flex: 0 0 auto; }
.row-reward .tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--gold); padding: 1px 6px; border-radius: 6px; background: var(--gold-soft); vertical-align: 2px; margin-left: 4px; }
.row-reward .mini-prog { display: block; height: 3px; border-radius: 3px; background: rgba(29, 36, 51, .07); margin-top: 7px; max-width: 160px; overflow: hidden; }
.row-reward .mini-prog i { display: block; height: 100%; background: var(--gold); }
.row-reward .acts { flex: 0 0 auto; display: flex; align-items: center; margin-left: 10px; }
.row-reward .acts .text-btn { margin-right: 6px; }
.row-reward.goal-on { background: #fffaf0; }

/* ── 빈 화면 */
.empty { text-align: center; padding: 12vh 20px 0; color: var(--mute); }
.empty h2 { font-family: var(--serif); color: var(--ink); font-size: 22px; margin: 16px 0 6px; }
.empty p { margin: 0; font-size: 14px; }
.row-plain .num { font-size: 14px; color: var(--ink-2); font-weight: 600; }

/* ── 보호자 */
.tabs { display: flex; overflow-x: auto; margin: 0 -20px 16px; padding: 0 20px 4px; -webkit-overflow-scrolling: touch; }
.tabs button { flex: 0 0 auto; height: 36px; padding: 0 14px; margin-right: 6px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); background: var(--surface); }
.tabs button.on { background: var(--ink); color: #fff; box-shadow: none; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { padding: 9px 4px; text-align: left; vertical-align: middle; box-shadow: inset 0 -1px 0 var(--line); }
table.t th { font-weight: 600; color: var(--mute); font-size: 12px; }
table.t td { font-variant-numeric: tabular-nums; }
.plan-grid td, .plan-grid th { text-align: center !important; padding: 7px 2px !important; }
.plan-grid input { width: 20px; height: 20px; accent-color: #1d2433; }
.mini-bars { display: flex; align-items: flex-end; height: 92px; box-shadow: inset 0 -1px 0 var(--line-2); }
.mini-bars div { flex: 1 1 0; margin: 0 2px; background: var(--ink); border-radius: 4px 4px 0 0; min-height: 2px; opacity: .85; }
.mini-bars div.zero { background: transparent; }
.mini-labels { display: flex; font-size: 10px; color: var(--mute); margin-top: 4px; }
.mini-labels span { flex: 1 1 0; text-align: center; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--mute); margin-bottom: 6px; }
.field input[type=text], .field input[type=number], .field select, .field textarea, .inp { width: 100%; border: 0; border-radius: var(--r-sm); padding: 12px 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); font-size: 16px; -webkit-appearance: none; appearance: none; }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%238b909a' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }
.field textarea { min-height: 90px; font-size: 12px; font-family: Menlo, monospace; }
.welcome .field input { font-size: 18px; padding: 15px 16px; }
.row { display: flex; align-items: center; }
.row > * + * { margin-left: 8px; }
.row .grow { flex: 1 1 auto; min-width: 0; }
.rw-edit { margin-bottom: 8px; }
.rw-edit input { border: 0; border-radius: 10px; padding: 9px 10px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); font-size: 15px; width: 100%; }
.rw-edit .e { width: 52px; text-align: center; }
.rw-edit .c { width: 84px; }
.seg { display: inline-flex; border-radius: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-2); background: #fff; }
.seg button { padding: 8px 16px; font-size: 14px; font-weight: 500; color: var(--ink-2); }
.seg button + button { box-shadow: inset 1px 0 0 var(--line); }
.seg button.on { background: var(--ink); color: #fff; font-weight: 600; }
.panel p.small { color: var(--mute); }
.panel a { color: var(--ink); }

/* ── 비밀번호 창 · 축하 */
#layer:empty { display: none; }
.overlay { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(20, 24, 34, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.sheet-modal { background: var(--bg); border-radius: 26px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .45); padding: 24px 20px 20px; width: 100%; max-width: 360px; text-align: center; -webkit-animation: rise .3s cubic-bezier(.2, .8, .2, 1); animation: rise .3s cubic-bezier(.2, .8, .2, 1); }
.sheet-modal h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 21px; }
.pin-dots { display: flex; justify-content: center; margin: 18px 0 20px; }
.pin-dots i { width: 13px; height: 13px; border-radius: 50%; margin: 0 8px; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.pin-dots i.on { background: var(--ink); box-shadow: none; }
.pin-dots.shake { -webkit-animation: shake .4s; animation: shake .4s; }
@-webkit-keyframes shake { 0%, 100% { -webkit-transform: translateX(0); } 25% { -webkit-transform: translateX(-8px); } 75% { -webkit-transform: translateX(8px); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.confetti { position: fixed; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti span { position: absolute; top: -20px; border-radius: 2px; -webkit-animation: fall 2s cubic-bezier(.3, .2, .5, 1) forwards; animation: fall 2s cubic-bezier(.3, .2, .5, 1) forwards; }
@-webkit-keyframes fall { to { -webkit-transform: translateY(110vh) rotate(620deg); opacity: .6; } }
@keyframes fall { to { transform: translateY(110vh) rotate(620deg); opacity: .6; } }

/* 들어오는 움직임 */
.rise { -webkit-animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; animation: rise .45s cubic-bezier(.2, .8, .2, 1) both; }
.rise.d1 { -webkit-animation-delay: .06s; animation-delay: .06s; }
.rise.d2 { -webkit-animation-delay: .12s; animation-delay: .12s; }
@-webkit-keyframes rise { from { opacity: 0; -webkit-transform: translateY(10px); } to { opacity: 1; -webkit-transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .rise, .confetti span { -webkit-animation: none; animation: none; } }

/* 그림그래프 (수학) */
.pic-graph { margin: 0 auto; border-collapse: collapse; font-size: 14px; }
.pic-graph th { font-weight: 600; padding: 8px 12px; background: #f6f1e5; box-shadow: inset 0 0 0 1px var(--line-2); white-space: nowrap; }
.pic-graph td { padding: 8px 12px; text-align: left; min-width: 170px; box-shadow: inset 0 0 0 1px var(--line-2); }
.pg-big { font-size: 28px; }
.pg-small { font-size: 15px; }
.pg-key { margin-top: 8px; font-size: 13px; color: var(--mute); }

@media (max-width: 380px) {
  #app { padding-left: 16px; padding-right: 16px; }
  .display { font-size: 29px; }
  .ring { width: 92px; height: 92px; }
  .row-task .stars { display: none; }
}
