/* ---------- 디자인 토큰: 색·모서리·그림자는 모두 여기서 (화면마다 숫자를 따로 쓰지 않게) ---------- */
:root {
  /* 바탕은 옅은 회색, 카드는 흰색: 테두리·그림자 없이 색 차이로만 나눔 */
  --bg: #f2f4f7;
  --card: #ffffff;
  --text: #191c26;
  --text2: #4e5466;  /* 카드 제목·말풍선처럼 본문보다 한 단계 옅은 글자 */
  --muted: #8b91a1;  /* 설명·단위 */
  --line: #e6e8ee;
  --fill: #eff1f5;   /* 카드 안의 옅은 칸(막대 바탕·세그먼트) */
  --primary: #4f5bd5;
  --primary-soft: #eceefb;
  --on-primary: #ffffff;
  --danger: #e03131;
  --danger-soft: #ffe8e8;
  /* 라이트: 아래쪽에 옅은 피치 → 위로 갈수록 바탕색 (키보드·선지 쪽이 중심) */
  --mark-bg: var(--blank);   /* 해석 뜻 부분 형광펜 */
  --mark-top: 58%;
  --glow-0: #f7e2d1;
  --glow-1: #f9ece3;
  --ok: #12b886;
  --ok-soft: #e3f8f1;
  --on-ok: #ffffff;
  --ok-glow: 18, 184, 134;
  --bad: #fa5252;
  --bad-soft: #ffeceb;
  --on-bad: #ffffff;
  --warn: #f59f00;
  --warn-soft: rgba(245, 159, 0, .12);
  --on-warn: #ffffff;
  --blank: #dde1f8;
  --shadow: none;                                  /* 카드 기본은 평평하게 (설정 > 화면 > 카드) */
  --shadow-soft: 0 2px 10px rgba(20, 35, 70, .06); /* '그림자'를 고르면 */
  --shadow-pop: 0 24px 60px rgba(8, 14, 30, .3);   /* 창·시트처럼 위에 뜨는 것 */
  --scrim: rgba(8, 14, 30, .45);
  --thumb: var(--card);                           /* 예문↔단어 전환 칸 */
  /* 힌트(노랑) · 철자 말풍선 */
  --hint-c: #f59f00; --hint-glow: 245, 159, 0; --on-hint: #ffffff;
  --spell: #d9a700; --spell-soft: #fff5bf;
  /* DAY 단독 학습(주황) */
  --solo: #f76707; --solo-soft: #fff0e3; --on-solo: #ffffff; --solo-glow: rgba(247, 103, 7, .35);
  /* 유반의어 테스트 = 파랑→빨강, 학습 = 연두→초록 */
  --syn-c: #1c7ed6; --syn-soft: #e3f0fd; --ant-c: #e03131; --ant-soft: #ffe8e8;
  --study-c: #12b886; --study-c2: #82c91e; --study-soft: #e3f8f1; --swipe-text: #fff;
  --tint-syn-a: #d6e7fb; --tint-syn-b: #fbd9d9; --tint-study-a: #e6f5c6; --tint-study-b: #c9f0e0;
  /* 모서리: 작은 표시(sm) · 칸·버튼(md) · 목록 줄·보기(lg) · 카드(xl) · 창(2xl) · 알약(pill) */
  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 22px; --r-2xl: 26px; --r-pill: 999px;
  /* 알약 버튼(칩·DAY 고르기·바로가기) 한 모양 */
  --chip-h: 34px;
  --fz: 1;     /* 글자 크기 (설정 > 화면) */
  --key-k: 1;  /* 앱 키보드 키 높이 */
  --bar-w: 560px;
}
/* 다크: js/look.js가 <html data-theme>을 정함 (폰 설정대로 · 늘 밝게 · 늘 어둡게) */
:root[data-theme="dark"] {
  /* 다크: 깊은 남색 바탕 + 한 단계 밝은 카드 + 밝은 인디고 */
  --bg: #0f121c;
  --card: #1b1f2c;
  --text: #eceef4;
  --text2: #b8bdcc;
  --muted: #8a90a3;
  --line: #2a2f40;
  --fill: #262b3a;
  --primary: #6672ee;
  --primary-soft: #252a4a;
  --on-primary: #ffffff;
  --danger: #ef4444;
  --danger-soft: #3a1d26;
  --mark-bg: rgba(110, 225, 170, .5);   /* 다크: 민트 형광펜 (네이비 위에서 잘 보이게) */
  --mark-top: 50%;
  --glow-0: #173d40;   /* 다크: 아래에서 은은한 민트 (홈은 단색) */
  --glow-1: #122434;
  --ok: #38d9a9;
  --ok-soft: #133b31;
  --on-ok: #0b1a1c;    /* 밝은 초록 위 글자는 검정 쪽이 잘 읽힘 */
  --ok-glow: 56, 217, 169;
  --bad: #ff6b6b;
  --bad-soft: #43201f;
  --on-bad: #1f0b0b;
  --on-warn: #1f1600;  /* 다크: 노랑·초록·빨강 띠 위 글자는 검정 쪽 (흰 글자는 잘 안 읽힘) */
  --blank: #2e3560;
  --shadow: none;
  --shadow-soft: none;
  --scrim: rgba(0, 0, 0, .55);
  --thumb: #3a4058;
  --on-hint: #1f1600;
  --spell: #d9b440; --spell-soft: #3a3215;
  --solo: #ff9f43; --solo-soft: #3a2614; --on-solo: #1a1006; --solo-glow: rgba(255, 159, 67, .3);
  --syn-c: #4dabf7; --syn-soft: #16304d; --ant-c: #ff6b6b; --ant-soft: #43201f;
  --study-c: #38d9a9; --study-c2: #a9e34b; --study-soft: #143a33; --swipe-text: #111; /* 다크: 밝은 띠 위 글자는 검정 */
  --tint-syn-a: #173252; --tint-syn-b: #44202a; --tint-study-a: #2b3d15; --tint-study-b: #12403a;
  /* 키보드 키·4지선다 보기: 민트 그라데이션 위에서 잘 구별되게 어둡게 */
  --key-bg: #141825;
  --key-fn: #262b3a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; color: var(--text); }
html { background: var(--bg); }
/* 화면에 고정된 배경 그라데이션 (스크롤해도 아래쪽이 피치) */
/* 아래 고정 버튼 바탕도 같은 그림을 화면 기준(fixed)으로 깔아서 배경과 이음새 없이 붙게 함 */
/* 아래 고정 바는 화면 너비 전체로 깔고(안쪽 버튼만 --bar-w 폭으로 가운데) 배경 그림을 그대로 씀.
   아이패드 사파리는 background-attachment: fixed를 무시하므로, 바가 화면보다 좁으면 그라데이션이 어긋남 */
body { --page-grad: linear-gradient(to top, var(--glow-0) 0, var(--glow-1) 300px, var(--bg) 72vh); }
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--page-grad);
  transition: opacity .35s ease;
}
/* 홈 화면은 단색 (퀴즈로 들어가면 그라데이션이 서서히 나타남). body[data-screen]은 app.js show()가 정함
   (body:has(...)는 DOM이 바뀔 때마다 문서 전체를 다시 따져서 느림) */
body[data-screen="home"]::before, body[data-screen="settings"]::before, body[data-screen="days"]::before,
body[data-screen="list"]::before, body[data-screen="coach"]::before, body[data-screen="account"]::before { opacity: 0; } /* 아래 탭 화면은 바탕색 그대로 */
@media (prefers-reduced-motion: reduce) { body::before { transition: none; } }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.screen {
  display: none;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 24px);
}
.screen.active { display: block; }

.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.top h1 { font-size: 24px; font-weight: 800; letter-spacing: -.4px; margin: 0; }
.top h1 .sub { font-size: 13px; color: var(--muted); font-weight: 500; letter-spacing: 0; margin-left: 2px; }
.icon-btn { border: 0; background: transparent; font-size: 22px; width: 40px; height: 40px; border-radius: var(--r-md); display: inline-grid; place-items: center; padding: 0; color: var(--text); }
.icon-btn .ic { width: 22px; height: 22px; }
/* 아이콘(.ic, js/app.js ICON): 글자 옆에선 글자 크기에 맞춤 */
.ic { width: 1.15em; height: 1.15em; flex: none; display: block; }
.btn:has(> .ic) { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.icon-btn:active { background: var(--primary-soft); }

.status { text-align: center; color: var(--muted); padding: 40px 12px; white-space: pre-line; }
.status code { background: var(--primary-soft); padding: 1px 6px; border-radius: var(--r-xs); }

.card { background: var(--card); border-radius: var(--r-xl); padding: 20px; margin-bottom: 12px; box-shadow: var(--shadow); }
.card.center { text-align: center; }
/* 카드 제목: 본문보다 작고 옅게 (숫자·값이 주인공) */
.label { font-size: 14px; font-weight: 600; color: var(--text2); margin: 2px 0 8px; }
.label.mt { margin-top: 20px; }
.muted { color: var(--muted); font-size: 13px; font-weight: 400; }
.row { display: flex; gap: 8px; align-items: center; }
.row.two > * { flex: 1; }

.range { display: flex; align-items: center; gap: 8px; }
.range select {
  flex: 1; padding: 10px 12px; border-radius: var(--r-md); border: 0;
  background: var(--fill); font-size: 16px; font-weight: 700; appearance: none; text-align: center;
}
.chips { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
/* 알약 버튼 한 모양: 칩 · 설정 바로가기 · 단어장 DAY 고르기 · 코치 대화 위 버튼. 고른 것(.on)은 테두리+옅은 바탕 */
.chip, .dp {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: var(--chip-h); padding: 0 14px; border: 0; border-radius: var(--r-pill);
  background: var(--card); color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.2; white-space: nowrap;
}
.chip:active, .dp:active { background: var(--primary-soft); }
.card .chip:not(.on), .chat-chips .chip { background: var(--fill); } /* 흰 카드 위에선 옅은 회색 칸 */
.chip.on, .dp.on { background: var(--primary-soft); color: var(--primary); }
.chip:disabled { opacity: .45; }

.bar { height: 8px; background: var(--fill); border-radius: var(--r-pill); overflow: hidden; }
.bar.grow { flex: 1; }
.bar-fill { height: 100%; width: 0; background: var(--primary); border-radius: var(--r-pill); transition: width .3s; }

.seg { display: flex; background: var(--bg); border-radius: var(--r-md); padding: 4px; gap: 4px; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 4px; border-radius: var(--r-sm); font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--primary); box-shadow: var(--shadow); }
.kind-note { line-height: 1.45; }
#settings .seg, #list .seg { background: var(--card); }
#settings .seg button.on, #list .seg button.on { background: var(--primary-soft); }

.btn { border: 0; border-radius: var(--r-lg); padding: 13px 16px; font-weight: 700; width: 100%; margin-bottom: 8px; }
.btn.big { padding: 16px; font-size: 17px; border-radius: var(--r-lg); letter-spacing: -.2px; }
/* 작은 버튼 한 크기 (36px). 카드 머리에 붙는 건 .btn.small 그대로 두고 높이만 30px */
.btn.small { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 14px; font-size: 14px; width: auto; }
.btn.primary { background: var(--primary); color: var(--on-primary); }
.btn.secondary { background: var(--primary-soft); color: var(--primary); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.danger { background: var(--bad-soft); color: var(--bad); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; }
.pill { background: var(--primary); color: var(--on-primary); font-size: 12px; border-radius: var(--r-pill); padding: 0 7px; margin-left: 4px; }
.pill:empty { display: none; }

.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.day { background: var(--card); border: 2px solid transparent; border-radius: var(--r-lg); padding: 10px; text-align: left; box-shadow: var(--shadow); }
/* 학습 범위 밖 DAY는 흐리게 (범위 안 DAY마다 굵은 테두리를 두르면 전체 범위일 때 화면이 무거워짐) */
.day:not(.sel):not(.solo) { opacity: .5; }
.day b { display: block; font-size: 15px; }
.day .muted { font-size: 12px; }
.day .bar { height: 5px; margin-top: 6px; }

.resume { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.resume .btn { margin: 0; }
/* 설명이 길어도(예: 범위 순서대로 연습) 버튼 글자는 한 줄로, 설명은 낱말 중간('완/료')에서 줄이 갈리지 않게 */
.resume > div:first-child { flex: 1 1 auto; min-width: 0; }
.resume > .row { flex: none; }
.resume #btn-resume { white-space: nowrap; }
#resume-info, .resume b { word-break: keep-all; overflow-wrap: anywhere; }
#resume-info .nobr { white-space: nowrap; }
/* 이어하기 카드의 지우기(휴지통) — 누르면 빨갛게 */
.trash-btn { flex: none; width: 40px; height: 40px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; padding: 0; }
.trash-btn svg { width: 21px; height: 21px; }
.trash-btn:active { color: var(--danger); background: var(--danger-soft); }
@media (hover: hover) { .trash-btn:hover { color: var(--danger); } }

/* 퀴즈 */
.quiz-top { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.count { font-size: 13px; color: var(--muted); min-width: 44px; text-align: right; }
.quiz-body { padding-bottom: 8px; }
.q-meta { display: flex; gap: 6px; margin-bottom: 10px; }
/* 폰: 화면이 좁아 표시가 한 줄에 다 안 들어가면 낱말 중간에서 줄이 갈렸음('DAY / 44').
   짧은 표시는 통째로, 모자라면 다음 줄로. 채점 결과(길 수 있음)만 너무 길면 띄어쓰기 자리에서 줄을 바꿈 */
:root:not(.desk) .q-meta { flex-wrap: wrap; align-items: flex-start; }
:root:not(.desk) .q-meta .tag { flex: none; white-space: nowrap; }
:root:not(.desk) .q-meta .tag.fb-head { flex: 0 1 auto; min-width: 0; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; }
.tag { font-size: 12px; font-weight: 700; color: var(--primary); background: var(--primary-soft); border-radius: var(--r-sm); padding: 2px 8px; }
.tag.warn { color: var(--warn); background: var(--warn-soft); }
.q-prompt { font-size: 20px; font-weight: 800; letter-spacing: -.4px; line-height: 1.35; color: var(--text); margin: 2px 0 14px; }
.q-prompt:empty { display: none; }
/* DAY·문제 종류는 작은 글자로 조용하게 (채점 결과·다시 나온 단어 표시는 그대로 색 띠) */
.q-meta #q-day, .q-meta .kind-tag:not(.syn):not(.ant):not(.sw-kind) { background: none; padding: 2px 0; color: var(--muted); font-weight: 600; font-size: 13px; }
.q-meta #q-day + .kind-tag:not([hidden]):not(.syn):not(.ant):not(.sw-kind)::before { content: '· '; }
/* 힌트·모르겠어요: 보기 위 오른쪽 아이콘 */
.quiz-body > .q-tools { justify-content: flex-end; margin: 4px 0 2px; }
/* 폰·패드: 보기 번호는 빼고 (컴퓨터는 숫자 키로 고르니 그대로) */
:root:not(.desk) .choice .n { display: none; }
.sent { background: var(--card); border-radius: var(--r-xl); padding: 16px 18px; margin-bottom: 10px; box-shadow: var(--shadow); }
.sent .en { font-size: calc(19px * var(--fz)); line-height: 1.75; word-break: keep-all; overflow-wrap: anywhere; }
.sent .ko { font-size: calc(15px * var(--fz)); color: var(--muted); margin-top: 8px; }
.ko-mark {
  color: var(--text); font-weight: 800;
  background: linear-gradient(transparent var(--mark-top), var(--mark-bg) var(--mark-top)); border-radius: 2px; padding: 0 1px;
}
.sent .ko.hide { filter: blur(5px); user-select: none; }
.sent .num { font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .05em; }
.sent-head { display: flex; justify-content: space-between; align-items: center; }
.blank {
  display: inline-grid; padding: 0 10px; margin: 0 3px;
  border-bottom: 2px solid var(--primary); background: var(--blank); border-radius: 8px 8px 2px 2px;
  line-height: inherit; text-align: left; vertical-align: baseline;
}
/* 정답 글자(sz)를 안 보이게 깔아서 빈칸 폭을 단어에 맞추고, 그 위에 입력/정답(fl)을 겹침 */
.blank > .sz, .blank > .fl { grid-area: 1 / 1; white-space: pre; }
.blank > .sz { visibility: hidden; }
.blank.ghost-full > .sz { visibility: visible; color: var(--muted); }
.blank.hint { color: var(--primary); }
.blank.filled { color: var(--ok); background: var(--ok-soft); border-color: var(--ok); }
.blank.filled.bad { color: var(--bad); background: var(--bad-soft); border-color: var(--bad); }
.q-meaning { font-size: calc(16px * var(--fz)); white-space: pre-line; background: var(--primary-soft); color: var(--text); border-radius: var(--r-lg); padding: 12px 14px; margin: 6px 0 10px; font-weight: 600; }

.quiz-actions { padding-top: 6px; }
.choice {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--key-bg, var(--card)); border: 2px solid transparent; border-radius: var(--r-lg); padding: 13px 14px; margin-bottom: 8px;
  font-size: calc(17px * var(--fz)); font-weight: 600; box-shadow: var(--shadow);
}
.choice .n { color: var(--muted); font-size: 13px; width: 16px; }
.choice.correct { background: var(--ok-soft); color: var(--ok); }
.choice.wrong { background: var(--bad-soft); color: var(--bad); }
.choice:disabled { opacity: 1; }
.choice.picked:not(:disabled) { background: var(--primary-soft); color: var(--primary); } /* 컴퓨터 키보드로 숫자를 눌러 고른 보기 (Enter로 채점) */
.choice.gone { opacity: .32; text-decoration: line-through; } /* 힌트로 지운 보기 */
/* 폰·태블릿 4지선다: 선지를 2×2로 예문 바로 아래에 (app.js placeChoices) */
.phone-choices .quiz-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; transition: grid-template-columns .2s ease; }
.phone-choices .quiz-actions[data-lean="left"] { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.phone-choices .quiz-actions[data-lean="right"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); }
.phone-choices .choice { margin: 0; padding: 12px; word-break: keep-all; overflow-wrap: break-word; }
/* 좁아진 칸은 번호를 빼서 단어 자리를 확보 (첫 자식은 위쪽 줄이라 왼쪽 칸 선지가 짝수 번째) */
.phone-choices .quiz-actions[data-layout="grid"][data-lean="left"] .choice:nth-child(odd) .n,
.phone-choices .quiz-actions[data-layout="grid"][data-lean="right"] .choice:nth-child(even) .n { display: none; }
/* 한 줄씩 (쏠림 없음) */
.phone-choices .quiz-actions[data-layout="list"] { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.phone-choices .quiz-actions[data-layout="list"] .choice { padding: 11px 14px; }
/* 선지 위 한 줄: 왼쪽 힌트(고정될 때만 여기로), 가운데 쏠림 ‹ ›, 오른쪽 '더 보기' */
.pin-row { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; min-height: 28px; }
.pin-row .pin-slot { justify-self: start; }
.pin-row .more-btn { justify-self: end; }
.pin-row .q-tools { flex-wrap: nowrap; }
.pin-row .q-tools .btn, .more-btn { min-height: 32px; height: 32px; padding: 0 11px; font-size: 13px; background: var(--card); box-shadow: var(--shadow); border-radius: var(--r-pill); }
.more-btn { display: inline-flex; align-items: center; gap: 2px; border: 0; color: var(--primary); font-weight: 700; white-space: nowrap; }
.more-btn svg { width: 16px; height: 16px; }
.pin-row .lean-bar { margin: 0; }
/* 한 화면에 다 안 들어가면 화면 아래에 고정. 띠 없이 배경과 같은 그라데이션을 깔고 위쪽만 살짝 흐려서 배경에 붙어 보이게 */
.pin-choices .quiz-actions {
  position: fixed; left: 0; right: 0; bottom: 0; max-width: none; z-index: 5;
  padding: 16px max(16px, calc((100% - var(--bar-w)) / 2 + 16px)) calc(env(safe-area-inset-bottom) + 12px);
  background: var(--page-grad);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px); mask-image: linear-gradient(to bottom, transparent 0, #000 12px);
}
/* 아주 작은 폰(낮은 화면): 예문 칸을 촘촘하게 해서 예문 2가 너무 아래로 밀리지 않게 */
@media (max-width: 699px) and (max-height: 640px) {
  .quiz-top { margin-bottom: 6px; }
  .q-meta { margin-bottom: 6px; }
  .q-prompt { font-size: 17px; margin-bottom: 8px; }
  .sent { padding: 12px 14px; margin-bottom: 8px; border-radius: var(--r-lg); }
  .sent .en { font-size: calc(17px * var(--fz)); line-height: 1.6; }
  .sent .ko { font-size: calc(13.5px * var(--fz)); margin-top: 6px; }
  .phone-choices .quiz-actions { gap: 6px; }
  .phone-choices .choice { padding: 9px 10px; font-size: 15px; }
  .pin-choices .quiz-actions { padding-top: 12px; padding-bottom: calc(env(safe-area-inset-bottom) + 8px); }
}
/* 컴퓨터에서 격자를 고르면 아래 고정 없이 2×2로 */
.desk .quiz-actions[data-layout="grid"] { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.desk .quiz-actions[data-layout="grid"] .choice { margin: 0; }
/* 컴퓨터: 한 줄씩 놓으면 창 아래로 넘칠 때(낮은 창, 긴 예문)는 2×2로 줄여서 한 화면에 (app.js fitChoices) */
.desk .quiz-actions.fit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.desk .quiz-actions.fit .choice { margin: 0; padding: 11px 14px; }
.desk #quiz.active > .quiz-actions.fit { padding-bottom: 8px; }
/* 설정: 카드 제목은 크게 */
/* 설정: 묶음 제목은 카드 바깥 위에 작은 회색, 카드 안은 '이름 ─ 값' 줄 (app.js settingsRows) */
#settings .card { scroll-margin-top: 64px; }
:is(#settings, #plan) .card { position: relative; margin-top: 34px; padding: 6px 20px; }
:is(#settings, #plan) .card > .label:first-child { position: absolute; top: -25px; left: 6px; margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
:is(#settings, #plan) .card .label:not(:first-child) { margin: 14px 0 6px; font-size: 13px; color: var(--muted); }
#plan #card-range { padding: 16px 20px 18px; }
.set-row, :is(#settings, #plan) .switch-row, #settings .opt-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap;
  min-height: 52px; padding: 8px 0; margin: 0; font-size: 16px; font-weight: 500; color: var(--text);
}
#settings .opt-row > span { font-size: 16px; font-weight: 500; color: var(--text); }
.set-row .t { flex: 1 1 auto; min-width: 0; word-break: keep-all; }
:is(#settings, #plan) .switch-row > span { flex: 1 1 0; min-width: 0; word-break: keep-all; } /* 설명이 길어도 스위치는 오른쪽에 */
.set-row .d, :is(#settings, #plan) .switch-row .muted, :is(#settings, #plan) .switch-row small { display: block; font-size: 13px; font-weight: 400; color: var(--muted); margin-top: 1px; }
:is(#settings, #plan, #home) .set-row .seg { flex: none; margin: 0 0 0 auto; padding: 3px; gap: 2px; background: var(--fill); border-radius: 10px; }
:is(#settings, #plan, #home) .set-row .seg button { flex: none; padding: 6px 11px; font-size: 13px; white-space: nowrap; }
:is(#settings, #plan, #home) .set-row .seg button.on { background: var(--card); color: var(--text); box-shadow: none; }
.set-row .seg.as-pick { display: none; }
.set-val { flex: none; margin-left: auto; border: 0; background: none; padding: 8px 0; color: var(--muted); font-size: 15px; font-weight: 500; }
.set-val::after { content: '›'; margin-left: 6px; font-size: 18px; opacity: .7; }
/* 설정 카드 안의 작은 글자 버튼(처음대로·연결 끊기 등)은 줄처럼 */
#settings .card .btn.ghost.small { display: flex; justify-content: flex-start; width: 100%; min-height: 48px; margin: 0; padding: 0; border-radius: 0; font-size: 15px; font-weight: 500; color: var(--text2); background: none; }
#settings .card .btn.ghost.small:active { opacity: .6; transform: none; }
/* 고르기 시트 */
.dialog.pick-sheet { align-items: flex-end; padding: 0; }
#settings .in-sheet { display: none !important; } /* 시트를 열 때만 시트 안으로 옮겨서 보임 */
.pick-card {
  width: 100%; max-width: 560px; max-height: 82dvh; overflow-y: auto; background: var(--card); color: var(--text);
  border-radius: var(--r-2xl) var(--r-2xl) 0 0; padding: 10px 20px calc(env(safe-area-inset-bottom) + 20px);
  box-shadow: var(--shadow-pop); animation: up .35s cubic-bezier(.22, 1, .36, 1);
}
.pick-card .grab { width: 36px; height: 4px; border-radius: 9px; background: var(--line); margin: 0 auto 16px; }
.ps-title { font-size: 20px; font-weight: 800; letter-spacing: -.3px; }
.ps-desc { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.ps-body { margin-top: 12px; }
.ps-opt { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 54px; padding: 0 4px; border: 0; background: none; color: var(--text); font-size: 16px; font-weight: 500; text-align: left; }
.ps-opt::after { content: ''; width: 22px; height: 22px; border-radius: 50%; box-sizing: border-box; border: 2px solid var(--line); flex: none; }
.ps-opt.on { font-weight: 700; }
.ps-opt.on::after { border: 7px solid var(--primary); }
.ps-opt:active { opacity: .6; }
.ps-body .seg { margin: 4px 0 12px; }
@media (min-width: 640px) { .dialog.pick-sheet { align-items: center; padding: 24px; } .pick-card { border-radius: var(--r-2xl); max-width: 440px; } }
/* 설정: 위에 붙는 탭. 누른 탭의 카드만 보임 (app.js setTab) */
.set-tabs {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 4; margin: 0 0 12px;
  box-shadow: 0 0 0 8px var(--bg), 0 calc(-1 * env(safe-area-inset-top, 0px) - 8px) 0 8px var(--bg); /* 뒤로 지나가는 카드 가림 */
}
#settings .card.tab-off { display: none; }
/* 탭은 밑줄 글자 */
#settings .set-tabs { gap: 20px; padding: 0 4px; border-radius: 0; background: var(--bg); box-shadow: 0 0 0 8px var(--bg), 0 calc(-1 * env(safe-area-inset-top, 0px) - 8px) 0 8px var(--bg), inset 0 -1px 0 var(--line); }
#settings .set-tabs button { flex: none; white-space: nowrap; padding: 10px 0 11px; border-radius: 0; font-size: 16px; font-weight: 700; color: var(--muted); background: none; }
#settings .set-tabs button.on { background: none; color: var(--text); box-shadow: inset 0 -2px 0 var(--text); }
.x-desc { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--muted); }
/* 설정: 동기화 연결 방법 같은 긴 설명은 접어 둠 */
.set-more { margin-top: 12px; }
.set-more > summary { list-style: none; cursor: pointer; padding: 6px 0; color: var(--muted); font-size: 14px; font-weight: 700; }
.set-more > summary::-webkit-details-marker { display: none; }
.set-more > summary::after { content: ' ›'; display: inline-block; transition: transform .15s; }
.set-more[open] > summary::after { transform: rotate(90deg); }
.set-more[open] > summary { margin-bottom: 8px; }
.set-plan-btn { margin: 12px 0 0; padding-left: 0; padding-right: 0; color: var(--primary); }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.lean-bar { display: flex; justify-content: center; gap: 4px; }
.lean-btn {
  width: 44px; height: 28px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--muted);
  font-size: 22px; font-weight: 700; line-height: 1; padding: 0 0 2px;
}
.lean-btn.on { color: var(--primary); background: var(--primary-soft); }
@media (prefers-reduced-motion: reduce) { .phone-choices .quiz-actions { transition: none; } }
.type-input {
  width: 100%; padding: 15px 16px; font-size: 19px; border-radius: var(--r-lg); border: 2px solid transparent;
  background: var(--card); margin-bottom: 8px; outline: none;
}
.type-input:focus { border-color: var(--primary); }
.card .type-input:not(:focus) { background: var(--fill); }
.kb-mode .quiz-actions {
  position: fixed; left: 0; right: 0; bottom: 0; max-width: none; z-index: 5;
  padding: 8px max(6px, calc((100% - var(--bar-w)) / 2 + 6px)) calc(env(safe-area-inset-bottom) + 6px); background: var(--page-grad);
}
.kb-top { display: flex; justify-content: space-between; align-items: center; padding: 0 6px; }
.kb-top .type-help { margin: 0; }
.kb-top .btn { margin: 0; min-height: 32px; padding: 0 10px; }
.kb-top .row { gap: 2px; flex: none; }
.kb-mode #btn-hint { display: none; }
.kb-caret { display: inline-block; width: 2px; height: 1.2em; background: var(--primary); margin: 0 2px 0 1px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.kb { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.kb-row { display: flex; gap: 5px; margin-bottom: 7px; justify-content: center; }
.kb-row:nth-child(2) { padding: 0 4.5%; }
.key {
  flex: 1; height: calc(46px * var(--key-k)); border: 0; border-radius: var(--r-sm); background: var(--key-bg, var(--card)); color: var(--text);
  font-size: 21px; font-weight: 500; box-shadow: 0 1px 0 rgba(0, 0, 0, .18); padding: 0; touch-action: manipulation;
}
.key.down { background: var(--primary-soft); transform: translateY(1px); }
.key.fn { background: var(--key-fn, var(--line)); font-size: 18px; }
.key.wide { flex: 1.5; }
.key.space { flex: 5; font-size: 15px; color: var(--muted); }
.key.enter { flex: 2; background: var(--primary); color: var(--on-primary); font-size: 16px; font-weight: 700; }
.type-help { font-size: 12px; color: var(--muted); margin: -2px 0 8px 4px; }

.sheet { position: fixed; left: 0; right: 0; bottom: 0; display: flex; align-items: flex-end; z-index: 10; }
.sheet-inner {
  width: 100%; max-width: 560px; margin: 0 auto; background: var(--card); border-radius: var(--r-2xl) var(--r-2xl) 0 0;
  padding: 10px 18px calc(env(safe-area-inset-bottom) + 16px); max-height: 62dvh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 -10px 30px rgba(15, 30, 60, .15);
  animation: up .5s cubic-bezier(.22, 1, .36, 1);
}
@keyframes up { from { transform: translateY(100%); } }
.fb-word { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
/* 긴 단어(accommodation 등)가 신고·형광펜 버튼을 화면 밖으로 밀지 않게: 단어 칸이 줄어들고,
   글자는 한 줄에 들어가게 작아짐(app.js fitFbWord, 18px까지, 그래도 길면 코치 캐릭터를 뺌). 그래도 길면 줄을 바꿈 */
.fb-word > div:first-child { flex: 1 1 auto; min-width: 0; }
.fb-word .w { font-size: var(--w-fit, 30px); font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; }
.fb-word.tight .fb-coach { display: none; } /* 단어가 너무 길면 머리의 코치 캐릭터는 뺌 */
.fb-word.tight .report-btn { margin-left: auto; }
.speak { border: 0; background: var(--primary-soft); color: var(--primary); border-radius: var(--r-pill); width: 36px; height: 36px; flex: none; display: grid; place-items: center; padding: 0; }
.speak .ic { width: 18px; height: 18px; }
.speak.big { width: 48px; height: 48px; }
.speak.big .ic { width: 22px; height: 22px; }
.speak:active { transform: scale(.92); }
.extras b { color: var(--muted); font-weight: 600; margin-right: 6px; }

/* 결과/단어장 */
.cheer { font-size: 22px; font-weight: 800; letter-spacing: -.3px; color: var(--text); margin-bottom: 4px; }
.res-cheer { padding: 24px 16px 22px; }
.res-stats { display: flex; margin-top: 18px; }
.res-stats > div { flex: 1; min-width: 0; }
.res-stats b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.6px; line-height: 1.2; }
.res-stats span { font-size: 13px; color: var(--muted); }
.res-stats .ok b { color: var(--ok); }
.res-stats .bad b { color: var(--bad); }
#res-detail:empty { display: none; }
#res-detail { margin-top: 12px; }
#res-wrong-label { margin: 22px 8px 8px; font-size: 13px; font-weight: 700; color: var(--muted); }
#res-wrong .item:not(.open) .rel { display: none; }
.list { margin-bottom: 90px; }
.item { background: var(--card); border-radius: var(--r-lg); padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
/* 단어장은 1000줄이라 화면 밖 줄은 그리기를 건너뜀 (스크롤이 가벼워짐) */
#word-list .day-group > .item { content-visibility: auto; contain-intrinsic-size: auto 74px; }
/* 단어장: DAY 하나 = 카드 하나, 단어는 줄 (사이에 아주 옅은 줄) */
.day-group { background: var(--card); border-radius: var(--r-xl); overflow: hidden; box-shadow: var(--shadow); }
:root[data-edge="line"] .day-group { border: 1px solid var(--line); }
.day-group > .item { background: none; border: 0 !important; border-radius: 0; margin: 0; padding: 14px 18px; box-shadow: none; }
.day-group > .item + .item { box-shadow: inset 0 1px 0 var(--line); }
#word-list .item:not(.open) .rel { display: none; } /* 유의어·반의어는 펼쳤을 때만 */
/* 거르기 한 줄: DAY ▾ + 칩 */
.book-filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px 6px; padding: 2px 16px 4px; }
.book-filters::-webkit-scrollbar { display: none; }
.book-day-btn { flex: none; background: var(--primary-soft) !important; color: var(--primary); font-weight: 700; }
.book-day-btn::after { content: ''; width: 0; height: 0; margin-left: 2px; border: 4px solid transparent; border-top: 5px solid currentColor; border-bottom: 0; }
.book-day-btn.dim { opacity: .45; }
#list .book-filters .seg { flex: none; display: flex; gap: 6px; margin: 0; padding: 0; background: none; box-shadow: none; }
#list .book-filters .seg button { flex: none; min-height: var(--chip-h); padding: 0 14px; border-radius: var(--r-pill); background: var(--card); color: var(--text2); font-size: 14px; font-weight: 600; box-shadow: none; }
#list .book-filters .seg button.on { background: var(--text); color: var(--bg); }
#list > #book-days { display: none; } /* DAY는 시트에서 고름 (app.js openBookDays) */
.ps-body .day-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 4px 0 0; padding: 0; overflow: visible; }
.ps-body .dp { min-width: 0; min-height: 44px; border-radius: var(--r-md); background: var(--fill); color: var(--text); font-size: 15px; }
.ps-body .dp.on { background: var(--primary); color: var(--on-primary); }
.item-head { display: flex; align-items: center; gap: 10px; }
.item-main { flex: 1; min-width: 0; }
.item .w { font-weight: 800; font-size: 17px; }
.item .m { font-size: 14px; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.item.open .m { display: block; }
.item .detail { margin-top: 10px; font-size: 15px; }
.item .detail .sent { background: var(--bg); box-shadow: none; padding: 10px 12px; }
.item .detail .sent .en { font-size: calc(15px * var(--fz)); }
/* 단어 상태 (새 단어 · 틀림 n · 암기 완료 · n단계) */
.w-state { flex: none; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--fill); padding: 3px 8px; border-radius: var(--r-pill); white-space: nowrap; }
.w-state.bad { color: var(--bad); background: var(--bad-soft); }
.w-state.ok { color: var(--ok); background: var(--ok-soft); }
.mark { color: var(--primary); font-weight: 800; }
.sticky-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; max-width: none;
  padding: 12px max(16px, calc((100% - var(--bar-w)) / 2 + 16px)) calc(env(safe-area-inset-bottom) + 12px); background: var(--page-grad);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px); mask-image: linear-gradient(to bottom, transparent 0, #000 12px);
}
.sticky-bottom .btn { margin: 0; }

/* 설정의 켜고 끄는 스위치 (글자 왼쪽, 스위치 오른쪽) */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 15px; cursor: pointer; }
.switch {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; cursor: pointer;
  position: relative; width: 50px; height: 30px; border-radius: var(--r-pill); background: var(--line); transition: background .2s;
}
.switch::before {
  content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s, background .2s;
}
.switch:checked { background: var(--primary); }
.switch:checked::before { transform: translateX(20px); background: var(--on-primary); }
.switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::before { transition: none; } }
input[type=range] { width: 100%; accent-color: var(--primary); margin-bottom: 8px; }

.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 90px); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: var(--r-md); font-size: 14px; z-index: 30;
  box-shadow: 0 6px 20px rgba(10, 20, 40, .18);
  width: max-content; max-width: 90vw; text-align: center; white-space: pre-line;
}
/* 확인 창 (정말 지울까요?) */
.dialog { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--scrim); animation: dlg-fade .18s ease-out; }
.dialog-card { width: 100%; max-width: 320px; background: var(--card); color: var(--text); border-radius: var(--r-2xl); padding: 24px 18px 16px; text-align: center; box-shadow: var(--shadow-pop); animation: dlg-pop .24s cubic-bezier(.2, .9, .3, 1.15); }
.dlg-icon { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--danger); background: var(--danger-soft); }
.dlg-icon svg { width: 26px; height: 26px; }
.dlg-title { font-size: 18px; font-weight: 800; }
.dlg-body { font-size: 15px; color: var(--muted); margin-top: 6px; line-height: 1.55; white-space: pre-line; }
.dlg-actions { display: flex; gap: 8px; margin-top: 20px; }
.dlg-actions .btn { flex: 1; margin: 0; padding: 13px 10px; }
.dlg-cancel { background: var(--fill); color: var(--text); }
.dlg-ok { background: var(--primary); color: var(--on-primary); }
.dlg-ok.danger { background: var(--danger); color: var(--on-bad); }
@keyframes dlg-fade { from { opacity: 0; } }
@keyframes dlg-pop { from { opacity: 0; transform: translateY(6px) scale(.95); } }
@media (prefers-reduced-motion: reduce) { .dialog, .dialog-card { animation: none; } }

/* 아이패드 등 큰 화면 */
@media (min-width: 700px) {
  body { font-size: 17px; }
  .screen { max-width: 760px; padding-left: 28px; padding-right: 28px; }
  :root { --bar-w: 760px; }
  .quiz-actions, .sheet-inner { max-width: 760px; }
  .top h1 { font-size: 26px; }
  .sent { padding: 20px 24px; }
  .sent .en { font-size: calc(24px * var(--fz)); }
  .sent .ko { font-size: calc(17px * var(--fz)); }
  .q-prompt { font-size: 24px; }
  .choice { font-size: calc(20px * var(--fz)); padding: 16px 18px; }
  .btn.big { font-size: 20px; padding: 19px; }
  .key { height: calc(58px * var(--key-k)); font-size: 24px; border-radius: var(--r-md); }
  .kb-row { gap: 7px; margin-bottom: 8px; }
  .days { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
/* 가로 화면에서 키보드가 문장을 너무 가리지 않게 */
@media (min-width: 700px) and (max-height: 900px) and (orientation: landscape) {
  .key { height: calc(50px * var(--key-k)); }
  .kb-row { margin-bottom: 6px; }
  .sent .en { font-size: calc(22px * var(--fz)); }
}

/* 동기화 */
.head-right { display: flex; align-items: center; gap: 8px; }
/* 동기화: 글자 없이 작은 점 하나 (글자는 title·화면 읽기로) */
.sync-badge { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: .55; font-size: 0; overflow: hidden; flex: none; margin-right: 2px; }
.sync-badge.ok { background: var(--ok); opacity: .7; }
.sync-badge.error { background: var(--bad); opacity: 1; }
.sync-badge.wait { background: var(--warn); opacity: .9; }
.sync-badge.syncing { background: var(--primary); animation: sync-pulse 1s ease-in-out infinite alternate; }
@keyframes sync-pulse { from { opacity: .25; } to { opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .sync-badge.syncing { animation: none; } }
.sync-info { white-space: pre-line; font-size: 14px; margin: 0 0 10px; }
.steps { font-size: 14px; padding-left: 20px; margin: 8px 0 12px; color: var(--text); }
.steps li { margin-bottom: 6px; }
.steps a { color: var(--primary); font-weight: 700; }
code { background: var(--primary-soft); padding: 1px 5px; border-radius: var(--r-xs); font-size: .9em; }
/* 앱 키보드가 떠 있을 땐 알림을 위쪽에 */
#quiz.active.kb-mode ~ .toast { bottom: auto; top: calc(env(safe-area-inset-top) + 64px); }

/* 문장 빈칸에 직접 입력: 문장과 같은 글꼴·크기, 여유 있는 칸 */
.sent .en { --typed-weight: 400; }
.blank.typing {
  font: inherit; font-weight: var(--typed-weight); line-height: inherit; letter-spacing: inherit;
  color: var(--primary); text-align: left; white-space: pre;
  padding: 0 10px; margin: 0 3px; border-radius: 8px 8px 2px 2px;
  background: var(--bg); border-bottom: 2px solid var(--muted);
}
.blank.typing.active { background: var(--primary-soft); border-bottom-color: var(--primary); }
.blank .kb-caret { vertical-align: -0.12em; height: 1.05em; margin: 0 -1px; } /* 폭 0: 글자 사이가 벌어지지 않게 */

/* 정답 보고 따라 쓰기 */
.blank .ghost { color: var(--muted); opacity: .55; }
.blank .typo { color: var(--bad); }
.blank.ghost-full { color: var(--muted); }

/* 정답 화면 (말해보카 형식): 카드는 그대로 정답 상태로, 아래에서 단어 시트 */
/* 정답 순간: 카드와 빈칸 색이 부드럽게 바뀜 */
#q-sentences.answered .sent { animation: card-in .45s ease-out; }
@keyframes card-in { from { box-shadow: var(--shadow); background: var(--card); } }
#q-sentences.answered .blank.filled { animation: blank-in .45s ease-out; }
@keyframes blank-in { from { background: var(--primary-soft); border-bottom-color: var(--primary); color: var(--primary); } }
.tag.fb-head:not([hidden]) { animation: tag-in .35s ease-out; }
@keyframes tag-in { from { opacity: 0; transform: translateY(4px); } }
/* 채점한 예문: 색 바탕 + 색 테두리 (맞힘 초록 · 틀림 빨강 · 힌트 노랑) */
#q-sentences.answered.ok .sent { background: var(--ok-soft); box-shadow: 0 0 0 3px var(--ok); }
#q-sentences.answered.bad .sent { background: var(--bad-soft); box-shadow: 0 0 0 3px var(--bad); }
#q-sentences.answered.copied .sent, #q-sentences.answered.hint .sent { background: var(--warn-soft); box-shadow: 0 0 0 3px var(--warn); }
.tag.fb-head { font-size: 13px; font-weight: 800; padding: 3px 10px; margin: 0; }
.tag.fb-head.ok { color: var(--on-ok); background: var(--ok); }
.tag.fb-head.bad { color: var(--on-bad); background: var(--bad); }
.tag.fb-head.copied, .tag.fb-head.hint { color: var(--on-warn); background: var(--warn); }
/* 총정리에서 맞힘: 주황 불꽃 (app.js fireLabel). 글자 뒤로 불씨가 두 개 피어오르고, 표시는 숨 쉬듯 달아오름 */
:root:root .tag.fb-head.ok.fire:not([hidden]) { /* :root:root = '재밌게' 반응의 통통 튀기보다 앞서게 */
  color: #fff; background: linear-gradient(135deg, #ff9a1f 0%, #ff6a00 55%, #f2470b 100%);
  position: relative; overflow: visible; isolation: isolate;
  animation: fire-pop .45s cubic-bezier(.3, 1.6, .5, 1), fire-glow 1.4s ease-in-out .45s infinite alternate;
}
.tag.fb-head.ok.fire::before, .tag.fb-head.ok.fire::after {
  content: ''; position: absolute; z-index: -1; bottom: 55%; width: 7px; height: 7px; border-radius: 50% 50% 50% 0;
  background: radial-gradient(circle at 40% 40%, #ffe27a, #ff8a00 60%, transparent 70%); transform: rotate(-45deg);
  opacity: 0; animation: ember 1.1s ease-out .15s infinite;
}
.tag.fb-head.ok.fire::before { left: 22%; }
.tag.fb-head.ok.fire::after { left: 68%; width: 5px; height: 5px; animation-delay: .6s; }
@keyframes fire-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes fire-glow { from { box-shadow: 0 0 6px 0 rgba(255, 120, 20, .45); } to { box-shadow: 0 0 14px 3px rgba(255, 90, 0, .55); } }
@keyframes ember { 0% { opacity: 0; transform: translateY(6px) rotate(-45deg) scale(.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-16px) rotate(-45deg) scale(1); } }
:root[data-react="calm"] .tag.fb-head.ok.fire::before, :root[data-react="calm"] .tag.fb-head.ok.fire::after { display: none; }
@media (prefers-reduced-motion: reduce) {
  .tag.fb-head.ok.fire { animation: none !important; box-shadow: 0 0 10px 2px rgba(255, 100, 10, .45); }
  .tag.fb-head.ok.fire::before, .tag.fb-head.ok.fire::after { display: none; }
}
.q-prompt.my-answer { color: var(--bad); font-weight: 700; font-size: 15px; letter-spacing: 0; }
/* 오타를 봐주고 맞힘: 바른 철자만 조용히 (app.js showFeedback) */
.q-prompt.spell-note { color: var(--muted); font-weight: 600; font-size: 14px; letter-spacing: 0; }
/* 단어·탭·계속하기는 고정, 뜻/예문 내용만 스크롤 */
.sheet-inner > * { flex: none; }
.sheet-inner > .fb-pane { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
/* 폰: 스크롤 막대가 카드 오른쪽 위에 겹쳐 그려져서 숨김 (컴퓨터는 막대가 따로 자리를 차지해서 그대로) */
:root:not(.desk) .sheet-inner > .fb-pane, :root:not(.desk) .ask-log { scrollbar-width: none; }
:root:not(.desk) .sheet-inner > .fb-pane::-webkit-scrollbar, :root:not(.desk) .ask-log::-webkit-scrollbar { display: none; }
.grab { width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 12px; }
/* 정답 시트의 막대는 끌 수 있는 손잡이: 보이는 막대는 그대로, 누르는 자리만 위아래로 넓게 (app.js setupSheetDrag) */
button.grab { display: block; border: 0; padding: 0; position: relative; cursor: grab; touch-action: none; flex: none; }
button.grab::after { content: ''; position: absolute; inset: -12px -40px; }
#feedback .fb-word { touch-action: none; }
.sheet-inner.dragging { transition: none !important; cursor: grabbing; }
.sheet-inner:not(.dragging) { transition: transform .25s cubic-bezier(.22, 1, .36, 1); }
/* 접힘: 단어 줄과 '계속하기'만 (뒤의 예문이 다시 보임) */
#feedback.peek .fb-tabs, #feedback.peek .fb-pane, #feedback.peek #fb-pron { display: none; }
#feedback.peek.peek[data-tab] .sheet-inner { height: auto; max-height: none; } /* AI 대화 중(.chatting)의 높이보다 앞서게 */
#feedback.peek .fb-actions { margin-top: 10px; }
/* 퀴즈 중엔 당겨서 새로고침 막기 (app.js show) */
html.no-ptr, html.no-ptr body { overscroll-behavior-y: none; }
.fb-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 12px 0 14px; }
.fb-tabs button { border: 0; background: none; padding: 8px 2px; font-size: 16px; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.fb-tabs button.on { color: var(--text); border-bottom-color: var(--text); }
.fb-card { background: var(--fill); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: 10px; }
.fb-meaning { font-size: calc(20px * var(--fz)); font-weight: 700; line-height: 1.5; letter-spacing: -.2px; margin: 6px 0 4px; white-space: pre-line; }
.fb-tags { display: flex; gap: 6px; justify-content: flex-end; }
.fb-pane .sent { background: var(--bg); box-shadow: none; }
.fb-pane .sent .en { font-size: calc(17px * var(--fz)); }
.extras.fb-card { font-size: calc(14px * var(--fz)); }
.extras.fb-card div { margin-bottom: 4px; }
#q-sentences.answered.ok .blank.filled { background: rgba(18, 184, 134, .2); }
#q-sentences.answered.bad .blank.filled { background: rgba(250, 82, 82, .16); }

/* 정답 화면 아래: 🔊 + 계속하기 */
.fb-actions { display: flex; gap: 10px; margin: 10px 0 4px; }
.mark-btn.speak-ic { background: var(--primary-soft); color: var(--primary); }
.mark-btn.speak-ic .ic { position: relative; z-index: 1; width: 19px; height: 19px; }
.mark-btn.speak-ic:active { transform: scale(.92); }
.fb-actions .next-btn { flex: 1; margin: 0; }

/* 오늘의 학습 */
.today { padding: 22px 20px 20px; }
.today-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.today-head .label { margin: 0; font-size: 15px; }
/* 오늘 할 개수: 숫자는 크고 굵게, 이름은 작고 흐리게 */
.plan { display: flex; gap: 32px; margin: 14px 0 22px; }
.plan > div, .plan > .editable { text-align: left; font-size: 14px; color: var(--muted); }
.plan b { display: block; font-size: 40px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; color: var(--text); margin-bottom: 4px; }
.today .btn { margin-bottom: 6px; }
#stage-extra .row.two { margin-bottom: 6px; }
.flow { display: flex; align-items: center; gap: 7px; margin: 6px 0 0; font-size: 13px; color: var(--muted); }
.flow i { font-size: 0; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; } /* › 대신 작은 점 */
.flow span.done::before { content: '✓ '; }
.flow span.on { color: var(--primary); font-weight: 700; }
#today-note { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
#today-note:empty { display: none; }
.exam-row, #plan-goal-row { gap: 8px; }
.date-input { flex: 1; padding: 11px 12px; border-radius: var(--r-md); border: 0; background: var(--fill); font-size: 16px; min-width: 0; }
.tag.dday { color: var(--on-bad); background: var(--bad); }

@media (prefers-reduced-motion: reduce) {
  .sheet-inner, #q-sentences.answered .sent, #q-sentences.answered .blank.filled, .tag.fb-head { animation: none !important; }
}


/* 예문 ↔ 단어 모드 전환 (index.html · meaning.html 머리에 같은 모양, 같은 자리) */
.mode-switch{position:relative;display:flex;gap:2px;padding:2px;background:var(--fill);border-radius:var(--r-pill);flex:none}
.mode-thumb{position:absolute;top:2px;left:2px;width:34px;height:28px;border-radius:var(--r-pill);background:var(--thumb);
  transition:transform .2s cubic-bezier(.2,.8,.2,1);view-transition-name:mode-thumb}
.mode-switch[data-mode="wd"] .mode-thumb{transform:translateX(36px)}
.mode-switch a{position:relative;z-index:1;display:flex;align-items:center;justify-content:center;width:34px;height:28px;border-radius:var(--r-pill);color:var(--muted);opacity:.75;transition:color .2s,opacity .2s}
.mode-switch a.on{color:var(--text2);opacity:1}
.mode-switch a:not(.on):active{opacity:.6}
.mode-switch a[data-m="ex"]{view-transition-name:mode-ex}
.mode-switch a[data-m="wd"]{view-transition-name:mode-wd}
.mode-switch svg{width:17px;height:17px}
/* 예문 ↔ 단어 페이지 사이 전환 */
@view-transition{navigation:auto}
::view-transition-old(root),::view-transition-new(root){animation-duration:.22s}
::view-transition-group(mode-thumb){animation-duration:.3s;animation-timing-function:cubic-bezier(.2,.8,.2,1)}
@media (prefers-reduced-motion:reduce){
  .mode-thumb{transition:none}
  ::view-transition-group(*),::view-transition-old(*),::view-transition-new(*){animation:none!important}
}

/* ---------- 단어 모드 (./?m=word): 화면은 같고 색만 예전 뜻 퀴즈 색 (종이색 바탕 · 먹색 버튼) ---------- */
:root[data-mode="word"] [data-only="ex"], :root:not([data-mode="word"]) [data-only="word"] { display: none !important; }
:root[data-mode="word"] {
  --bg: #f7f6f1; --card: #ffffff; --text: #1a1a17; --text2: #55544c; --muted: #8f8e85; --line: #e4e2d9; --fill: #f1efe8;
  --primary: #1a1a17; --primary-soft: #efeee7; --on-primary: #f7f6f1;
  --ok: #166f4a; --ok-soft: #e2f1e9; --bad: #a8352d; --bad-soft: #fbe6e3; --warn: #8d6009;
  --blank: #ebe6d6; --mark-bg: #ebe6d6; --mark-top: 58%;
  --danger: #d9342b; --danger-soft: #fbe6e3;
  --glow-0: #f7f6f1; --glow-1: #f7f6f1; /* 단어 모드는 바탕 단색 */
  --shadow-soft: 0 2px 10px rgba(26, 26, 23, .07);
}
:root[data-mode="word"][data-theme="dark"] {
  --bg: #17171a; --card: #222226; --text: #f0efe9; --text2: #bdbbb2; --muted: #87857c; --line: #33333a; --fill: #2c2c31;
  --primary: #f0efe9; --primary-soft: #2a2a30; --on-primary: #17171a;
  --ok: #63c99b; --ok-soft: #14281f; --bad: #f08c82; --bad-soft: #2e1815; --warn: #e0b45c;
  --blank: #3a3a42; --mark-bg: rgba(110, 225, 170, .4); --mark-top: 50%;
  --danger: #e5484d; --danger-soft: #3a1c1c;
  --glow-0: #17171a; --glow-1: #17171a;
  --shadow-soft: none;
  --key-bg: var(--card); --key-fn: var(--line); /* 단어 모드는 바탕 단색이라 그대로 */
  --thumb: #3a3a42;
}
/* 카드 구분: 평평하게(기본, 바탕색 차이만) · 그림자 · 얇은 테두리. 설정 > 화면 > 카드 */
:root[data-edge="shadow"] { --shadow: var(--shadow-soft); }
:root[data-edge="line"] { --shadow: none; }
:root[data-edge="line"] .card, :root[data-edge="line"] .sent, :root[data-edge="line"] .item { border: 1px solid var(--line); }
:root[data-edge="line"] .day:not(.solo) { border-color: var(--line); }
:root[data-edge="line"] .fb-pane .sent, :root[data-edge="line"] .fb-card, :root[data-edge="line"] .item .detail .sent { border: 0; }
:root[data-mode="word"] .choice { font-size: calc(16px * var(--fz)); line-height: 1.45; }
:root[data-mode="word"] .toast { box-shadow: 0 6px 20px rgba(0, 0, 0, .18); }

/* 단어 모드 문제: 단어를 크게 */
.word-card { position: relative; text-align: center; padding: 34px 18px 30px; }
.word-card .qw { font-size: calc(36px * var(--fz)); font-weight: 800; letter-spacing: -.5px; line-height: 1.2; word-break: break-word; }
.word-card .pron { color: var(--muted); font-size: 14px; margin-top: 4px; }
.word-card .speak { position: absolute; top: 12px; right: 12px; }
@media (min-width: 700px) { .word-card .qw { font-size: calc(46px * var(--fz)); } }

/* 단어장: 유의어(초록) · 반의어(빨강), 형광펜 표시 */
.item .rel { font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.open .rel { white-space: normal; }
.item .rel span + span { margin-left: 10px; }
.item .rel b { font-size: 11px; font-weight: 800; border-radius: var(--r-xs); padding: 0 4px; margin-right: 4px; }
.rel .syn, .syn-t { color: var(--ok); }
.rel .syn b { background: var(--ok-soft); }
.rel .ant, .ant-t { color: var(--bad); }
.rel .ant b { background: var(--bad-soft); }
.mark-btn { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; background: var(--fill); color: var(--muted); border-radius: 50%; padding: 0; }
.mark-btn svg { width: 19px; height: 19px; }
.mark-btn { position: relative; overflow: hidden; isolation: isolate; }
.mark-btn svg { position: relative; z-index: 1; }
/* 칠한 바탕은 ::before: 칠할 때 왼쪽에서 오른쪽으로 쓱, 지울 때 오른쪽으로 빠짐 (app.js가 swipe·wipe를 붙임) */
.mark-btn::before { content: ''; position: absolute; inset: 0; background: var(--mark-bg); transform: scaleX(0); transform-origin: left; }
.mark-btn.on { border-color: transparent; color: var(--text); }
.mark-btn.on::before { transform: scaleX(1); }
.mark-btn.swipe { animation: mark-pop .42s cubic-bezier(.3, 1.5, .5, 1); }
.mark-btn.swipe::before { animation: mark-in .3s cubic-bezier(.4, 0, .2, 1) both; }
.mark-btn.swipe svg { animation: mark-pen .42s ease-out; }
.mark-btn.wipe::before { transform-origin: right; animation: mark-out .26s ease-in both; }
@keyframes mark-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes mark-out { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes mark-pop { 0% { transform: scale(1); } 45% { transform: scale(1.16); } 100% { transform: scale(1); } }
@keyframes mark-pen { 0% { transform: translateX(-7px) rotate(-14deg); } 55% { transform: translateX(4px) rotate(8deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .mark-btn.swipe, .mark-btn.swipe::before, .mark-btn.swipe svg, .mark-btn.wipe::before { animation: none; } }
/* 형광펜 친 단어는 단어에 형광펜 */
.item.hl .w { background: linear-gradient(transparent var(--mark-top), var(--mark-bg) var(--mark-top)); border-radius: 2px; padding: 0 2px; }
.list-note { font-size: 12px; margin: -4px 2px 10px; }
#list .seg button { padding: 8px 2px; font-size: 14px; }
/* DAY 단독 학습: 고른 DAY 박스와 위 카드의 시작 버튼을 같은 주황으로 묶어서 특별하게 */
.day.solo { border-color: var(--solo); background: var(--solo-soft); box-shadow: 0 4px 14px var(--solo-glow); }
.day.solo b { color: var(--solo); }
.day.solo .bar-fill { background: var(--solo); }
#card-today.solo-mode { background: var(--solo-soft); --go-bg: var(--solo); --go-fg: var(--on-solo); }
/* 오늘 카드 = 시작 버튼 (.go, app.js renderPlan): 시작 버튼을 카드 크기로 밑에 깔고 내용은 그 위에 (누르면 아래 버튼이 눌림).
   숫자 옆 ✎ · 학습/복습/더 하기 이동 · 정규 학습으로 · 기록 지우기만 위에서 따로 눌림 */
.today { --go-bg: var(--primary); --go-fg: var(--on-primary); position: relative; isolation: isolate; transition: background-color .2s; }
.go-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.today-go { display: none; }
.today .stretch:disabled { background: var(--fill); color: var(--muted); opacity: 1; }
#card-today.go { background: var(--go-bg); color: var(--go-fg); }
.today.go .today-head, .today.go .flow, .today.go .go-row, .today.go #today-note, .today.go .day-reset { position: relative; z-index: 1; pointer-events: none; }
.today.go .editable, .today.go .flow span.link, .today.go .today-head button, .today.go .day-reset { pointer-events: auto; }
.today.go .stretch {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; margin: 0; padding: 0;
  border-radius: inherit; background: transparent; color: transparent; font-size: 0; transform: none;
}
.today.go .stretch:active { background: rgba(0, 0, 0, .08); }
.today.go:has(.stretch:focus-visible) { outline: 3px solid var(--go-bg); outline-offset: 3px; }
.today.go .stretch:focus-visible { outline: none; }
.today.go .label, .today.go .flow, .today.go .plan > *, .today.go #today-note, .today.go .day-reset, .today.go .edit-ic { color: var(--go-fg); opacity: .78; }
.today.go .plan > * { opacity: 1; }
.today.go .plan > * { color: color-mix(in srgb, var(--go-fg) 78%, transparent); }
.today.go .plan b, .today.go .flow span.on { color: var(--go-fg); }
.today.go .flow span.link { text-decoration-color: color-mix(in srgb, var(--go-fg) 40%, transparent); }
.today.go .tag { background: color-mix(in srgb, var(--go-fg) 18%, transparent); color: var(--go-fg); }
.today.go .today-head .btn.ghost { color: var(--go-fg); }
.today.go .plan { margin-bottom: 4px; }
.today.go .today-go { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 16px; font-weight: 700; white-space: nowrap; }
.today.go .today-go .chev { color: inherit; opacity: 1; font-size: 26px; margin-top: -2px; }
.today.go #today-note { margin-top: 12px; }
#card-today.solo-mode #today-title { color: var(--solo); }
#btn-day { background: var(--solo); color: var(--on-solo); box-shadow: 0 6px 18px var(--solo-glow); }
.today-head .btn.small { min-height: 30px; padding: 0 10px; font-size: 13px; margin: 0; }
.dim { opacity: .4; filter: grayscale(1); pointer-events: none; }
.faded { opacity: .45; filter: grayscale(1); }

/* 홈의 학습 계획 요약 카드: 누르면 학습 계획 화면 */
/* 학습 계획 요약: 카드 전체가 버튼 (범위는 크게, 나머지는 한 줄로 작게) */
.plan-sum { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.plan-sum:active { background: var(--fill); }
.plan-sum-main { flex: 1; min-width: 0; display: block; }
.plan-sum .label { display: block; margin: 0 0 4px; }
.plan-sum-text { display: block; }
.plan-sum-range { display: block; font-size: 20px; font-weight: 700; letter-spacing: -.3px; }
.plan-sum-desc { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); word-break: keep-all; }
.chev { flex: none; font-style: normal; font-size: 22px; line-height: 1; color: var(--muted); opacity: .7; }
/* 암기 완료 카드 */
.prog-num { margin: 0 0 14px; color: var(--muted); font-size: 18px; font-weight: 600; }
.prog-num b { font-size: 32px; font-weight: 800; letter-spacing: -.8px; color: var(--text); }
.range-sum { margin-top: 12px; }
/* 바로가기 목록 (버튼처럼 보이지 않게 줄로) */
.card.menu { padding: 6px 0; }
.menu-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; padding: 0 20px; border: 0; background: none; color: var(--text); font-size: 16px; font-weight: 500; text-align: left; }
.menu-row:active { background: var(--fill); }
.menu-row:disabled { color: var(--muted); }
.menu-row:disabled .chev { opacity: .35; }
.menu-end { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; }
#range-practice.dim { filter: none; }
/* 단어장: 볼 DAY 고르기 (가로로 넘기는 한 줄) · DAY 제목 */
.day-pick { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 10px; padding: 2px 16px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.day-pick::-webkit-scrollbar { display: none; }
/* 컴퓨터는 마우스 휠로 옆으로 못 넘기니 DAY 줄·설정 바로가기를 여러 줄로 다 보여 줌 */
.desk .day-pick { flex-wrap: wrap; overflow: visible; margin: 0 0 10px; padding: 2px 0 4px; }
.dp { flex: none; min-width: 42px; padding: 0 10px; color: var(--muted); font-weight: 700; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; margin: 22px 4px 8px; }
.day-head b { font-size: 15px; font-weight: 800; }
.day-head span { font-size: 12px; color: var(--muted); margin-left: 8px; }
#word-list .day-head:first-child { margin-top: 4px; }

/* 원형까지 맞게 썼을 때: 확인 버튼이 톡 튀며 빛나고, 0.8초 동안 차오른 뒤 넘어감 */
#q-actions .key.enter.ready, #q-actions .btn.primary.ready {
  position: relative; overflow: hidden; background: var(--ok); color: var(--on-ok); font-weight: 800;
  box-shadow: 0 0 0 3px rgba(var(--ok-glow), .45), 0 0 22px 6px rgba(var(--ok-glow), .55);
  animation: ready-pop .28s cubic-bezier(.3, 1.6, .5, 1), ready-glow .5s ease-in-out .28s infinite alternate;
}
#q-actions .key.enter.ready::after, #q-actions .btn.primary.ready::after {
  content: ""; position: absolute; inset: 0; background: rgba(255, 255, 255, .32);
  transform-origin: left; transform: scaleX(0); animation: ready-fill var(--pause, 800ms) linear forwards;
}
@keyframes ready-pop { 0% { transform: scale(1); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes ready-glow { to { box-shadow: 0 0 0 5px rgba(var(--ok-glow), .3), 0 0 30px 10px rgba(var(--ok-glow), .7); } }
@keyframes ready-fill { to { transform: scaleX(1); } }

/* 직접 입력 오답 풀이 말풍선: 철자·형태(노랑) · 뜻이 통하는 말(초록) */
.coach {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin-bottom: 8px;
  border: 0; border-radius: var(--r-lg); color: var(--text); font-size: 15px; line-height: 1.5;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14); animation: coach-in .22s ease-out;
  pointer-events: none; transition: opacity .3s ease, transform .3s ease; /* 눌러도 아래(키보드·문장)가 그대로 눌림 */
}
.kb-mode .coach { position: absolute; left: 8px; right: 8px; bottom: calc(100% + 8px); margin: 0; }
.desk .kb-mode .coach { position: static; margin: 10px 0 0; } /* 컴퓨터: 예문 박스를 가리지 않게 안내 줄 아래로 */
.coach.spell { background: var(--spell-soft); border-color: var(--spell); }
.coach.near { background: var(--ok-soft); border-color: var(--ok); }
.coach.off { background: var(--bad-soft); border-color: var(--bad); } /* AI 풀이일 때만 */
.coach.wait { background: var(--card); border-color: var(--line); color: var(--muted); }
.coach.wait .coach-ic { animation: coach-think 1s ease-in-out infinite alternate; }
@keyframes coach-think { to { opacity: .35; } }
.coach-ic { font-size: 18px; line-height: 1.35; flex: none; }
.coach-msg { flex: 1; min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
.coach-diff { font-weight: 700; letter-spacing: .03em; }
.coach-diff b { color: var(--bad); font-weight: 800; }
@keyframes coach-in { from { opacity: 0; transform: translateY(6px); } }
.coach.out { opacity: 0; transform: translateY(6px); }
.app-ver { margin: 0 0 8px; font-size: 15px; }
.extra-range { display: flex; align-items: center; gap: 12px; margin: -2px 2px 10px; }
.extra-range input { flex: 1; margin: 0; }
.extra-range b { min-width: 44px; text-align: right; font-size: 15px; }
/* 막대 두 겹: 학습(연하게) 위에 암기 완료(진하게) */
.bar.two { display: grid; }
.bar.two > .bar-fill { grid-area: 1 / 1; }
.bar-fill.seen { opacity: .35; }

/* 설정: 복습 방식(주기 복습) */
.srs-desc { font-size: 13px; margin: 2px 0 10px; }
.srs-dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: end; }
.srs-dates label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; color: var(--muted); min-width: 0; }
/* iPad·아이폰 사파리의 날짜 칸은 자체 최소 너비가 있어서 옆 칸·카드 밖으로 삐져나감 → 기본 모양을 끄고 칸 너비에 맞춤 */
.srs-dates .date-input {
  display: block; width: 100%; max-width: 100%; min-width: 0; overflow: hidden;
  -webkit-appearance: none; appearance: none; color: var(--text); text-align: left; min-height: 46px;
}
.date-input::-webkit-date-and-time-value { text-align: left; }
/* 학습 계획의 날짜 줄: 이름(왼쪽) ─ 날짜 칸(오른쪽) */
.date-row .row-date {
  flex: 0 0 auto; width: 9.5em; min-width: 0; max-width: 60%; margin-left: auto; min-height: 40px; padding: 8px 12px;
  -webkit-appearance: none; appearance: none; color: var(--text); font-size: 15px; text-align: left; overflow: hidden;
}
.date-row .t { cursor: pointer; flex-basis: 0; } /* 설명이 길면 글자가 줄바꿈되고 날짜 칸은 오른쪽에 */
.date-row .mark-btn { width: 34px; height: 34px; }
.date-row .mark-btn .ic { width: 16px; height: 16px; position: relative; z-index: 1; }
#exam-dn { color: var(--primary); font-weight: 700; }
.srs-warn { font-size: 13px; color: var(--warn); margin: 8px 0 0; }
.key-err { white-space: pre-line; overflow-wrap: anywhere; margin: 0 0 8px; }
.srs-graph svg { width: 100%; max-width: 520px; height: auto; display: block; margin: 0 auto 8px; } /* 넓은 화면에서 글자가 커지지 않게 */
.srs-graph .g-grid { stroke: var(--line); stroke-dasharray: 2 4; }
.srs-graph .g-ax, .srs-graph .g-leg text { fill: var(--muted); font-size: 10px; }
.srs-graph .g-none { fill: none; stroke: var(--muted); stroke-width: 2; opacity: .45; }
.srs-graph .g-rev { fill: none; stroke: var(--ok); stroke-width: 2.5; stroke-linejoin: round; }
.srs-graph .g-dot { fill: var(--ok); }
.srs-graph .g-off { fill: var(--muted); opacity: .45; }
.srs-presets { display: flex; flex-direction: column; margin-bottom: 4px; }
.preset { display: flex; align-items: center; gap: 10px; padding: 12px 2px; border: 0; background: transparent; color: var(--text); text-align: left; }
.preset:last-child { border-bottom: 0; }
.preset .p-name { font-weight: 700; font-size: 15px; min-width: 64px; }
.preset .p-days { flex: 1; font-size: 12px; color: var(--muted); }
.preset .p-tag { font-size: 12px; color: var(--muted); }
.preset .p-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.preset.on .p-radio { border-color: var(--primary); box-shadow: inset 0 0 0 4px var(--card); background: var(--primary); }

/* ---------- 컴퓨터 (마우스·키보드) ---------- */
/* 화면 키보드 없이 실제 키보드로: 빈칸에 바로 써지고, 아래 칸은 안내·힌트만 */
.desk .kb { display: none; }
.desk .kb-mode .quiz-actions { position: relative; left: auto; right: auto; bottom: auto; max-width: none; margin: 0; padding: 8px 0 0; background: none; border-top: 0; }
.desk .kb-top { padding: 0; }
.desk .touch-only { display: none; }
html:not(.desk) .desk-only { display: none; }
/* 설정 > 단축키: 버튼을 누르고 쓸 키를 누름 */
.key-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); column-gap: 20px; margin-bottom: 10px; }
.key-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 15px; }
.key-chip { min-width: 64px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-bottom-width: 3px; border-radius: var(--r-sm); background: var(--card); color: var(--text); font-family: inherit; font-size: 13px; font-weight: 700; line-height: 1; cursor: pointer; }
.key-chip:hover { border-color: var(--primary); }
.key-chip.none { color: var(--muted); font-weight: 500; }
.key-chip.listening { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.key-chip.fixed { display: inline-grid; place-items: center; color: var(--muted); cursor: default; }
.key-chip.fixed:hover { border-color: var(--line); }
/* 화면 키보드가 없으니 문제를 위아래 가운데로 (아래가 휑하지 않게) */
.desk #quiz.active { display: flex; flex-direction: column; }
.desk #quiz.active > .quiz-body { margin-top: auto; }
.desk #quiz.active > .quiz-actions { margin-bottom: auto; padding-bottom: 24px; }
.home-main, .home-side { min-width: 0; }
@media (min-width: 1000px) {
  .desk .screen { max-width: 1160px; padding: 24px 40px 40px; }
  .desk #settings, .desk #plan, .desk #list, .desk #result { max-width: 800px; }
    .desk .days { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  /* 퀴즈: 왼쪽 문제, 오른쪽 정답 풀이 */
  /* 위·아래 빈 줄(1fr)로 문제와 정답 풀이를 화면 가운데에 */
  .desk #quiz.active { display: grid; grid-template-columns: minmax(0, 1fr) 400px; grid-template-rows: auto 1fr auto auto 1fr; column-gap: 32px; align-items: start; }
  .desk #quiz > .quiz-top { grid-column: 1 / -1; grid-row: 1; }
  .desk #quiz.active > .quiz-body { grid-column: 1; grid-row: 3; margin-top: 0; }
  .desk #quiz.active > .quiz-actions { grid-column: 1; grid-row: 4; margin-bottom: 0; }
  .desk #quiz > .sheet { grid-column: 2; grid-row: 3 / span 2; align-self: center; position: relative; left: auto; right: auto; bottom: auto; z-index: 1; display: block; }
  .desk .sheet-inner { max-width: none; max-height: calc(100dvh - 120px); border-radius: var(--r-xl); padding: 18px 18px 16px; box-shadow: 0 8px 28px rgba(15, 30, 60, .12); animation: fb-in .25s ease-out; }
  .desk .grab { display: none; }
  .desk #quiz > .coach { grid-column: 2; grid-row: 3 / span 2; align-self: center; margin: 0; } /* 오답 풀이 말풍선은 오른쪽 빈 칸(정답 풀이 자리)에 */
  .desk .quiz-actions { max-width: none; }
}
@keyframes fb-in { from { opacity: 0; transform: translateX(12px); } }
.day-head .day-del { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 2px 4px; text-decoration: underline; }
.day-head .day-del:hover { color: var(--danger); }

/* 맨 위 카드: 누르면 개수를 정하는 숫자 */
.plan > .editable { border: 0; background: none; padding: 0; margin: 0; cursor: pointer; border-radius: var(--r-sm); }
.plan > .editable:active { opacity: .6; }
.plan > .editable .edit-ic { display: inline-block; margin-left: 4px; vertical-align: -1px; color: var(--muted); opacity: .8; }
.plan > .editable .edit-ic .ic { width: 13px; height: 13px; }
/* 앱 안 숫자 키패드 */
.numpad-card { max-width: 340px; }
.np-display { display: flex; align-items: baseline; justify-content: center; gap: 4px; margin: 6px 0 2px; }
.np-display b { font-size: 44px; font-weight: 800; letter-spacing: .02em; min-width: 1ch; }
.np-display span { color: var(--muted); }
.np-hint { font-size: 12px; margin-bottom: 10px; text-wrap: balance; word-break: keep-all; }
.np-chips { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.np-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.np-key { height: 52px; border: 0; border-radius: var(--r-md); background: var(--bg); color: var(--text); font-size: 22px; font-weight: 600; }
.np-key:active { background: var(--primary-soft); }
.np-key.fn { font-size: 18px; }
.np-key.blank-key { visibility: hidden; }
.desk .np-keys { display: none; } /* 컴퓨터는 실제 키보드로 */
.flow span.link { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line); }
.flow span.link:hover { color: var(--primary); }
#btn-start:disabled, #btn-review:disabled { opacity: .55; }
.day-reset { display: block; margin: 2px auto 0; border: 0; background: transparent; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; padding: 4px 8px; }
.day-reset:hover { color: var(--danger); }

/* 원형까지 맞게 썼을 때 예문 박스 테두리도 0.8초 동안 초록 게이지가 한 바퀴 차오름 */
@property --sweep { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
#q-sentences .sent.ready { position: relative; box-shadow: 0 0 0 3px rgba(var(--ok-glow), .18), 0 0 18px 2px rgba(var(--ok-glow), .25); }
#q-sentences .sent.ready::after {
  content: ""; position: absolute; inset: -2px; border-radius: calc(var(--r-xl) + 2px); padding: 3px; pointer-events: none;
  background: conic-gradient(from 0deg, var(--ok) var(--sweep), transparent 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: sent-sweep var(--pause, 800ms) linear forwards;
}
@keyframes sent-sweep { to { --sweep: 360deg; } }
@media (prefers-reduced-motion: reduce) { #q-sentences .sent.ready::after { animation: none; --sweep: 360deg; } }
/* 힌트를 쓴 단어는 게이지를 노랑으로 (정답 화면의 '힌트 사용' 표시와 같은 색) */
#q-actions .key.enter.ready.hinted, #q-actions .btn.primary.ready.hinted {
  background: var(--hint-c); color: var(--on-hint);
  box-shadow: 0 0 0 3px rgba(var(--hint-glow), .45), 0 0 22px 6px rgba(var(--hint-glow), .55);
  animation: ready-pop .28s cubic-bezier(.3, 1.6, .5, 1), ready-glow-hint .5s ease-in-out .28s infinite alternate;
}
@keyframes ready-glow-hint { to { box-shadow: 0 0 0 5px rgba(var(--hint-glow), .3), 0 0 30px 10px rgba(var(--hint-glow), .7); } }
#q-sentences .sent.ready.hinted { box-shadow: 0 0 0 3px rgba(var(--hint-glow), .2), 0 0 18px 2px rgba(var(--hint-glow), .3); }
#q-sentences .sent.ready.hinted::after { background: conic-gradient(from 0deg, var(--hint-c) var(--sweep), transparent 0); }

/* 정답 시트 탭마다 크기: 뜻은 내용만큼(62dvh까지), 예문은 조금 더, AI는 대화창처럼 높게 고정 */
#feedback[data-tab="ex"] .sheet-inner { max-height: 72dvh; }
#feedback[data-tab="ai"].chatting .sheet-inner { height: 82dvh; max-height: 82dvh; }
.desk #feedback[data-tab="ai"].chatting .sheet-inner { height: calc(100dvh - 120px); max-height: calc(100dvh - 120px); }
/* AI 탭: 빠른 질문·입력칸은 아래에 고정, 이야기만 스크롤. 계속하기 줄은 낮게 */
.sheet-inner > #fb-ai:not([hidden]) { display: flex; flex-direction: column; overflow: hidden; }
#feedback[data-tab="ai"] .fb-tabs { margin-bottom: 10px; }
#feedback[data-tab="ai"] .fb-actions .next-btn { height: 46px; padding-top: 0; padding-bottom: 0; font-size: 16px; }
#feedback[data-tab="ai"] .fb-actions { margin-top: 10px; }
/* 폰에서 AI 칸에 쓰는 중: 키보드 위로 시트를 채우고, 단어 머리는 작게, 아래 버튼 줄은 숨김 */
#feedback.typing .sheet-inner { animation: none; border-radius: var(--r-xl) var(--r-xl) 0 0; }
#feedback.typing .grab, #feedback.typing .fb-actions, #feedback.typing #fb-pron { display: none; }
#feedback.typing .fb-word .w { font-size: min(22px, var(--w-fit, 30px)); }
#feedback.typing .fb-tabs { margin: 6px 0 8px; }
/* 'AI에게 묻기': 코치 탭처럼 위에서부터 주고받은 이야기 → 빠른 질문 → 입력칸 */
.ask { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.ask > .chips, .ask > .ask-form { flex: none; }
.ask-log { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; gap: 8px; padding: 2px 0 4px; }
.ask-log:empty::before { content: '이 단어에 대해 궁금한 걸 물어보면 여기에 답이 와요'; color: var(--muted); font-size: 13px; padding: 2px 4px; }
/* 이야기가 생기면 빠른 질문은 한 줄로 옆으로 밀어 보게 (이야기 칸을 넓게) */
.ask.chatting > .ask-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 0 2px; }
.ask.chatting > .ask-chips::-webkit-scrollbar { display: none; }
.ask.chatting > .ask-chips .chip { flex: none; }
.ask-msg { flex: none; max-width: 92%; padding: 9px 12px; border-radius: var(--r-md); line-height: 1.6; white-space: pre-line; overflow-wrap: anywhere; font-size: calc(15px * var(--fz)); }
.ask-msg.me { align-self: flex-end; background: var(--primary); color: var(--card); }
.ask-msg.ai { align-self: flex-start; background: var(--bg); }
.ask-msg.wait { color: var(--muted); }
/* 받는 중: 처음엔 점 세 개, 글이 오기 시작하면 끝에 깜빡이는 막대 (코치 탭과 같음) */
.ask-msg.typing { display: flex; gap: 4px; padding: 14px; }
.ask-msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: chat-dot 1s infinite ease-in-out; }
.ask-msg.typing i:nth-child(2) { animation-delay: .15s; }
.ask-msg.typing i:nth-child(3) { animation-delay: .3s; }
.ask-msg.live::after { content: ''; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--muted); animation: chat-caret 1s steps(1) infinite; }
@media (prefers-reduced-motion: reduce) { .ask-msg.typing i, .ask-msg.live::after { animation: none; } }
.ask-msg.err { color: var(--danger); }
.ask-chips { margin-top: 0; }
.ask-form { display: flex; gap: 6px; align-items: center; }
.ask-form input { flex: 1; min-width: 0; padding: 10px 16px; border: 1.5px solid transparent; border-radius: 22px; background: var(--fill); color: var(--text); font-size: 16px; }
.ask-form input:focus { outline: none; border-color: var(--primary); }
.ask-form .btn { width: auto; flex: none; margin-bottom: 0; }
.q-tools { display: flex; gap: 6px; flex-wrap: wrap; }
#btn-hint:not(.say), #btn-idk, .kb-hint:not(.say) { width: 40px; min-width: 40px; padding: 0; border-radius: 50%; }
#btn-hint:not(.say) .lbl, #btn-idk .lbl, .kb-hint:not(.say) .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#btn-hint .ic, #btn-idk .ic, .kb-hint .ic { width: 21px; height: 21px; }
.q-tools #btn-hint, .q-tools #btn-idk { background: var(--card); color: var(--text2); }
.q-tools .btn { width: auto; margin-bottom: 0; }
#btn-idk { color: var(--muted); }

/* ---------- 유반의어 테스트 ---------- */
/* 유의어 = 파랑, 반의어 = 빨강 (DAY 박스를 왼쪽으로 밀 때 띠도 파랑→빨강), 학습 = 초록 */
.tag.kind-tag.syn { color: var(--swipe-text); background: var(--syn-c); }
.tag.kind-tag.ant { color: var(--swipe-text); background: var(--ant-c); }
#q-sentences .sent .en u.ul { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; font-weight: 800; }
.word-card.syn-shown { padding: 28px 18px 26px; }
.word-card.syn-shown .qw { font-size: calc(26px * var(--fz)); line-height: 1.35; }
@media (min-width: 700px) { .word-card.syn-shown .qw { font-size: calc(32px * var(--fz)); } }
.fb-card.opts > b { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.fb-card.opts .opt { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; font-size: 15px; }
.fb-card.opts .opt b { flex: none; }
.fb-card.opts .opt .muted { font-size: 13px; min-width: 0; }
.fb-card.opts .opt-ic { flex: none; width: 14px; text-align: center; color: var(--muted); font-weight: 800; }
.fb-card.opts .opt.ok .opt-ic, .fb-card.opts .opt.ok b { color: var(--ok); }
.fb-card.opts .opt.picked .opt-ic, .fb-card.opts .opt.picked b { color: var(--bad); }

/* DAY 박스 옆으로 밀기: 뒤에 깔린 띠가 드러남 (왼쪽으로 밀면 오른쪽에 유반의어, 오른쪽으로 밀면 왼쪽에 학습) */
.day-wrap { position: relative; border-radius: var(--r-lg); isolation: isolate; overflow: hidden; box-shadow: var(--shadow); }
.day-wrap .day.solo { box-shadow: none; }
.day-wrap:has(.day.solo) { box-shadow: 0 4px 14px var(--solo-glow); }
.day-wrap .day { position: relative; z-index: 1; width: 100%; height: 100%; box-shadow: none; touch-action: pan-y; transition: transform .22s cubic-bezier(.2, .8, .3, 1); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.day-wrap.dragging .day { transition: none; }
.swipe-bg { position: absolute; inset: 0; border-radius: var(--r-lg); display: flex; align-items: center; padding: 0 12px; color: var(--swipe-text); font-size: 13px; font-weight: 800; opacity: 0; transition: opacity .15s; pointer-events: none; }
.swipe-bg span { opacity: .75; transform: scale(.92); transition: transform .15s, opacity .15s; }
.swipe-bg.study { justify-content: flex-start; background: linear-gradient(90deg, var(--study-c2) 5%, var(--study-c) 65%); } /* 드러나는 왼쪽 부분에서 연두→초록 */
.swipe-bg.syn { justify-content: flex-end; background: linear-gradient(90deg, var(--syn-c) 35%, var(--ant-c) 95%); } /* 드러나는 오른쪽 부분에서 파랑→빨강이 보이게 */
.day-wrap.to-right .swipe-bg.study, .day-wrap.to-left .swipe-bg.syn { opacity: .55; }
.day-wrap.armed.to-right .swipe-bg.study, .day-wrap.armed.to-left .swipe-bg.syn { opacity: 1; }
.day-wrap.armed .swipe-bg span { opacity: 1; transform: scale(1.06); }
/* 처음 몇 번: 살짝 왼쪽(유반의어) → 오른쪽(학습)으로 흔들어서 밀 수 있다는 걸 보여 줌 */
.day-wrap.hinting .day { animation: day-nudge 1.8s ease-in-out; }
.day-wrap.hinting .swipe-bg.syn { animation: bg-l 1.8s ease-in-out; }
.day-wrap.hinting .swipe-bg.study { animation: bg-r 1.8s ease-in-out; }
@keyframes day-nudge { 0%, 100% { transform: none; } 20%, 35% { transform: translateX(-34px); } 50% { transform: none; } 65%, 80% { transform: translateX(34px); } }
@keyframes bg-l { 0%, 50%, 100% { opacity: 0; } 20%, 35% { opacity: 1; } }
@keyframes bg-r { 0%, 50%, 100% { opacity: 0; } 65%, 80% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .day-wrap.hinting .day, .day-wrap.hinting .swipe-bg { animation: none; } }
/* DAY 단어장 아래 버튼: 박스를 민 것과 같은 색 */
.day-acts { margin-bottom: 8px; }
.btn.syn-btn { background: linear-gradient(90deg, var(--syn-c), var(--ant-c)); color: var(--swipe-text); }
.btn.study-btn { background: linear-gradient(90deg, var(--study-c2), var(--study-c)); color: var(--swipe-text); }

/* DAY 박스를 밀어서 들어간 학습: 퀴즈 바탕의 아래쪽 빛을 밀 때 띠 색으로 (유반의어 = 파랑→빨강, DAY 학습 = 연두→초록) */
body[data-tint="syn"] { --tint-a: var(--tint-syn-a); --tint-b: var(--tint-syn-b); }
body[data-tint="study"] { --tint-a: var(--tint-study-a); --tint-b: var(--tint-study-b); }
body[data-tint] { --glow-0: var(--tint-b); --glow-1: var(--tint-a); } /* 화면 키보드·아래 버튼 바탕도 같은 계열 */
body[data-tint] {
  --page-grad:
    linear-gradient(to top, transparent 0, transparent 120px, var(--bg) 72vh),
    linear-gradient(90deg, var(--tint-a), var(--tint-b));
}

/* 단어장 검색 */
.day-pick.dim { opacity: .4; } /* 검색 중엔 전체 DAY에서 찾음 */
/* 화면이 낮은 폰: 앱 키보드를 조금 낮춰서 예문이 덜 가리게 */
@media (max-width: 699px) and (max-height: 600px) {
  .key { height: calc(40px * var(--key-k)); font-size: 19px; }
  .kb-row { margin-bottom: 5px; }
}
.book-search { margin-bottom: 10px; padding: 11px 14px; font-size: 16px; }

/* 예문 한 칸에 문장이 여럿일 때: 문장마다 줄을 나누고 해석을 바로 아래에 */
.sent.multi .sent-part + .sent-part { margin-top: 16px; }

/* 단어 코치: 홈 맨 위에서 고른 캐릭터가 말풍선으로 오늘 분량을 알려 줌 (그림은 32×32 픽셀이라 2배·3배 크기로) */
.buddy-svg { display: block; width: 100%; height: 100%; }
.chat-char .buddy-svg { animation: buddy-bob 2.4s steps(2, end) infinite; }
@keyframes buddy-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes buddy-hop { 0% { transform: translateY(0); } 40% { transform: translateY(-10px); } 100% { transform: translateY(0); } }
.res-buddy { width: 96px; height: 96px; margin: 0 auto 4px; }
.res-buddy .buddy-svg { animation: buddy-hop .6s ease-out 2; }
/* 정답 시트에서 같이 반응하는 코치 */
.fb-coach { flex: none; width: 48px; height: 48px; margin: -6px 8px -6px auto; }
.fb-coach .buddy-svg { animation: buddy-hop .4s ease-out; }
.fb-coach + .mark-btn { margin-left: 0; }
/* 코치 고르기 (처음 켤 때의 창, 설정의 캐릭터 줄) */
.coach-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 14px 0 4px; }
.coach-choice { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; border: 0; border-radius: var(--r-lg); background: var(--fill); color: var(--muted); font-size: 13px; font-weight: 700; }
.coach-choice .buddy-svg { width: 48px; height: 48px; }
.coach-choice.on { background: var(--primary-soft); color: var(--primary); box-shadow: inset 0 0 0 2px var(--primary); }
#coach-pick .coach-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
#coach-pick .coach-choice .buddy-svg { width: 64px; height: 64px; }
#coach-pick .coach-choice.on .buddy-svg { animation: buddy-hop .4s ease-out; }
#settings .coach-choices { margin: 6px 0 12px; }
#settings .coach-btns .btn { flex: 1; margin: 0; }
/* 일정 상의하기 창 */
.talk-card { max-width: 340px; }
.talk-say { display: flex; align-items: flex-end; gap: 8px; margin: 12px 0 4px; text-align: left; }
.talk-char { flex: none; width: 56px; height: 56px; }
.talk-char .buddy-svg { animation: buddy-hop .4s ease-out; }
.talk-bubble { flex: 1; align-self: stretch; min-width: 0; background: var(--bg); border-radius: var(--r-lg) var(--r-lg) var(--r-lg) 4px; padding: 9px 12px; font-size: 14px; line-height: 1.5; word-break: keep-all; overflow-wrap: anywhere; min-height: 3em; }
.talk-opts { margin-top: 4px; text-align: left; }
.rest-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.rest-chip { min-width: 38px; justify-content: center; }
.res-say { position: relative; max-width: 420px; margin: 4px auto 10px; padding: 10px 14px; background: var(--fill); border-radius: var(--r-lg); font-size: 15px; line-height: 1.55; text-align: left; word-break: keep-all; overflow-wrap: anywhere; }
.res-say.wait { text-align: center; color: var(--muted); }
.talk-opts .preset { padding: 10px 2px; }
.talk-opts .p-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.talk-opts .p-name { min-width: 0; }
@media (prefers-reduced-motion: reduce) { .buddy-svg, .chat-char .buddy-svg, .chat-char.hop .buddy-svg, .res-buddy .buddy-svg, .fb-coach .buddy-svg, #coach-pick .coach-choice.on .buddy-svg, .talk-char .buddy-svg { animation: none; } }
/* 코치와 이야기하기: 폰은 화면 가득, 넓은 화면은 가운데 카드 */
/* 코치 탭: 메신저처럼 화면 가득 (위 코치 이름 · 가운데 이야기 · 아래 입력, 그 아래 탭) */
/* min-height 0: 모든 화면의 min-height 100dvh가 남아 있으면 키보드가 올라와 높이를 줄여도(app.js fit) 화면 높이 그대로라
   아이폰·아이패드에서 입력 칸이 키보드 밑에 가려짐 (iOS의 100dvh는 키보드가 올라와도 안 줄어듦) */
#coach.screen.active { position: fixed; top: 0; left: 0; right: 0; height: 100dvh; min-height: 0; max-width: none; padding: 0 0 var(--tab-h); display: flex; }
body.kb-up #coach.screen.active { padding-bottom: 0; }
.chat-card { display: flex; flex-direction: column; width: 100%; max-width: 760px; height: 100%; min-height: 0; margin: 0 auto; color: var(--text); }
.chat-head { flex: none; display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 8px; }
.chat-char { flex: none; width: 48px; height: 48px; cursor: pointer; }
.chat-char.hop .buddy-svg { animation: buddy-hop .45s ease-out; }
.chat-noai { flex: none; margin: 0; padding: 10px 16px 14px; font-size: 13px; color: var(--muted); }
.chat-who { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.chat-who b { font-size: 16px; }
.chat-who span { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-body { flex: 1; min-height: 0; position: relative; display: flex; }
.chat-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 8px; padding: 12px 16px; }
.chat-day { align-self: center; font-size: 12px; color: var(--muted); margin: 4px 0; }
.chat-note { align-self: center; max-width: 92%; font-size: 13px; color: var(--muted); text-align: center; }
.chat-msg { max-width: 86%; padding: 9px 13px; border-radius: var(--r-xl) var(--r-xl) var(--r-xl) 4px; background: var(--card); font-size: 15px; line-height: 1.55; text-align: left; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; align-self: flex-start; box-shadow: var(--shadow); }
.chat-msg.me { align-self: flex-end; border-radius: var(--r-xl) var(--r-xl) 4px var(--r-xl); background: var(--primary); color: var(--on-primary); box-shadow: none; }
.chat-msg.err { color: var(--muted); }
.chat-msg.typing { display: flex; gap: 4px; padding: 14px 14px; }
.chat-msg.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: chat-dot 1s infinite ease-in-out; }
.chat-msg.typing i:nth-child(2) { animation-delay: .15s; }
.chat-msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
/* 받는 중인 코치 말: 끝에 깜빡이는 막대 */
.chat-msg.live::after { content: ''; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -2px; background: var(--muted); animation: chat-caret 1s steps(1) infinite; }
@keyframes chat-caret { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .chat-msg.live::after { animation: none; } }
/* 앱이 계산한 일정 카드 */
.chat-plan { align-self: stretch; margin: 0 2px; padding: 12px 14px; border-radius: var(--r-lg); background: var(--card); border: 0; text-align: left; display: flex; flex-direction: column; gap: 5px; }
.cp-title { font-weight: 800; font-size: 15px; }
.cp-line { font-size: 14px; line-height: 1.5; color: var(--text); word-break: keep-all; overflow-wrap: anywhere; }
.cp-choices { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.cp-choice { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 12px; border-radius: var(--r-md); border: 0; background: var(--fill); color: var(--text); }
.cp-choice b { font-size: 15px; }
.cp-choice span { font-size: 13px; color: var(--muted); }
.cp-choice.on { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.chat-plan .btn { margin: 6px 0 0; }
.chat-plan .cp-ok { background: var(--primary); color: var(--on-primary); }
.chat-plan .cp-ok:disabled { opacity: .45; }
.chat-chips { flex: none; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 8px 16px 0; }
.chat-chips[hidden] { display: none; }
.chat-chips::-webkit-scrollbar { display: none; }
.chat-chips .chip { flex: none; }
.chat-ask { flex: none; display: flex; align-items: flex-end; gap: 6px; padding: 8px 16px 12px; }
.chat-ask[hidden] { display: none; }
body.kb-up .chat-ask { padding-bottom: 8px; }
.chat-ask .type-input { flex: 1; min-width: 0; margin: 0; padding: 10px 16px; border-radius: 22px; border-width: 1.5px; font-size: 16px; line-height: 1.4; resize: none; max-height: 120px; overflow-y: hidden; scrollbar-width: none; text-align: left; font-family: inherit; }
.chat-ask .type-input::-webkit-scrollbar { display: none; }
.chat-mem { position: absolute; inset: 0; overflow-y: auto; padding: 14px; background: var(--card); text-align: left; display: flex; flex-direction: column; gap: 8px; }
.chat-mem[hidden] { display: none; }
.chat-mem-head { display: flex; align-items: center; justify-content: space-between; }
.mem-row { display: flex; align-items: center; gap: 8px; padding: 9px 0; font-size: 15px; }
.mem-row span { flex: 1; min-width: 0; word-break: keep-all; overflow-wrap: anywhere; }
.mem-del { flex: none; border: 0; background: transparent; color: var(--muted); font-size: 13px; padding: 6px; }
#cc-wipe { align-self: flex-start; margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .chat-msg.typing i { animation: none; } }
#btn-coach-replan { margin: 0 0 8px; }
/* 다시 나오기: 상황(줄) × 때(칸) 표. 칸은 코치 고르기처럼 테두리로 고름 */
.again-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 6px; align-items: center; background: var(--bg); border-radius: var(--r-md); padding: 10px 8px; margin-bottom: 8px; }
.again-grid .ag-head { text-align: center; font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.25; }
.again-grid .ag-head small { display: block; white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--muted); }
.again-grid .ag-row { font-size: 14px; font-weight: 700; line-height: 1.25; padding-left: 4px; word-break: keep-all; }
.again-grid .ag-row small { display: block; white-space: nowrap; font-size: 11px; font-weight: 600; color: var(--muted); }
.again-cell { height: 38px; border: 0; border-radius: var(--r-md); background: var(--fill); display: grid; place-items: center; padding: 0; color: transparent; }
.again-cell::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.again-cell.on { background: var(--primary-soft); color: var(--primary); }
/* 버그 신고: 정답 시트의 깃발은 형광펜보다 한 단계 조용하게(테두리 없음), 설정 맨 아래는 작은 회색 글자 */
.fb-word .report-btn { margin-left: auto; border-color: transparent; opacity: .75; }
.report-btn:active { opacity: 1; background: var(--line); }
.fb-word .fb-coach:not([hidden]) + .report-btn { margin-left: 0; }
.report-btn + .mark-btn { margin-left: 0; }
.report-link { display: block; margin: 18px auto 2px; color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.report-card { max-width: 360px; }
.rp-reasons { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 14px 0 10px; }
.rp-note { width: 100%; min-height: 58px; resize: none; padding: 10px 12px; font-size: 15px; color: var(--text); font-family: inherit; text-align: left; margin: 0; }
.rp-peek { text-align: left; margin-top: 10px; font-size: 13px; color: var(--muted); }
.rp-peek summary { cursor: pointer; }
.rp-peek pre { white-space: pre-wrap; word-break: break-word; max-height: 150px; overflow: auto; margin: 6px 0 0; padding: 8px 10px; border-radius: var(--r-md); background: var(--bg); font-size: 12px; line-height: 1.45; color: var(--text); }
.rp-copy { display: block; margin: 12px auto 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.mem-sum-head { margin: 14px 0 2px; font-size: 13px; font-weight: 700; color: var(--muted); }
.mem-sum span { white-space: pre-line; font-size: 14px; color: var(--muted); }
.cp-bio { min-height: 3em; margin: 10px 2px 0; font-size: 14px; line-height: 1.5; color: var(--muted); word-break: keep-all; }

/* ---------- 꾸미기 (js/look.js가 <html>에 붙이는 속성. 설정 > 화면 · 문제 풀기) ---------- */
/* 강조 색: 버튼·막대·고른 칸·빈칸. 모드 색 블록보다 뒤에 있어야 이김. 다크 값은 [data-theme="dark"]와 같이 */
:root[data-accent="navy"]   { --primary: #4f5bd5; --primary-soft: #eceefb; --on-primary: #ffffff; --blank: #dde1f8; } /* 이름은 navy지만 인디고 */
:root[data-accent="forest"] { --primary: #1e9e6a; --primary-soft: #e3f5ec; --on-primary: #ffffff; --blank: #cdebdc; }
:root[data-accent="grape"]  { --primary: #7a5af8; --primary-soft: #f0ecfe; --on-primary: #ffffff; --blank: #e0d8fd; }
:root[data-accent="coral"]  { --primary: #e8574a; --primary-soft: #fdebe8; --on-primary: #ffffff; --blank: #f9d5cf; }
:root[data-accent="ink"]    { --primary: #1a1a17; --primary-soft: #efeee7; --on-primary: #f7f6f1; --blank: #ebe6d6; }
:root[data-theme="dark"][data-accent="navy"]   { --primary: #6672ee; --primary-soft: #252a4a; --on-primary: #ffffff; --blank: #2e3560; }
:root[data-theme="dark"][data-accent="forest"] { --primary: #8fdcb8; --primary-soft: #15302a; --on-primary: #0d1f19; --blank: #1e4236; }
:root[data-theme="dark"][data-accent="grape"]  { --primary: #c9b6f5; --primary-soft: #251d3d; --on-primary: #160f29; --blank: #382c5c; }
:root[data-theme="dark"][data-accent="coral"]  { --primary: #ffab9e; --primary-soft: #3a1f1c; --on-primary: #2a0f0b; --blank: #55302b; }
:root[data-theme="dark"][data-accent="ink"]    { --primary: #f0efe9; --primary-soft: #2a2a30; --on-primary: #17171a; --blank: #3a3a42; }
/* 퀴즈 바탕 아래쪽 빛: 기본(라이트 피치 · 다크 청록) · 하늘 · 민트 · 단색 */
:root[data-glow="warm"] { --glow-0: #f7e2d1; --glow-1: #f9ece3; }
:root[data-glow="sky"]  { --glow-0: #d6e7fb; --glow-1: #e8f1fc; }
:root[data-glow="mint"] { --glow-0: #cdf1e3; --glow-1: #e4f7ef; }
:root[data-glow="none"] { --glow-0: var(--bg); --glow-1: var(--bg); }
:root[data-theme="dark"][data-glow="warm"] { --glow-0: #173d40; --glow-1: #122434; }
:root[data-theme="dark"][data-glow="sky"]  { --glow-0: #173252; --glow-1: #142338; }
:root[data-theme="dark"][data-glow="mint"] { --glow-0: #14402f; --glow-1: #11281f; }
/* 글자 크기: 예문·보기·정답 시트만 (버튼·메뉴는 그대로라 화면이 안 깨짐) */
:root[data-size="s"] { --fz: .9; }
:root[data-size="l"] { --fz: 1.15; }
:root[data-size="xl"] { --fz: 1.3; }
/* 영어 예문 글꼴: 명조는 폰에 있는 글꼴만 (인터넷 없어도) */
:root[data-font="serif"] { --serif: "New York", "Iowan Old Style", Georgia, "Times New Roman", serif; }
:root[data-font="serif"] .sent .en, :root[data-font="serif"] .word-card .qw, :root[data-font="serif"] .fb-word .w,
:root[data-font="serif"][data-mode="ex"] .choice { font-family: var(--serif); }
:root[data-font="serif"] .sent .en { letter-spacing: .005em; }
/* 모서리: 둥글게(기본) · 조금 둥글게 · 각지게 */
:root[data-radius="soft"] { --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 10px; --r-xl: 12px; --r-2xl: 16px; }
:root[data-radius="square"] { --r-xs: 2px; --r-sm: 3px; --r-md: 4px; --r-lg: 5px; --r-xl: 6px; --r-2xl: 8px; --r-pill: 6px; }
/* 정답 반응: 차분하게(움직임 없이 색만) · 보통(기본) · 신나게(톡 튀고 반짝) */
:root[data-react="calm"] #q-sentences.answered .sent, :root[data-react="calm"] #q-sentences.answered .blank.filled,
:root[data-react="calm"] .tag.fb-head, :root[data-react="calm"] .fb-coach .buddy-svg { animation: none !important; }
:root[data-react="fun"] #q-sentences.answered.ok .sent { animation: card-in .45s ease-out, fun-pop .5s cubic-bezier(.3, 1.6, .5, 1); box-shadow: 0 0 0 3px var(--ok), 0 0 26px 6px rgba(var(--ok-glow), .45); }
:root[data-react="fun"] .tag.fb-head.ok:not([hidden]) { animation: fun-tag .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes fun-pop { 40% { transform: scale(1.035); } }
@keyframes fun-tag { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { :root[data-react="fun"] #q-sentences.answered.ok .sent, :root[data-react="fun"] .tag.fb-head.ok { animation: none !important; } }
/* 앱 키보드 키 높이 */
:root[data-kb="s"] { --key-k: .86; }
:root[data-kb="l"] { --key-k: 1.14; }
/* 홈에 보일 것 ('오늘' 카드는 늘) */
:root[data-hide~="plan"] #plan-sum-card, :root[data-hide~="plan"] #prog-card, :root[data-hide~="practice"] #home-menu { display: none !important; }

/* 설정 > 화면: 이름(왼쪽) + 고르기(오른쪽) 한 줄씩 */
.opt-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 10px; margin-bottom: 8px; }
.opt-row > span { font-size: 14px; font-weight: 700; color: var(--muted); }
.opt-row .seg { margin: 0; }
.opt-row .seg button { padding: 7px 2px; font-size: 13px; white-space: nowrap; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; padding: 4px 2px; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.swatch.on { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--text); }
.swatch:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
#btn-look-reset { margin-top: 6px; }
.react-demo { display: flex; align-items: center; gap: 8px; margin: -4px 2px 6px; font-size: 12px; }

/* 홈 DAY별 진도: 제목 옆 보기 방식 (격자 · 줄 막대 · 잔디) */
.days-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 10px; }
.days-head .label { margin: 0; flex: 1; min-width: 0; }
.seg.mini { flex: none; margin: 0; padding: 3px; gap: 2px; background: var(--card); box-shadow: var(--shadow); }
.seg.mini button { flex: none; width: 34px; height: 28px; padding: 0; display: grid; place-items: center; }
.seg.mini button.on { background: var(--primary-soft); box-shadow: none; }
.seg.mini .ic { width: 17px; height: 17px; }
/* 줄 막대: 한 줄에 DAY 하나 (이름 · 막대 · 숫자) */
.days.lines { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.days.lines .day { display: grid; grid-template-columns: 62px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 12px; }
.days.lines .day b { grid-column: 1; grid-row: 1; }
.days.lines .day .bar { grid-column: 2; grid-row: 1; margin: 0; height: 6px; }
.days.lines .day .muted { grid-column: 3; grid-row: 1; font-variant-numeric: tabular-nums; }
/* 잔디: 작은 칸 하나가 DAY, 진할수록 많이 외움 (배운 단어는 반, 암기 완료는 끝까지) */
.days.heat { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.days.heat .day-wrap { aspect-ratio: 1; }
.days.heat .day { display: grid; place-items: center; padding: 0; border-radius: var(--r-md); isolation: isolate; }
.days.heat .day::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: var(--primary); opacity: calc(.06 + var(--p, 0) * .9); }
.days.heat .day b { font-size: 13px; font-variant-numeric: tabular-nums; }
.days.heat .day.dense b { color: var(--on-primary); }
.days.heat .day .muted, .days.heat .day .bar, .days.heat .swipe-bg span { display: none; }
.days.heat .day.solo::before { background: var(--solo); }
.heat-legend { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.heat-legend i { width: 14px; height: 14px; border-radius: 4px; background: var(--primary); }

/* ---------- 아래 탭 (진도 · 단어장 · 홈 · 코치 · 설정) ---------- */
:root { --tab-h: calc(56px + env(safe-area-inset-bottom, 0px)); }
/* 글자 없이 아이콘만인 버튼 (이름은 aria-label · title) */
.chat-ic-btn { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: var(--text2); display: grid; place-items: center; padding: 0; }
.chat-ic-btn .ic { width: 22px; height: 22px; }
.chat-ic-btn:active { background: var(--fill); }
.chat-send { flex: none; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; padding: 0; margin-bottom: 1px; }
.chat-send .ic { width: 21px; height: 21px; stroke-width: 2.2; margin: 1px 2px 0 0; } /* 종이비행기는 오른쪽 위로 쏠려 보여서 살짝 옮김 */
.chat-send:disabled { background: var(--fill); color: var(--muted); }
.chat-send:not(:disabled):active { transform: scale(.94); }
.chat-retry { display: grid; place-items: center; width: 34px; min-height: 34px; padding: 0; margin-top: 6px; border-radius: 50%; color: var(--primary); }
.chat-retry .ic { width: 18px; height: 18px; }
.mem-del { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; }
.mem-del .ic { width: 19px; height: 19px; }
.mem-del:active { color: var(--danger); background: var(--danger-soft); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; display: none;
  height: var(--tab-h); padding: 0 max(8px, calc((100% - 560px) / 2)) env(safe-area-inset-bottom, 0px);
  background: var(--card); box-shadow: 0 -1px 0 var(--line);
}
/* 탭이 있는 화면에서만 */
body[data-screen="home"] .tabbar, body[data-screen="days"] .tabbar, body[data-screen="list"] .tabbar,
body[data-screen="coach"] .tabbar, body[data-screen="settings"] .tabbar { display: flex; }
body.kb-up .tabbar { display: none !important; }
.tabbar button {
  flex: 1; display: flex; align-items: center; justify-content: center;
  border: 0; background: none; padding: 0; color: var(--muted); opacity: .7;
}
.tabbar button .ic { width: 26px; height: 26px; stroke-width: 1.8; }
.tabbar button.on { color: var(--text); opacity: 1; }
.tabbar button.on .ic { stroke-width: 2.2; }
.tab-name { display: none; }
.tabbar button:active .ic { transform: scale(.92); }
/* 탭 화면은 아래 탭만큼 띄움, 아래 고정 버튼(단어장)은 탭 위로 */
body[data-screen="home"] .screen.active, body[data-screen="days"] .screen.active, body[data-screen="list"] .screen.active,
body[data-screen="settings"] .screen.active { padding-bottom: calc(var(--tab-h) + 24px); }
body[data-screen="list"] .sticky-bottom { bottom: var(--tab-h); }
body[data-screen="list"] .list { margin-bottom: 70px; }
/* 탭으로 오가니 단어장·설정의 ← 는 필요 없음 */
#btn-list-back, #btn-settings-back { display: none; }
#days .top h1, #list .top h1, #settings .top h1 { font-size: 24px; font-weight: 800; letter-spacing: -.4px; }

/* ---------- 넓은 화면 (컴퓨터 · 가로 아이패드, 1000px~): 왼쪽 사이드바 + 두 칸 홈 ---------- */
@media (min-width: 1000px) {
  :root { --rail-w: 88px; --tab-h: 0px; }
  /* 아래 탭 → 왼쪽 세로 메뉴 (아이콘 + 작은 이름, 홈이 맨 위) */
  .tabbar {
    top: 0; right: auto; width: var(--rail-w); height: auto;
    flex-direction: column; justify-content: flex-start; gap: 6px;
    padding: calc(env(safe-area-inset-top, 0px) + 20px) 10px 20px;
    box-shadow: 1px 0 0 var(--line);
  }
  .tabbar button { flex: none; flex-direction: column; gap: 4px; height: 64px; border-radius: var(--r-lg); opacity: .8; }
  .tabbar button .ic { width: 24px; height: 24px; }
  .tabbar button.on { background: var(--fill); }
  .tabbar button:not(.on):hover { background: var(--fill); opacity: 1; }
  .tabbar [data-tab="home"] { order: -1; }
  .tab-name { display: block; font-size: 12px; font-weight: 600; }
  /* 탭 화면은 사이드바만큼 오른쪽으로 */
  body[data-screen="home"], body[data-screen="days"], body[data-screen="list"], body[data-screen="settings"] { padding-left: var(--rail-w); }
  #coach.screen.active { left: var(--rail-w); padding-bottom: env(safe-area-inset-bottom, 0px); } /* 아래 탭이 없으니 홈 표시줄만큼만 띄움 */
  body[data-screen="list"] .sticky-bottom { left: var(--rail-w); }
  body[data-screen="home"] .screen.active, body[data-screen="days"] .screen.active, body[data-screen="list"] .screen.active,
  body[data-screen="settings"] .screen.active { padding-bottom: 40px; }

  /* 홈 두 칸: 왼쪽 크게 '오늘' 카드, 오른쪽 학습 계획 · 암기 완료 · 다시 볼 단어 */
  #home.screen { max-width: 1080px; padding-top: calc(env(safe-area-inset-top) + 24px); }
  .home-main { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 16px; align-items: start; grid-auto-flow: row dense; }
  .home-main > * { grid-column: 2; }
  .home-main > #resume-card { grid-column: 1 / -1; }
  .home-main > #card-today { grid-column: 1; grid-row: span 4; align-self: stretch; min-height: 360px; display: flex; flex-direction: column; padding: 28px; }
  #card-today > [id^="stage-"]:not([hidden]) { margin-top: auto; }
  #card-today .plan b { font-size: 64px; letter-spacing: -2px; }
  #card-today .today-head .label { font-size: 17px; }
  #card-today.go .today-go { font-size: 18px; }
}

/* ---------- 내 단어 (app.js openMyImport · wordItem) ---------- */
/* 단어 옆 작은 표시: 내 단어 · 독해 ×n · OO의 파생어 · 지난 바퀴 n번 틀림 */
.w-tag { display: inline-block; margin-left: 6px; vertical-align: 2px; font-size: 11px; font-weight: 700; color: var(--warn); background: var(--warn-soft); padding: 1px 7px; border-radius: var(--r-pill); white-space: nowrap; }
.dp.my { color: var(--warn); }
.dp.my.on { background: var(--warn-soft); color: var(--warn); }
.my-text { font-size: 14px; line-height: 1.45; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; min-height: 140px; text-align: left; }
.my-tip { margin-top: 10px; font-size: 13px; }
.my-row .my-form { font-size: 13px; color: var(--muted); }
.my-row .my-ex { margin-top: 4px; font-size: 13px; color: var(--muted); font-style: italic; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.my-row .my-note { margin-top: 4px; font-size: 12px; color: var(--warn); }
.my-row .seg.my-act { margin-top: 8px; }
.my-row .seg.my-act button { font-size: 13px; }
.my-bad { margin-top: 10px; font-size: 13px; }
.my-acts { margin-top: 10px; }
.my-acts + .my-acts { margin-top: 8px; }
.my-plan { margin-top: 10px; font-size: 13px; }
.my-plan .my-plan-t { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.my-plan .row { margin-top: 10px; }
.my-ai .my-ai-row { margin-top: 10px; }
.my-ai .my-shots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.my-ai .my-shots .shot { padding: 0; border: 0; background: none; cursor: pointer; line-height: 0; }
.my-ai .my-shots img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line, rgba(127,127,127,.3)); }
.my-ai .my-ai-status { margin-top: 8px; font-size: 13px; }
.my-alt { margin-top: 14px; }
.my-alt > summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 4px 0; }
.btn.danger-text { color: var(--bad); }

/* ---------- 총정리 (목표일 ~ 시험 전날, app.js renderSweep) ----------
   시험까지 남은 날에 따라 카드가 달아오름: calm(강조색) → near(보라) → hot(주황→빨강) → last(시험 전날, 빨강)
   --heat: 흰 카드에서 칸·막대 색 / --go-bg: 할 게 있을 때 카드 바탕 */
#card-today.sweep-mode { --heat: var(--primary); --sw-on: var(--card); }
/* 보라·주황·빨강 바탕엔 언제나 흰 글자 (단어 모드 다크처럼 강조색 위 글자가 어두운 테마에서도) */
#card-today.sweep-mode:is([data-heat="near"], [data-heat="hot"], [data-heat="last"]) { --go-fg: #ffffff; }
#card-today.sweep-mode[data-heat="near"] { --heat: #7048e8; --go-bg: linear-gradient(145deg, var(--primary) 0%, #7048e8 100%); }
#card-today.sweep-mode[data-heat="hot"] { --heat: #f03e3e; --go-bg: linear-gradient(145deg, #f76707 0%, #e03131 100%); }
#card-today.sweep-mode[data-heat="last"] { --heat: #e03131; --go-bg: linear-gradient(145deg, #e03131 0%, #a61e4d 100%); }
#card-today.sweep-mode.go { box-shadow: 0 14px 34px -14px color-mix(in srgb, var(--heat) 70%, transparent); }
.sweep, .sweep-round { position: relative; z-index: 1; pointer-events: none; }
.sweep { margin: 12px 0 2px; --ink: var(--heat); --soft: var(--line); }
.sweep-left { display: flex; align-items: baseline; gap: 6px; font-size: 15px; font-weight: 600; color: var(--text2); }
.sl-num { font-size: 60px; font-weight: 800; letter-spacing: -2.5px; line-height: .95; color: var(--ink); font-variant-numeric: tabular-nums; }
.sweep-strip { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(0, 1fr)); gap: 6px; margin-top: 16px; }
.sd { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.sd i { position: relative; display: grid; place-items: center; width: 100%; max-width: 34px; aspect-ratio: 1; border-radius: 50%; font-style: normal; font-size: 11px; font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--soft); color: var(--ink); }
.sd i svg { width: 58%; height: 58%; }
.sd small { font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.sd.past i { background: var(--ink); box-shadow: none; color: var(--sw-on); }
.sd.past i svg { width: 52%; height: 52%; }
.sd.past.more i { font-size: 10px; letter-spacing: -.5px; }
.sd.now i { box-shadow: inset 0 0 0 3px var(--ink); background: color-mix(in srgb, var(--ink) 16%, transparent); }
.sd.now i::after { content: ''; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--ink); opacity: 0; animation: sd-pulse 1.8s ease-out infinite; }
.sd.now small { color: var(--ink); font-weight: 800; }
.sd.rest i { box-shadow: inset 0 0 0 1.5px var(--soft); opacity: .5; background: repeating-linear-gradient(135deg, transparent 0 3px, var(--soft) 3px 4.5px); }
.sd.exam i { border-radius: 30%; background: var(--ink); box-shadow: none; color: var(--sw-on); }
.sd.exam small { color: var(--ink); font-weight: 800; }
@keyframes sd-pulse { 0% { opacity: .7; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .sd.now i::after { animation: none; } }
/* 두 모드 문제 수 */
.sw-split { display: flex; flex-wrap: wrap; align-self: flex-end; gap: 6px; margin-bottom: 8px; }
.plan > .sw-split span { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); background: var(--fill); color: var(--text2); white-space: nowrap; }
.sweep-mode .plan { gap: 18px; flex-wrap: wrap; }
.sweep-mode .plan b { font-size: 48px; }
/* 한 바퀴 막대: 진하게 = 두 모드로 다 본 단어, 옅게 = 오늘 몫까지 하면 닿을 곳 */
.sweep-round { margin-top: 10px; --ink: var(--heat); --track: var(--fill); }
.sr-head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 7px; }
.sr-head b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.sr-bar { position: relative; height: 10px; border-radius: var(--r-pill); background: var(--track); overflow: hidden; }
.sr-fill, .sr-today { position: absolute; inset: 0 auto 0 0; border-radius: inherit; transition: width .6s ease; }
.sr-today { background: color-mix(in srgb, var(--ink) 28%, transparent); }
.sr-fill { background: var(--ink); z-index: 1; }
@media (prefers-reduced-motion: reduce) { .sr-fill, .sr-today { transition: none; } }
/* 할 게 있어서 카드가 칠해졌을 때: 흰 글자로 */
.today.go .sweep, .today.go .sweep-round { --ink: var(--go-fg); --soft: color-mix(in srgb, var(--go-fg) 38%, transparent); --track: color-mix(in srgb, var(--go-fg) 20%, transparent); }
#card-today.sweep-mode.go { --sw-on: var(--heat); }
.today.go .sweep-left, .today.go .sd small, .today.go .sr-head { color: color-mix(in srgb, var(--go-fg) 80%, transparent); }
.today.go .sr-head b, .today.go .sd.now small, .today.go .sd.exam small { color: var(--go-fg); }
.today.go .plan > .sw-split span { background: color-mix(in srgb, var(--go-fg) 18%, transparent); color: var(--go-fg); }
/* 퀴즈 위 '단어 → 뜻' · '예문 빈칸' 표시 */
.q-meta .tag.kind-tag.sw-kind { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); }
.q-meta .tag.kind-tag.sw-kind.kw { background: color-mix(in srgb, #0c8599 14%, transparent); color: #0b7285; }
.q-meta .tag.kind-tag.sw-kind.ke { background: var(--primary-soft); color: var(--primary); }
:root[data-theme="dark"] .q-meta .tag.kind-tag.sw-kind.kw { color: #66d9e8; }
/* 학습 계획 > 문제 카드의 '총정리 문제' */
#sweep-kinds { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.sub-label { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.sub-label .x-desc { display: block; margin-top: 3px; font-size: 12px; font-weight: 500; color: var(--muted); line-height: 1.45; }
/* 칸이 많으면(열흘 넘게) 요일은 빼고 오늘·시험만 글자로 */
.sweep-strip.dense { gap: 4px; }
.sweep-strip.dense .sd small { visibility: hidden; }
.sweep-strip.dense .sd.now small, .sweep-strip.dense .sd.exam small { visibility: visible; }
.sweep-round:not([hidden]) + #stage-extra:not([hidden]) { margin-top: 18px; }
/* 2바퀴(약한 단어만) 날: 남은 칸은 점선 고리 */
.sd.lap2.next i { box-shadow: none; outline: 1.5px dashed var(--soft); outline-offset: -1.5px; }
.sd.lap2.next small { opacity: .85; }
/* 코치 탭 빨간 느낌표: 총정리 일정을 상의할 때까지 (app.js renderTabs · sweepTalkPending) */
.tabbar button[data-tab="coach"] { position: relative; }
.tabbar button[data-tab="coach"].alert { opacity: 1; }
.tabbar button[data-tab="coach"].alert::after {
  content: '!'; position: absolute; top: calc(50% - 21px); left: calc(50% + 5px);
  min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box; border-radius: var(--r-pill);
  background: var(--bad); color: var(--on-bad); font-size: 12px; font-weight: 900; line-height: 17px; text-align: center;
  box-shadow: 0 0 0 2px var(--card); animation: tab-alert 1.6s ease-in-out infinite;
}
@keyframes tab-alert { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
@media (prefers-reduced-motion: reduce) { .tabbar button[data-tab="coach"].alert::after { animation: none; } }
/* 컴퓨터(왼쪽 세로 탭)에선 아이콘 오른쪽 위 */
.desk .tabbar button[data-tab="coach"].alert::after { top: 6px; left: calc(50% + 6px); }
/* 코치 화면의 총정리 일정 카드 */
.sweep-talk { gap: 8px; }
.sweep-talk .st-label { margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--text2); }
.sweep-talk .cp-choices { margin-top: 0; }
.sweep-talk .st-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sweep-talk .st-name { font-size: 14px; font-weight: 600; white-space: nowrap; }
.sweep-talk .seg { margin: 0; flex: 0 1 220px; background: var(--fill); }
.sweep-talk .seg button { font-size: 13px; padding: 7px 4px; white-space: nowrap; }
.sweep-talk .cp-ok { margin-top: 10px; min-height: 44px; font-size: 15px; }
/* 코치 추천 줄 (총정리 일정 카드) */
.sweep-talk .st-rec { display: flex; gap: 8px; align-items: flex-start; padding: 9px 11px; border-radius: var(--r-md); background: var(--primary-soft); font-size: 13px; line-height: 1.5; color: var(--text2); }
.sweep-talk .st-rec b { flex: none; color: var(--primary); font-weight: 800; }
.sweep-talk .st-rec-btn { margin-top: 10px; min-height: 40px; }
.sweep-talk .st-rec-btn:disabled { opacity: .6; }
.sweep-talk .st-rec-btn + .cp-ok { margin-top: 6px; }

/* ---------- 총정리 홈 (총정리 기간에만, app.js applyView · renderSweepHome) ----------
   html.sweep-on = 총정리 기간 · html[data-view="sweep"] = 총정리 홈을 보는 중 (아니면 예문·단어 모드 홈) */
.sw-only, .sweep-banner, .sw-title { display: none; }
:root[data-view="sweep"] .sw-only { display: block; }
:root[data-view="sweep"] .sw-title { display: inline; color: #e8590c; }
:root[data-view="sweep"] h1 .sub[data-only] { display: none !important; }
/* 총정리 홈엔 오늘 카드·총정리 계획·약한 단어만 (모드마다 다른 암기 완료·다시 볼 단어·학습 계획 요약은 모드 홈에) */
:root[data-view="sweep"] .home-main > :not(#resume-card):not(#card-today):not(.sw-only),
.mode-switch[data-mode="none"] .mode-thumb { opacity: 0; }
/* 모드 홈: 오늘 카드 대신 총정리 띠 (DAY 단독 학습 카드는 그대로) */
:root.sweep-on:not([data-view="sweep"]) #card-today:not(.solo-mode) { display: none; }
:root.sweep-on:not([data-view="sweep"]) .sweep-banner { display: flex; }
.sweep-banner {
  align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; cursor: pointer; font: inherit;
  color: #fff; background: linear-gradient(135deg, #ff9a1f 0%, #f76707 55%, #e8430b 100%);
}
.sweep-banner .sb-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sweep-banner b { font-size: 16px; }
.sweep-banner small { font-size: 13px; opacity: .88; }
.sweep-banner .chev { color: inherit; opacity: .9; }
.sb-fire { width: 30px; height: 30px; flex: none; transform-origin: 50% 90%; animation: sb-flick 1.6s ease-in-out infinite alternate; filter: drop-shadow(0 0 6px rgba(255, 224, 102, .7)); }
@keyframes sb-flick { from { transform: scale(.94) rotate(-3deg); } to { transform: scale(1.04) rotate(3deg); } }
@media (prefers-reduced-motion: reduce) { .sb-fire { animation: none; } }

/* 총정리 홈의 오늘 카드: 언제나 불 색 (시험이 다가올수록 빨개짐) + 아래에서 일렁이는 불빛 */
:root[data-view="sweep"] #card-today.sweep-mode { --heat: #f76707; --go-fg: #ffffff; --go-bg: linear-gradient(150deg, #ffa94d 0%, #f76707 50%, #e8590c 100%); isolation: isolate; overflow: hidden; }
:root[data-view="sweep"] #card-today.sweep-mode[data-heat="near"] { --heat: #f76707; --go-bg: linear-gradient(150deg, #ff922b 0%, #f76707 45%, #e8430b 100%); }
:root[data-view="sweep"] #card-today.sweep-mode[data-heat="hot"] { --heat: #f03e3e; --go-bg: linear-gradient(150deg, #ff8a1f 0%, #f0560b 45%, #e03131 100%); }
:root[data-view="sweep"] #card-today.sweep-mode[data-heat="last"] { --heat: #e03131; --go-bg: linear-gradient(150deg, #f76707 0%, #e03131 55%, #c2255c 100%); }
:root[data-view="sweep"] #card-today.sweep-mode.go::before,
:root[data-view="sweep"] #card-today.sweep-mode.go::after {
  content: ''; position: absolute; z-index: -1; pointer-events: none; left: -10%; right: -10%; bottom: -30%; height: 75%;
  background: radial-gradient(ellipse 35% 60% at 25% 100%, rgba(255, 224, 102, .55), transparent 70%),
              radial-gradient(ellipse 30% 55% at 62% 100%, rgba(255, 196, 0, .45), transparent 70%),
              radial-gradient(ellipse 28% 50% at 90% 100%, rgba(255, 240, 160, .4), transparent 70%);
  filter: blur(14px); transform-origin: 50% 100%; animation: flame 2.6s ease-in-out infinite alternate;
}
:root[data-view="sweep"] #card-today.sweep-mode.go::after { left: 5%; right: -20%; opacity: .7; animation-duration: 3.4s; animation-delay: -1.2s; }
@keyframes flame {
  0% { transform: scaleY(.85) translateX(-2%); opacity: .75; }
  50% { transform: scaleY(1.08) translateX(1%); opacity: 1; }
  100% { transform: scaleY(.95) translateX(3%); opacity: .85; }
}
:root[data-view="sweep"] #card-today.sweep-mode.go { box-shadow: 0 16px 36px -14px rgba(247, 103, 7, .65); }
@media (prefers-reduced-motion: reduce) {
  :root[data-view="sweep"] #card-today.sweep-mode.go::before, :root[data-view="sweep"] #card-today.sweep-mode.go::after { animation: none; }
}

/* 총정리 계획 카드 */
.swp-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.swp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.swp-row > span { color: var(--muted); flex: none; }
.swp-row > b { font-weight: 700; text-align: right; }
#swp-kinds-slot #sweep-kinds .sub-label { display: none; } /* 이 카드 이름이 이미 '총정리' */
#swp-kinds-slot #sweep-kinds { margin-top: 14px; }
.swp-more { display: block; margin: 12px 0 0 auto; }
/* 약한 단어 카드 */
#sw-weak .prog-num b { color: #e8590c; }
.sww-split { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.sww-split span { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); background: var(--fill); color: var(--text2); }
.sww-note { font-size: 13px; margin: 10px 0 0; }
:root[data-theme="dark"][data-view="sweep"] .sw-title, :root[data-theme="dark"] #sw-weak .prog-num b { color: #ffa94d; }

/* ---------- 코치 에이전트: 일정 안 비교 카드 · 바로 풀기 카드 (app.js optionsCard · quizCard) ---------- */
.opt-card { gap: 12px; padding: 14px; }
.opt-card.past { opacity: .78; }
.opt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.opt-note { font-size: 11px; color: var(--muted); white-space: nowrap; }
.opt-tabs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--fill); }
.opt-tab { min-height: 34px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opt-tab.on { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(25, 28, 38, .12); }
/* 날짜 칸: 진할수록 많이 하는 날. 고친 날은 주황 테두리 */
.opt-strip { display: grid; grid-template-columns: repeat(var(--n, 7), minmax(44px, 1fr)); gap: 5px; overflow-x: auto; padding: 3px 2px 4px; scrollbar-width: none; }
.opt-strip::-webkit-scrollbar { display: none; }
.opt-day { display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 84px; padding: 6px 2px; border: 0; border-radius: var(--r-md); background: var(--fill); color: var(--text); font: inherit; }
.opt-day:disabled { cursor: default; }
.opt-day:not(:disabled) { cursor: pointer; }
.opt-day .od-wd { font-size: 11px; font-weight: 800; color: var(--text2); }
.opt-day .od-date { font-size: 10px; color: var(--muted); }
.opt-day .od-n { font-size: 18px; font-weight: 800; line-height: 1.2; margin-top: 4px; }
.opt-day .od-unit { font-size: 10px; color: var(--muted); }
.opt-day[data-lvl="1"] { background: color-mix(in srgb, var(--primary) 14%, var(--card)); }
.opt-day[data-lvl="2"] { background: color-mix(in srgb, var(--primary) 32%, var(--card)); }
.opt-day[data-lvl="3"] { background: color-mix(in srgb, var(--primary) 62%, var(--card)); }
.opt-day[data-lvl="3"] :is(.od-wd, .od-date, .od-n, .od-unit) { color: var(--on-primary); }
.opt-day.k-exam { background: var(--primary); }
.opt-day.k-exam :is(.od-wd, .od-date, .od-n, .od-unit) { color: var(--on-primary); }
.opt-day.k-rest .od-n { color: var(--muted); font-weight: 700; }
.opt-day.k-after { opacity: .4; }
.opt-day.changed { box-shadow: inset 0 0 0 2px #f76707; }
.opt-day.editing { box-shadow: inset 0 0 0 3px #f76707; }
.opt-hint { font-size: 12px; color: var(--muted); }
.opt-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.opt-level { min-height: 44px; border: 0; border-radius: var(--r-md); background: var(--fill); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; }
.opt-level.on { background: var(--primary); color: var(--on-primary); }
.opt-rows { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: var(--r-md); background: var(--fill); }
.opt-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.opt-row span { color: var(--muted); flex: none; }
.opt-row b { text-align: right; font-weight: 700; word-break: keep-all; overflow-wrap: anywhere; }
.opt-why { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text2); word-break: keep-all; }
.opt-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opt-btns .btn { margin: 0; min-height: 44px; }
.opt-done { font-size: 13px; font-weight: 700; color: var(--ok); }
.chat-note .note-undo { margin-left: 8px; border: 0; background: var(--fill); color: var(--text); font: inherit; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--r-pill); min-height: 28px; }
.quiz-card { flex-direction: row; align-items: center; gap: 12px; }
.qc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qc-text b { font-size: 15px; }
.qc-text span { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiz-card .btn { margin: 0; flex: none; min-height: 44px; padding: 0 18px; }
/* 오늘 카드의 '오늘은 가볍게' 같은 표시 (코치와 정한 공부량) */
.load-tag { font-size: 12px; font-weight: 700; }

/* 코치를 처음 만났을 때 '뭐라고 부를까요?' */
.name-card .nc-row { display: flex; gap: 8px; margin-top: 4px; }
.name-card .nc-row .type-input { flex: 1; min-width: 0; margin: 0; }
.name-card .nc-row .btn { margin: 0; flex: none; min-height: 44px; }
.name-card > .btn.secondary { align-self: flex-start; }

/* ---------- 계정 창 (app.js openAccount) ---------- */
.acct-card { max-width: 360px; text-align: left; display: flex; flex-direction: column; gap: 10px; max-height: calc(100dvh - 40px); overflow-y: auto; }
.acct-card .dlg-title { text-align: center; }
.acct-card .dlg-body { text-align: center; margin: 0; }
.ac-field { display: flex; flex-direction: column; gap: 4px; }
.ac-field span { font-size: 13px; font-weight: 700; color: var(--text2); }
.ac-field .type-input { margin: 0; background: var(--fill); border-color: transparent; }
.ac-field .type-input:focus { background: var(--card); border-color: var(--primary); }
.ac-code { font-size: 26px; font-weight: 800; letter-spacing: 2px; text-align: center; padding: 14px 8px; border-radius: var(--r-md); background: var(--fill); font-variant-numeric: tabular-nums; user-select: all; -webkit-user-select: all; }
.ac-err { margin: 0; font-size: 13px; color: var(--bad); font-weight: 600; }
.acct-card .dlg-actions { margin-top: 4px; }
.ac-links { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 4px; font-size: 13px; }
.ac-links .link-btn { min-height: 32px; }
#set-sync .acct-end { justify-content: space-between; margin-top: 4px; }
#btn-acct-move { width: 100%; margin-top: 8px; }

/* ---------- 계정 화면 · 홈 위 사람 단추 (app.js openAccountScreen) ---------- */
.acct-btn { position: relative; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: var(--fill); color: var(--text2); flex: none; cursor: pointer; }
.acct-btn svg { width: 19px; height: 19px; }
.acct-btn.on { background: var(--primary); color: var(--on-primary); }
.acct-btn.on svg { display: none; }
.acct-btn b { font-size: 14px; font-weight: 800; line-height: 1; }
.acct-welcome { text-align: center; padding: 24px 8px 8px; }
.aw-logo { font-size: 40px; font-weight: 900; letter-spacing: -1px; }
.aw-lead { margin: 10px 0 18px; color: var(--text2); font-size: 15px; line-height: 1.6; }
#account #set-sync #acct-ready .btn { min-height: 52px; font-size: 16px; }
.acct-skip { text-align: center; margin: 18px 0 0; font-size: 14px; }
.acct-skip .link-btn { color: var(--muted); font-weight: 600; }
.ac-keep { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text2); cursor: pointer; }
.ac-keep input { width: 18px; height: 18px; accent-color: var(--primary); margin: 0; }
.ac-keep small { color: var(--muted); font-size: 12px; }
/* 총정리 홈: 이어하기도 불 색 */
:root[data-view="sweep"] #resume-card #btn-resume { background: linear-gradient(135deg, #ff9a1f 0%, #f76707 55%, #e8430b 100%); color: #fff; }
:root[data-view="sweep"] #resume-card { box-shadow: inset 0 0 0 2px color-mix(in srgb, #f76707 35%, transparent); }
