/* 짬톡 — 한 손, 한눈, 3분. 엄지 영역에 버튼, 큰 문장, 밝은 곳·어두운 곳 모두 */
:root {
  --bg: #FFF8F4;
  --card: #FFFFFF;
  --text: #1B1A29;
  --muted: #5E5B6E;
  --line: #EEE3DC;
  --brand: #F0435A;
  --brand2: #FF7A45;
  --brand-soft: #FFE9E6;
  --navy: #1E1B4B;
  --ok: #12925A;
  --ok-soft: #E3F6EC;
  --bad: #E0772B;
  --bad-soft: #FFF0E3;
  --hl: #FFE58F;
  --a: #FFF0EC;
  --b: #EEF0FF;
  --c: #E8F7EF;
  --shadow: 0 2px 14px rgba(40, 20, 30, .07);
  --radius: 20px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16141F;
    --card: #211E2E;
    --text: #F3F1F8;
    --muted: #ADA8BF;
    --line: #34304A;
    --brand-soft: #3A2030;
    --navy: #C9C5FF;
    --ok-soft: #173427;
    --bad-soft: #3A2A1C;
    --hl: #6B5412;
    --a: #34222B;
    --b: #252A45;
    --c: #1C3329;
    --shadow: none;
  }
}
html.fs-normal { font-size: 17px; }
html.fs-large  { font-size: 20px; }
html.fs-xlarge { font-size: 23px; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); overflow-x: hidden; }
body {
  font-family: -apple-system, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", Roboto, sans-serif;
  line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
body.in-study { padding-bottom: 0; overscroll-behavior: none; }
#app { max-width: 720px; margin: 0 auto; padding: 14px 16px 8px; }
.boot { min-height: 80vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
        font-weight: 900; font-size: 1.4rem; color: var(--brand); }
.boot img { border-radius: 18px; }
h1 { font-size: 1.45rem; margin: .2em 0 .4em; line-height: 1.3; letter-spacing: -.5px; }
h2 { font-size: 1.1rem; margin: 1.3em 0 .5em; }
p { margin: .35em 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* 머리 */
.top { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; }
.top img { width: 34px; height: 34px; border-radius: 9px; }
.top .brand { font-weight: 900; font-size: 1.25rem; color: var(--brand); letter-spacing: -.5px; }
.top .who { margin-left: auto; font-size: .9rem; color: var(--muted); background: var(--card); border: 1px solid var(--line);
            border-radius: 99px; padding: 6px 12px; min-height: 40px; }
.sync { font-size: .8rem; color: var(--bad); font-weight: 700; }

.card.soft { background: var(--brand-soft); border-color: transparent; }
a.btn { text-decoration: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 12px 0; box-shadow: var(--shadow); }

/* 버튼 */
button { font: inherit; color: inherit; cursor: pointer; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 60px;
       padding: 12px 16px; border-radius: 18px; border: 2px solid transparent; font-size: 1.08rem; font-weight: 800;
       background: var(--brand); color: #fff; user-select: none; transition: transform .06s; }
.btn:active { transform: scale(.97); }
.btn.hero { min-height: 84px; font-size: 1.3rem; background: linear-gradient(135deg, var(--brand2), var(--brand));
            box-shadow: 0 8px 22px rgba(240, 67, 90, .28); flex-direction: column; gap: 2px; }
.btn.hero small { font-size: .8rem; font-weight: 600; opacity: .92; }
.btn.line { background: var(--card); color: var(--text); border-color: var(--line); }
.btn.ok { background: var(--ok); }
.btn.bad { background: var(--bad); }
.btn.navy { background: var(--navy); color: var(--bg); }
.btn[disabled] { opacity: .45; }
.btn + .btn { margin-top: 10px; }
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.duo .btn { margin: 0; min-height: 64px; flex-direction: column; gap: 0; font-size: 1rem; }
.duo .btn small { font-size: .75rem; font-weight: 600; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 14px; border-radius: 999px;
        border: 2px solid var(--line); background: var(--card); font-weight: 700; font-size: .92rem; }
.chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.icon-btn { min-width: 48px; min-height: 48px; border-radius: 14px; border: 1px solid var(--line); background: var(--card);
            font-size: 1.2rem; display: inline-flex; align-items: center; justify-content: center; flex: none; padding: 0 10px; }
.icon-btn.playing, .icon-btn.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* 오늘 목표 */
.goal { display: flex; gap: 16px; align-items: center; }
.ring { width: 96px; height: 96px; flex: none; }
.ring .bgc { stroke: var(--line); }
.ring .fgc { stroke: var(--brand); transition: stroke-dashoffset .5s; }
.ring text { fill: var(--text); font-weight: 900; font-size: 22px; }
.goal .g-t { font-size: 1.15rem; font-weight: 900; }
.goal .g-s { color: var(--muted); font-size: .92rem; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pill { background: var(--card); border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: .88rem; font-weight: 700; }

/* 학습 화면 — 전체 화면, 아래 엄지 바 */
.study { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); z-index: 5; }
.sbar { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 14px 8px; max-width: 720px; width: 100%; margin: 0 auto; }
.progress { flex: 1; height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand2), var(--brand)); border-radius: 99px; transition: width .25s; }
.stage { flex: 1; overflow-y: auto; padding: 8px 18px 16px; max-width: 720px; width: 100%; margin: 0 auto;
         display: flex; flex-direction: column; justify-content: center; touch-action: pan-y; }
.stage.swipeable { cursor: grab; }
.qcard { background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 22px 20px; box-shadow: var(--shadow);
         transition: transform .18s ease, background .18s; will-change: transform; }
.qcard.go-ok { background: var(--ok-soft); }
.qcard.go-bad { background: var(--bad-soft); }
.tag { display: inline-block; font-size: .78rem; font-weight: 900; letter-spacing: .3px; padding: 4px 10px; border-radius: 99px;
       background: var(--brand-soft); color: var(--brand); }
.tag.new { background: var(--b); color: var(--navy); }
.tag.chk { background: var(--c); color: var(--ok); }
.ctx { font-size: .85rem; color: var(--muted); margin-top: 6px; }
.ko-q { font-size: 1.6rem; font-weight: 800; line-height: 1.4; margin: 14px 0 6px; letter-spacing: -.3px; }
.en-a { font-size: 1.65rem; font-weight: 800; line-height: 1.35; margin: 12px 0 4px; letter-spacing: -.2px; }
.ko-s { color: var(--muted); font-size: 1.02rem; }
mark { background: var(--hl); color: inherit; padding: 0 2px; border-radius: 4px; }
.reveal-hint { margin-top: 18px; text-align: center; color: var(--muted); font-size: .9rem; }
.hint { font-size: 1.15rem; color: var(--brand); font-weight: 800; margin: 8px 0; letter-spacing: .4px; }
.answer { border-top: 2px dashed var(--line); margin-top: 16px; padding-top: 12px; }
.tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.heard { margin-top: 10px; font-size: .95rem; padding: 10px 12px; border-radius: 12px; background: var(--b); }
.thumb { padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); max-width: 720px; width: 100%; margin: 0 auto; }
.thumb .duo { margin: 0; }
.thumb .duo .btn { min-height: 70px; font-size: 1.1rem; }
.dots { display: inline-flex; gap: 6px; margin-left: 8px; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; display: inline-block; }
.dots i.on { background: #fff; }
.undo { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--navy); color: var(--bg);
        border-radius: 14px; padding: 6px 6px 6px 14px; margin-bottom: 8px; font-size: .9rem; font-weight: 700; }
.undo button { background: var(--bg); color: var(--text); border: 0; border-radius: 10px; min-height: 40px; padding: 0 14px; font-weight: 900; }
.swipe-tip { text-align: center; font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.fastmark { color: var(--ok); font-weight: 900; }

/* 사용 설명서 */
figure.guide { margin: 14px 0 22px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
figure.guide img { display: block; width: 100%; height: auto; background: #fff; }
figure.guide figcaption { padding: 12px 16px 16px; font-size: .98rem; line-height: 1.5; }

/* 대화 */
.bubbles { display: flex; flex-direction: column; gap: 10px; }
.bubble { display: flex; gap: 8px; align-items: flex-start; }
.bubble .body { flex: 1; padding: 11px 13px; border-radius: 16px; background: var(--a); }
.bubble.B { flex-direction: row-reverse; }
.bubble.B .body { background: var(--b); }
.bubble.C .body { background: var(--c); }
.bubble .who { font-size: .72rem; font-weight: 900; color: var(--muted); }
.bubble .en { font-size: 1.08rem; font-weight: 700; line-height: 1.4; }
.bubble .ko { color: var(--muted); font-size: .95rem; }
.bubble.now .body { outline: 3px solid var(--brand); }
.hide-ko .bubble .ko { visibility: hidden; }
.plist { list-style: none; padding: 0; margin: 0; }
.plist li { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.plist li:last-child { border-bottom: 0; }
.plist .en { font-weight: 700; }
.plist .ko { color: var(--muted); font-size: .92rem; }
details { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 2px 16px; margin: 12px 0; }
details > summary { min-height: 52px; display: flex; align-items: center; font-weight: 800; cursor: pointer; list-style: none; }
details > summary::before { content: "›"; font-size: 1.3rem; margin-right: 10px; transition: transform .2s; }
details[open] > summary::before { transform: rotate(90deg); }
details > summary::-webkit-details-marker { display: none; }
.tip { background: var(--brand-soft); border-radius: 14px; padding: 12px 14px; margin: 10px 0; font-size: .95rem; }

/* 듣기 모드 */
.listen .big-ko { font-size: 1.7rem; font-weight: 800; line-height: 1.4; min-height: 2.8em; }
.listen .big-en { font-size: 1.8rem; font-weight: 900; line-height: 1.35; min-height: 2.6em; color: var(--brand); }
.listen .phase { font-size: .9rem; font-weight: 800; color: var(--muted); margin-bottom: 6px; }
.countdown { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin: 10px 0; }
.countdown i { display: block; height: 100%; width: 0; background: var(--navy); }
.ctrl { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: 10px; }
.ctrl .btn { min-height: 72px; font-size: 1.4rem; margin: 0; }

/* 목록 */
.lesson-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--card);
              border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; margin: 8px 0; min-height: 64px; }
.lesson-row .badge { flex: none; min-width: 56px; text-align: center; font-size: .72rem; font-weight: 900; border-radius: 10px;
                     padding: 6px 4px; background: var(--brand-soft); color: var(--brand); line-height: 1.3; }
.lesson-row .badge.S { background: var(--b); color: var(--navy); }
.lesson-row .t { flex: 1; min-width: 0; }
.lesson-row .t b { display: block; }
.lesson-row .t span { font-size: .84rem; color: var(--muted); }
.lesson-row .st { flex: none; font-size: .8rem; font-weight: 800; color: var(--ok); text-align: right; }
.lesson-row.next { border: 2px solid var(--brand); }
.seg { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }

/* 기록 */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 8px; text-align: center; }
.tile b { display: block; font-size: 1.4rem; line-height: 1.2; }
.tile span { font-size: .8rem; color: var(--muted); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; }
.cal div { aspect-ratio: 1; border-radius: 9px; background: var(--line); display: flex; flex-direction: column; align-items: center;
           justify-content: center; font-size: .7rem; color: var(--muted); min-width: 0; overflow: hidden; line-height: 1.1; }
.cal div.active { background: var(--bad-soft); }
.cal div.done { background: var(--brand); color: #fff; font-weight: 900; }
.cal div.today { outline: 3px solid var(--navy); }
.cal .wd { background: transparent !important; aspect-ratio: auto; font-weight: 800; }
.stages { display: flex; gap: 4px; align-items: flex-end; height: 120px; margin-top: 8px; }
.stages .s { flex: 1; text-align: center; font-size: .72rem; color: var(--muted); display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.stages .s i { display: block; background: var(--brand); border-radius: 6px 6px 0 0; min-height: 3px; margin: 0 2px 4px; }
.stages .s:last-child i { background: var(--ok); }
.stages .s b { color: var(--text); font-size: .9rem; }

/* 설정 */
.set-group { margin: 16px 0; }
.set-group > b { display: block; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=tel] {
  font: inherit; font-size: 1.2rem; width: 100%; min-height: 58px; padding: 10px 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--card); color: var(--text); }
input:focus, button:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }

/* 아래 메뉴 */
.nav { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--card); border-top: 1px solid var(--line);
       padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
.nav button { flex: 1; min-height: 64px; border: 0; background: none; display: flex; flex-direction: column; align-items: center;
              justify-content: center; gap: 1px; font-size: .78rem; font-weight: 800; color: var(--muted); }
.nav button .ni { font-size: 1.25rem; line-height: 1; }
.nav button.on { color: var(--brand); }
.toast { position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%); background: #1B1A29; color: #fff; padding: 12px 18px;
         border-radius: 14px; font-size: .95rem; z-index: 30; max-width: 90vw; text-align: center; }
@media (prefers-color-scheme: dark) { .toast { background: #F3F1F8; color: #1B1A29; } }
@media (min-width: 700px) {
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ko-q, .en-a { font-size: 1.9rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* v1.4.1: 빠른 두 번 누름 방지 · 확대 방지 · 따라 말하기 횟수 */
button, .stage { touch-action: manipulation; }
.stage { touch-action: pan-y; }
.study.lock .thumb, .study.lock .stage { pointer-events: none; }
.cnt { margin-left: 6px; font-variant-numeric: tabular-nums; opacity: .9; }
.qcard .en-a { cursor: pointer; }

/* v1.5: 오늘 할 것 — 순서 목록 */
.steps { list-style: none; margin: 14px 0 6px; padding: 0; display: grid; gap: 8px; }
.steps li { display: flex; gap: 12px; align-items: center; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.steps li > b { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 900; }
.steps li span { display: flex; flex-direction: column; min-width: 0; }
.steps li small { color: var(--muted); font-size: .82rem; }
.steps li.done { opacity: .6; }
.steps li.done > b { background: var(--ok); }
.mt0 { margin-top: 4px; }
.other { margin: 16px 2px 0; }
.btn.col { flex-direction: column; gap: 0; }
.btn.col small { font-size: .78rem; font-weight: 600; color: var(--muted); }
.cnt-top { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* v1.5.1: 새 주소(https)로 옮기기 안내 */
.card.move { border: 2px solid var(--brand); background: var(--brand-soft); }
.card.move .btn { margin-top: 8px; text-decoration: none; }
