/* 영어 단어장 — 아이폰 우선 · 밝은 테마 하나
   한글·UI 는 Pretendard, 영어 단어·예문은 Newsreader(세리프)로 책 같은 품격.
   따뜻한 종이색 바탕, 먹색 글자, 강조색은 코발트 하나. 테두리 대신 옅은 그림자. */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");
@import url("https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400..700;1,6..72,400..600&display=swap");

:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --card: #ffffff;
  --fill: #f1efea;
  --line: rgba(22, 24, 29, 0.08);
  --ink: #16181d;
  --sub: #5f636b;
  --faint: #9a9ca2;
  --accent: #2f5bea;
  --accent-soft: #edf1fe;
  --mark: #fff1b8;
  --good: #1f8a4c;
  --good-soft: #e8f5ee;
  --bad: #d23b3b;
  --bad-soft: #fdeeee;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(22, 24, 29, 0.04), 0 8px 28px rgba(22, 24, 29, 0.05);
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.55 var(--sans); letter-spacing: -0.012em; word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; letter-spacing: inherit; }
[hidden] { display: none !important; }

.wrap {
  max-width: 640px; margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-right)) calc(40px + var(--safe-b)) max(20px, env(safe-area-inset-left));
}

/* ── 머리 ── */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) 0 6px; min-height: 56px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; font-size: 16px; color: var(--ink); }
.brand img { width: 26px; height: 26px; border-radius: 7px; }
.navback { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; font-size: 16px; font-weight: 500; }
.me { position: relative; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 14px;
}
.menu {
  position: absolute; right: 0; top: 44px; z-index: 10; min-width: 210px;
  background: var(--card); border-radius: 14px; box-shadow: 0 12px 40px rgba(22, 24, 29, 0.14); padding: 6px;
}
.menu .who { display: block; padding: 10px 12px 8px; font-size: 13px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu a, .menu button {
  display: block; width: 100%; text-align: left; padding: 11px 12px; border: 0; background: none;
  border-radius: 10px; font-size: 15px; color: var(--ink); cursor: pointer;
}
.menu a:hover, .menu button:hover { background: var(--fill); }

/* ── 제목 ── */
.date { margin: 18px 0 2px; font-size: 13px; font-weight: 600; color: var(--faint); letter-spacing: 0.02em; }
h1 { margin: 0 0 20px; font-size: 30px; line-height: 1.2; font-weight: 750; letter-spacing: -0.03em; }
h2 { margin: 28px 4px 10px; font-size: 13px; font-weight: 600; color: var(--faint); letter-spacing: 0.02em; }
.lead { margin: -12px 0 20px; color: var(--sub); font-size: 15px; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.grid { display: grid; gap: 14px; }
@media (min-width: 700px) { .grid.two { grid-template-columns: 1fr 1fr; } }

/* ── 단어장 표지 ── */
.deck { display: block; padding: 0; overflow: hidden; color: inherit; transition: transform .15s ease; }
.deck:active { transform: scale(0.985); }
.deck.soon { opacity: .45; pointer-events: none; }
.cover {
  position: relative; padding: 22px 22px 20px; min-height: 150px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--cover-bg, #e9edf8); color: var(--cover-fg, var(--ink));
}
.cover .quote { font-family: var(--serif); font-size: 26px; line-height: 1.18; font-weight: 500; letter-spacing: -0.01em; }
.cover .quote i { font-style: italic; }
.cover .by { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; opacity: .7; margin-top: 18px; }
.deck .body { padding: 16px 22px 20px; }
.deck h3 { margin: 0 0 2px; font-size: 18px; font-weight: 650; letter-spacing: -0.02em; }
.deck .meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--sub); margin-top: 12px; }
.deck .meta b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; font-size: 11px; font-weight: 650; padding: 3px 8px; border-radius: 999px; background: var(--fill); color: var(--sub); }
.pill.admin { background: #fff1e0; color: #a14d00; }
.pill.due { background: var(--accent-soft); color: var(--accent); }

.bar { height: 4px; background: var(--fill); border-radius: 2px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }
.deck .bar { flex: 1; }

/* ── 단어장 홈 ── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; text-align: center; }
.stats > div + div { border-left: 1px solid var(--line); }
.stats b { display: block; font-size: 26px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stats span { font-size: 12px; color: var(--faint); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -8px 0 18px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 22px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--ink); color: #fff; font-weight: 600; font-size: 16px;
}
.btn:active { opacity: .85; }
.btn.block { display: flex; width: 100%; }
.btn.ghost { background: var(--fill); color: var(--ink); }
.btn:disabled { opacity: .4; cursor: default; }

.group { padding: 0; overflow: hidden; }
.group summary { list-style: none; cursor: pointer; padding: 15px 18px; min-height: 62px; display: flex; align-items: center; gap: 12px; }
.group summary::-webkit-details-marker { display: none; }
.group summary::after { content: ''; width: 8px; height: 8px; border-right: 1.6px solid #c2c3c7; border-bottom: 1.6px solid #c2c3c7; transform: rotate(-45deg); transition: transform .2s; margin-left: 4px; }
.group[open] summary::after { transform: rotate(45deg); }
.group .num { font-size: 12px; font-weight: 700; color: var(--accent); min-width: 30px; font-variant-numeric: tabular-nums; }
.group .gt { flex: 1; min-width: 0; }
.group .gt b { display: block; font-weight: 600; font-size: 15px; }
.group .gt small { display: block; color: var(--faint); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group .gd { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.group ul { list-style: none; margin: 0; padding: 0 0 0 18px; border-top: 1px solid var(--line); }
.group li { display: flex; gap: 12px; align-items: baseline; padding: 11px 18px 11px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.group li:last-child { border-bottom: 0; }
.group li .w { flex: 1; font-family: var(--serif); font-size: 17px; }
.group li .k { flex: 1; color: var(--sub); font-size: 14px; }
.group .gstudy { display: block; padding: 14px 18px; font-size: 15px; font-weight: 600; border-top: 1px solid var(--line); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); flex: none; align-self: center; }
.dot.on { background: var(--accent); }
.dot.done { background: var(--good); }

/* ── 학습 화면 ── */
.study-top {
  position: sticky; top: 0; z-index: 2; background: var(--bg);
  display: flex; align-items: center; gap: 14px; padding: max(10px, env(safe-area-inset-top)) 0 10px; min-height: 54px;
}
.study-top .bar { flex: 1; }
.count { font-size: 12px; color: var(--faint); min-width: 44px; text-align: right; font-variant-numeric: tabular-nums; }

.flash { padding: 24px 22px 20px; margin-bottom: calc(110px + var(--safe-b)); }
.flash .hint { margin: 0 0 14px; font-size: 12px; font-weight: 650; color: var(--faint); letter-spacing: 0.04em; }
.front-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.flash .front { margin: 0; font-family: var(--serif); font-size: 40px; line-height: 1.12; font-weight: 500; letter-spacing: -0.015em; }
.flash .front.ko { font-family: var(--sans); font-size: 26px; font-weight: 700; letter-spacing: -0.03em; }
.flash .front.sm { font-size: 28px; }
.flash .pos { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--faint); }
.flash .mean { margin-top: 14px; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.35; }
.flash .back { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.flash .row { margin: 0 0 14px; }
.flash .lbl { display: block; margin-bottom: 4px; font-size: 11px; font-weight: 700; color: var(--faint); letter-spacing: 0.06em; }
.flash .def { color: var(--sub); font-family: var(--serif); font-size: 17px; font-style: italic; }
.ex { font-family: var(--serif); font-size: 19px; line-height: 1.45; }
.ex b { font-weight: 600; background: linear-gradient(transparent 58%, var(--mark) 58%); }
.exko { color: var(--sub); font-size: 14px; margin-top: 2px; }
.extag { display: inline-block; font-size: 10px; font-weight: 700; color: var(--faint); letter-spacing: 0.06em; margin-bottom: 2px; }
.exrow { margin-bottom: 12px; }
.exrow .say { width: 30px; height: 30px; min-width: 30px; margin-left: 4px; vertical-align: -6px; }
.src { font-size: 12px; color: var(--faint); }

.say {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 46px; height: 46px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--accent-soft); color: var(--accent);
}
.say:active { opacity: .7; }

.more { margin-top: 4px; }
.more > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; font-size: 14px; font-weight: 600; color: var(--sub);
}
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); margin-top: -3px; }
.more[open] > summary::after { transform: rotate(-135deg); margin-top: 3px; }
.more .inner { padding-top: 8px; }

/* 아래 고정 단추(엄지 영역) */
#act {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 12px max(20px, env(safe-area-inset-right)) calc(12px + var(--safe-b)) max(20px, env(safe-area-inset-left));
  background: rgba(246, 245, 241, 0.88);
  -webkit-backdrop-filter: saturate(180%) blur(18px); backdrop-filter: saturate(180%) blur(18px);
}
#act > * { max-width: 600px; margin-left: auto; margin-right: auto; }
#act > .btn { display: flex; width: 100%; }
#act:empty { display: none; }
.answer { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer .no { background: var(--card); color: var(--bad); box-shadow: inset 0 0 0 1px var(--line); }
.answer .yes { background: var(--ink); }

.verdict { display: inline-block; margin: 0 0 12px; padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.verdict.ok { color: var(--good); background: var(--good-soft); }
.verdict.no { color: var(--bad); background: var(--bad-soft); }

.opts { display: grid; gap: 10px; margin-top: 20px; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left; min-height: 54px; padding: 12px 16px;
  border-radius: 14px; border: 0; cursor: pointer; background: var(--fill); font-size: 16px;
}
.opt:active:not(:disabled) { background: #e8e5de; }
.opt .k { font-size: 12px; color: var(--faint); width: 14px; flex: none; }
.opt.right { background: var(--good-soft); box-shadow: inset 0 0 0 1.5px var(--good); }
.opt.wrong { background: var(--bad-soft); box-shadow: inset 0 0 0 1.5px var(--bad); }
.opt:disabled { cursor: default; color: var(--ink); }

.cloze { margin: 16px 0 6px; font-family: var(--serif); font-size: 21px; line-height: 2.1; }
.blank, .line {
  font: inherit; color: var(--ink); background: var(--accent-soft); border: 0;
  border-bottom: 2px solid var(--accent); border-radius: 8px 8px 0 0; padding: 0 6px; outline: none; max-width: 100%;
}
.line { display: block; width: 100%; margin-top: 16px; padding: 12px 14px; font-family: var(--serif); font-size: 21px; }
.blank.right, .line.right { border-bottom-color: var(--good); background: var(--good-soft); }
.blank.wrong, .line.wrong { border-bottom-color: var(--bad); background: var(--bad-soft); text-decoration: line-through; }
.listen { display: flex; gap: 10px; align-items: center; margin: 4px 0 12px; }
.listen .say { width: 64px; height: 64px; }
.listen .slow { width: auto; height: 40px; padding: 0 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.heard { color: var(--sub); font-size: 14px; min-height: 1.4em; }
.linkbtn { display: block; margin: 8px auto 0; padding: 10px; min-height: 44px; border: 0; background: none; color: var(--sub); font-size: 14px; cursor: pointer; }

.links { display: flex; flex-wrap: wrap; gap: 8px; }
.links a, .links button, .chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 13px; border: 0; cursor: pointer;
  border-radius: 999px; background: var(--fill); color: var(--ink); font-size: 13px; font-weight: 600;
}
.links button.on, .chip.on { background: var(--ink); color: #fff; }
.faint { color: var(--faint); }

.peek { margin-top: 12px; padding: 12px; border-radius: 14px; background: var(--fill); }
.yg { border-radius: 10px; overflow: hidden; background: #fff; min-height: 120px; }
.peek-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.peek-bar .chip { background: var(--card); }
.peek-bar .chip.on { background: var(--ink); }
.peek-note { margin: 8px 2px 0; font-size: 12px; color: var(--faint); }
.news { list-style: none; margin: 0; padding: 0; }
.news li { margin-bottom: 8px; padding: 12px; border-radius: 10px; background: var(--card); }
.news .ex { font-size: 16px; }
.news .src { display: block; margin-top: 4px; }

.done-box { text-align: center; padding: 40px 24px; }
.done-box .big { margin: 6px 0; font-size: 56px; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.note { margin: 24px 4px 0; font-size: 12px; color: var(--faint); }
.err { color: var(--bad); }

/* 로그인 */
.login { max-width: 400px; margin: 16vh auto 0; text-align: center; padding: 40px 28px 36px; }
.login img { width: 60px; height: 60px; border-radius: 16px; }
.login h1 { margin: 18px 0 6px; font-size: 26px; }
.login .lead { margin: 0 0 24px; }
.gbtn { display: flex; justify-content: center; min-height: 44px; }

/* 후원 */
.support-box:empty { display: none; }
.support-box { margin-top: 28px; text-align: center; }
.support { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow); color: var(--ink); font-size: 14px; font-weight: 600; }
.support-note { display: block; margin-top: 6px; font-size: 11px; color: var(--faint); }

@media (max-width: 380px) {
  h1 { font-size: 26px; }
  .flash .front { font-size: 34px; }
  .cover .quote { font-size: 23px; }
}

/* 카드 바로 아래 단추 */
.links.quick { margin-top: 14px; }

/* 아래에서 올라오는 시트 */
.sheet-bg { position: fixed; inset: 0; z-index: 30; background: rgba(22, 24, 29, 0.36); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s ease; }
.sheet {
  width: 100%; max-width: 640px; max-height: 88vh; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--card); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 40px rgba(22, 24, 29, 0.18);
  padding: 8px 18px calc(18px + var(--safe-b)); animation: rise .24s cubic-bezier(.2, .8, .2, 1);
}
.grab { width: 38px; height: 5px; border-radius: 3px; background: #d9d8d3; margin: 4px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.sheet-title { font-size: 15px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-x { border: 0; background: var(--fill); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.sheet .peek { margin-top: 0; padding: 0; background: none; }
@keyframes rise { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 22px; max-height: 80vh; } }

/* ── 아이콘 · 다듬기 ── */
.ic { flex: none; display: inline-block; vertical-align: middle; }
.navback .bk { width: 10px; height: 10px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); margin: 0 6px 0 4px; }
.flash .hint { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 999px; background: var(--fill); color: var(--sub); letter-spacing: 0.01em; }
.verdict { display: inline-flex; align-items: center; gap: 5px; }
.links.quick button { gap: 6px; padding: 0 14px 0 10px; min-height: 38px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.links.quick button .ic { color: var(--accent); }
.chip .ic { margin-right: 2px; }
#mic, #act .btn { gap: 8px; }
.cover .glyph { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.12); color: currentColor; opacity: .85; }
.cover[style*="#e"] .glyph, .cover[style*="#f"] .glyph { background: rgba(22, 24, 29, 0.06); }
.medal { width: 76px; height: 76px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.done-title { margin: 0; font-size: 15px; font-weight: 650; color: var(--sub); }
.done-box .big span { font-size: 28px; color: var(--faint); font-weight: 600; }
.card.flash { border-radius: 24px; }
.answer .known { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.answer .known .ic { color: var(--good); }

/* 내 목소리 녹음 */
.rec { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.recbtn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px 0 10px; border: 0; cursor: pointer;
  border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 600; color: var(--ink);
}
.recbtn .ic { color: var(--accent); }
.recbtn.on { background: var(--bad-soft); color: var(--bad); box-shadow: none; padding: 0 14px; }
.recbtn.ghost { color: var(--sub); padding: 0 12px; }
.recdot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); animation: blink 1s infinite; }
.recmsg { font-size: 12px; color: var(--faint); }
@keyframes blink { 50% { opacity: .25; } }
.answer.two .btn { flex-direction: column; gap: 1px; min-height: 58px; }
.answer.two .btn b { font-size: 16px; font-weight: 700; }
.answer.two .btn small { font-size: 11px; font-weight: 500; opacity: .62; }

/* 영영 뜻 먼저, 한국어 뜻은 눌러서 */
.flash .defmain { margin-top: 14px; font-family: var(--serif); font-size: 21px; line-height: 1.4; color: var(--ink); cursor: pointer; }
.flash .reveal { margin-top: 10px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px; font-weight: 650; cursor: pointer; }
.flash .defmain + .reveal + .mean { margin-top: 8px; font-size: 20px; }
.note-line { margin: 12px 0 0; font-size: 13px; color: var(--sub); line-height: 1.5; }
.note-line span { display: inline-block; margin-right: 6px; font-size: 11px; font-weight: 700; color: var(--faint); letter-spacing: 0.04em; }
.flip { margin-top: 14px; cursor: pointer; -webkit-user-select: none; user-select: none; }
.flip .defmain { margin-top: 0; }
.flip .mean { margin-top: 0; font-size: 22px; }
.fliphint { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 11px; font-weight: 650; color: var(--accent); letter-spacing: 0.02em; }
.fliphint::before { content: ''; width: 11px; height: 11px; border: 1.5px solid currentColor; border-radius: 50%; border-right-color: transparent; transform: rotate(45deg); }
.flip .lang {
  display: inline-grid; place-items: center; width: 24px; height: 24px; margin-left: 8px; vertical-align: 2px;
  border-radius: 7px; background: var(--accent-soft); color: var(--accent);
  font-family: var(--sans); font-size: 12px; font-weight: 700; font-style: normal; letter-spacing: 0;
}
.fliphint { display: none; }

/* [실제 영상] [예문] [녹음] 한 줄 */
.quick3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.quick3 button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 62px; padding: 8px 4px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--fill); color: var(--ink); font-size: 13px; font-weight: 650;
}
.quick3 button .ic { color: var(--accent); }
.quick3 button:active { background: #e8e5de; }
.quick3 .recmain.on { background: var(--bad-soft); color: var(--bad); flex-direction: row; gap: 6px; }
.recbar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.recbar button {
  display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 14px 0 10px; border: 0; cursor: pointer;
  border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 600; color: var(--ink);
}
.recbar button .ic { color: var(--accent); }
.recbar button.ghost { color: var(--sub); padding: 0 12px; }
.flip .lang { width: auto; height: auto; padding: 3px; border-radius: 6px; background: var(--fill); }
.flag { display: block; width: 24px; height: 16px; border-radius: 2px; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.18); }

/* 뜻 자리 고정: 영영·한국어를 같은 칸에 겹쳐 두고 보이기만 바꾼다 */
.flip { display: grid; min-height: calc(21px * 1.4 * 3); align-items: start; }
.flip .defmain, .flip .mean { grid-area: 1 / 1; }
.flip .mean { visibility: hidden; }
.flash.ko-on .flip .defmain { visibility: hidden; }
.flash.ko-on .flip .mean { visibility: visible; }
.exko.koonly { visibility: hidden; }
.flash.ko-on .exko.koonly { visibility: visible; }

/* 뜻 바꾸기 스위치 [EN | 한] — 국기 대신 흑백으로 차분하게 */
.flip { position: relative; padding-right: 64px; }
.flip .lang { display: none; }
.seg {
  position: absolute; top: 2px; right: 0; display: inline-flex; padding: 2px; gap: 2px;
  border-radius: 999px; background: var(--fill);
}
.seg i { font-style: normal; font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: 0.02em; line-height: 1; padding: 5px 8px; border-radius: 999px; color: var(--faint); }
.seg .en { background: var(--ink); color: #fff; }
.flash.ko-on .seg .en { background: none; color: var(--faint); }
.flash.ko-on .seg .kr { background: var(--ink); color: #fff; }

/* 구역: 뜻 / 예문 */
.sec { margin-top: 18px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; min-height: 26px; margin-bottom: 6px; }
.sec-h > span { font-size: 11px; font-weight: 700; color: var(--faint); letter-spacing: 0.08em; }
.flip { padding-right: 0; min-height: calc(19px * 1.45 * 2); margin-top: 0; }
.flip .defmain { font-family: var(--sans); font-size: 18px; line-height: 1.45; font-weight: 500; letter-spacing: -0.015em; color: var(--ink); }
.flip .mean { font-size: 21px; font-weight: 700; }
.mean.plain { margin-top: 0; }
.seg { position: static; border: 0; cursor: pointer; }
.exq { padding-left: 14px; border-left: 2px solid var(--line); }
.exq .exrow { margin-bottom: 0; }
.exq .ex { font-size: 19px; }

/* 예문 아래 빈 공간 줄이기: 해석은 한국어일 때만 자리 차지, 소리 단추는 문장 끝에 작게 */
.exko.koonly { display: none; visibility: visible; }
.flash.ko-on .exko.koonly { display: block; }
.exq .ex .say { width: 26px; height: 26px; min-width: 26px; margin-left: 2px; vertical-align: -4px; }
.exq .ex .say svg { width: 14px; height: 14px; }
.quick3 { margin-top: 14px; }
.sec + .sec { margin-top: 14px; }

/* [한]: 영영 뜻은 그대로 두고 아래에 한국어 뜻을 덧붙인다(예문 해석과 같은 방식) */
.flip { display: block; min-height: 0; }
.flip .defmain, .flip .mean { grid-area: auto; }
.flash.ko-on .flip .defmain { visibility: visible; }
.flip .mean { display: none; visibility: visible; margin-top: 6px; font-size: 18px; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; }
.flash.ko-on .flip .mean { display: block; }
/* 한국어 뜻 = 예문 해석과 같은 모양(영어 아래 회색 보조 글씨) */
.flip .mean { margin-top: 2px; font-size: 14px; font-weight: 400; color: var(--sub); letter-spacing: -0.01em; }
/* 퀴즈 안내: 상자 없이 아이콘 + 작은 글씨 */
.flash .hint { padding: 0; background: none; color: var(--faint); font-size: 12px; font-weight: 600; gap: 5px; margin-bottom: 12px; }
.flash .hint .ic { color: var(--accent); }
/* 영상·뉴스·녹음: 아이콘 + 글 한 줄 */
.quick3 button { flex-direction: row; gap: 6px; min-height: 46px; font-size: 14px; }

/* 녹음 판: [녹음] 단추에서 이어져 나온 서랍처럼(위로 뾰족한 꼬리가 녹음 단추를 가리킴) */
.recbar { position: relative; margin-top: 10px; padding: 8px; border-radius: 14px; background: var(--fill); gap: 6px; }
.recbar::before {
  content: ''; position: absolute; top: -7px; right: calc((100% - 16px) / 6); width: 14px; height: 14px;
  background: var(--fill); transform: rotate(45deg); border-radius: 3px 0 0 0;
}
.recbar button { position: relative; flex: 1; justify-content: center; background: var(--card); box-shadow: none; padding: 0 10px; min-height: 36px; }
.recbar button.ghost { flex: 0 0 auto; background: none; }
.recbar .recmsg { padding: 4px 6px; }
.quick3 .recmain.has { background: var(--fill); box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
/* 녹음 판과 활성 [녹음] 단추를 같은 옅은 파랑으로 — 회색 단추들과 구분, 한 묶음으로 */
.recbar, .recbar::before { background: var(--accent-soft); }
.quick3 .recmain.has { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px var(--accent); }
.recbar button.ghost { color: var(--accent); }
.recbar button.again { flex: 0 0 auto; background: var(--card); color: var(--ink); padding: 0 12px 0 10px; }

/* 첫 화면 단어장 카드: 익힌 수 · 오늘 할 일 · 이어서 공부하기 */
.deck .meta .m1 { white-space: nowrap; }
.today-line { display: flex; gap: 14px; margin-top: 10px; font-size: 13px; color: var(--sub); }
.today-line b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.deck .go { margin-top: 16px; min-height: 48px; }

/* 세로가 짧은 휴대폰(작은 안드로이드 등): 여백과 글자를 조금 줄여 카드가 한 화면에 */
@media (max-height: 700px) {
  .flash { padding: 18px 18px 16px; }
  .flash .front { font-size: 32px; }
  .sec { margin-top: 12px; }
  .sec + .sec { margin-top: 10px; }
  .sec-h { min-height: 22px; margin-bottom: 4px; }
  .flip .defmain { font-size: 16px; }
  .exq .ex { font-size: 17px; }
  .quick3 { margin-top: 10px; }
  .quick3 button { min-height: 42px; }
  .recbar { margin-top: 8px; padding: 6px; }
  .recbar button { min-height: 34px; }
  .note-line { margin-top: 8px; }
  .study-top { min-height: 46px; padding-bottom: 6px; }
  #act { padding-top: 8px; padding-bottom: calc(8px + var(--safe-b)); }
  .answer.two .btn { min-height: 52px; }
}

/* 단어장 화면: 표지 + 오늘 할 일 한 장, 출처·링크는 맨 아래 */
.deck.hero { pointer-events: auto; }
.deck.hero:active { transform: none; }
.deck.hero .cover { min-height: 132px; }
.deck.hero h3 { font-size: 20px; margin-bottom: 16px; }
.deck.hero .stats b small { font-size: 15px; color: var(--faint); font-weight: 600; }
.srcline { margin-top: 24px; }
.srcline .note { margin: 0 4px 10px; }
.srcline .chips { margin: 0; }

/* ── 카드 균형: 아래 버튼 바로 위까지 카드를 채우고, 간격은 하나의 기준으로 ── */
.flash {
  display: flex; flex-direction: column;
  min-height: calc(100svh - 54px - 82px - 26px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  margin-bottom: calc(96px + var(--safe-b));
  padding: 24px 22px 20px;
}
.flash .back { margin-top: 18px; padding-top: 20px; display: flex; flex-direction: column; flex: 1; }
.flash .back > .sec:first-child { margin-top: 0; }
.sec { margin-top: 0; }
.sec + .sec { margin-top: 20px; }
.sec-h { margin-bottom: 8px; }
.note-line { margin: 14px 0 0; }
/* 영상·뉴스·녹음 줄은 카드 맨 아래(아래 버튼과 짝) */
.quick3 { margin-top: auto; padding-top: 20px; }
.recbar { margin-top: 10px; }
.defmain, .ex, .note-line { text-wrap: pretty; }
@media (max-height: 700px) {
  .flash { padding: 18px 18px 16px; min-height: calc(100svh - 46px - 68px - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
  .flash .back { margin-top: 14px; padding-top: 14px; }
  .sec + .sec { margin-top: 14px; }
  .sec-h { margin-bottom: 6px; }
  .quick3 { padding-top: 14px; }
  .note-line { margin-top: 10px; }
}
/* 큰 화면에서 빈 공간을 고르게: 간격·글자를 화면 높이에 맞춰 키우고, 뜻·예문 묶음은 단어와 단추 사이 가운데에 */
.sec + .sec { margin-top: clamp(20px, 3.4vh, 40px); }
.flash .front { font-size: clamp(34px, 4.6vh, 44px); }
.flash .front.long { font-size: clamp(28px, 3.8vh, 36px); }
.flash .front.xlong { font-size: clamp(24px, 3.2vh, 30px); }
.flash .front-row .front { min-width: 0; overflow-wrap: anywhere; }
.flip .defmain { font-size: clamp(17px, 2.3vh, 21px); }
.exq .ex { font-size: clamp(18px, 2.45vh, 23px); }
.quick3 { padding-top: clamp(16px, 3vh, 32px); }

/* 위에서부터 차곡차곡: 구분선 아래 첫 구역 간격도 화면 높이에 맞춰 */
.flash .back { padding-top: clamp(18px, 3vh, 32px); }
.sec-h { margin-bottom: clamp(6px, 1vh, 10px); }

/* ── 카드와 답 버튼을 한 덩어리로: 카드는 내용만큼, 버튼은 카드 바로 아래(넘칠 때만 화면 아래 고정) ── */
.flash { min-height: 0; margin-bottom: 0; }
.quick3 { margin-top: 0; padding-top: 0; }
.flash .back > .quick3, .flash .quick3 { margin-top: clamp(18px, 2.6vh, 26px); }
#act {
  position: sticky; bottom: 0; left: auto; right: auto; margin: 12px -20px 0; z-index: 3;
  padding: 10px 20px calc(10px + var(--safe-b));
  background: linear-gradient(to bottom, rgba(246, 245, 241, 0) 0, rgba(246, 245, 241, 0.92) 14px);
  -webkit-backdrop-filter: none; backdrop-filter: none;
}
#act > * { max-width: none; }
@media (max-height: 700px) { .flash { min-height: 0; } }
