:root {
  color-scheme: light dark;
  --bg: #f6f1e7;
  --paper: #fffdf8;
  --ink: #1f1c17;
  --muted: #776f62;
  --reader-translation: #6e665a;
  --line: #e4dccd;
  --accent: #d2562b;
  --hl: #fbe6c8;
  --game: #3b6fd1;
  --world: #b23a3a;
  --ai: #2f8a6b;
  --en: "Literata", Georgia, serif;
  --ja: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #16140f; --paper: #1f1c16; --ink: #ece6da; --muted: #9a9284;
    --reader-translation: #b0a89b;
    --line: #34302699; --accent: #f07a4c; --hl: #3a2c1a;
    --game: #7ea2ec; --world: #e47b7b; --ai: #6cc9a6;
  }
}
select, option { background-color: var(--paper); color: var(--ink); }
:root { --scale: 1; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  scrollbar-gutter: stable;
  overflow-y: scroll; /* 全ページでスクロールバー枠を固定し、ページ遷移時の横ズレ・揺れを100%防止 */
}
html, body {
  touch-action: manipulation;
  -webkit-touch-callout: none;
}
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--ja); line-height: 1.7; -webkit-text-size-adjust: 100%; }
button, a, .nav-item, .tab, .card, .font-step-btn {
  touch-action: manipulation;
}
a { color: inherit; }

/* 一覧 */
.masthead { max-width: 720px; margin: 0 auto; padding: 14px 56px 8px 16px; display: flex; gap: 18px; align-items: flex-end; border-bottom: 1px solid var(--line); }
.mark { font-family: var(--en); font-weight: 600; font-size: 34px; line-height: 1; letter-spacing: -0.5px; }
.masthead p { margin: 0 0 3px; font-size: 13px; color: var(--muted); }
.masthead--compact .mark { white-space: nowrap; font-size: 24px; }
.index { max-width: 720px; margin: 0 auto; padding: 8px 16px 60px; min-height: calc(100vh - 160px); box-sizing: border-box; }
#view-study, #view-discover { min-height: calc(100vh - 140px); }
.day h2 { font-size: 14px; color: var(--muted); font-weight: 700; margin: 28px 0 10px; letter-spacing: 1px; }
.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  text-decoration: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: transform .12s, background .15s;
}
.card:active { transform: scale(.99); }
@media (hover: hover) {
  .card:hover { background: var(--hl); }
}
.card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.card-top {
  display: flex;
  align-items: center;
  max-width: 100%;
  margin-bottom: 4px;
  overflow: hidden;
}
.card-en {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-family: var(--en);
  font-size: var(--font-base, 18px) !important;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  margin-bottom: 3px;
}
.card-ja {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: var(--font-desc-base, 14.5px) !important;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 2px;
}
.card-meta {
  display: none;
}
.empty { color: var(--muted); }

.cat {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--en);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #fff;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--muted);
  line-height: 1.4;
}
.cat .src {
  font-weight: 400;
  letter-spacing: 0;
  opacity: .9;
  margin-left: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-game { background: var(--game); } .cat-world { background: var(--world); } .cat-ai { background: var(--ai); } .cat-gadget { background: #1d6f8a; } .cat-movie { background: #8c4b82; } .cat-music { background: #b5652d; } .cat-reddit { background: #c44a2b; } .cat-video { background: #c4302b; }

/* 記事 */
.top { max-width: 720px; margin: 0 auto; padding: 14px 16px; display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.back { text-decoration: none; }
.article { max-width: 720px; margin: 0 auto; padding: 0 16px 140px; }
.title-en { font-family: var(--en); font-size: 28px; line-height: 1.25; margin: 10px 0 6px; letter-spacing: -0.3px; }
.title-ja { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.tools { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); padding: 10px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.toggle { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.level { font-size: 11px; border: 1px solid var(--line); padding: 1px 8px; border-radius: 20px; }

.para { display: grid; grid-template-columns: 28px 1fr; column-gap: 8px; margin-bottom: 22px; }
.num { font-family: var(--en); font-size: 12px; color: var(--accent); padding-top: 6px; grid-row: span 2; }
.en { font-family: var(--en); font-size: 19px; line-height: 1.65; margin: 0 0 8px; border-radius: 6px; padding: 2px 6px; margin-left: -6px; cursor: pointer; transition: background .2s; }
.ja { font-size: 14px; color: var(--muted); margin: 0; padding: 2px 6px; margin-left: -6px; border-radius: 6px; cursor: pointer; transition: background .2s, filter .2s; }
body.hide-ja .para .ja { display: none; }
body.hide-ja .title-ja { display: none; }
body.hide-ja .para { margin-bottom: 12px; }
body.hide-ja .para .num { grid-row: span 1; align-self: center; }
.active { background: var(--hl); }

.xhead { font-family: var(--en); font-size: 20px; margin: 36px 0 12px; padding-top: 18px; border-top: 2px solid var(--ink); }
.xhead span { font-family: var(--ja); font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.exprs { list-style: none; padding: 0; margin: 0; counter-reset: x; }
.expr { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; transition: background .2s; }
.phrase { font-family: var(--en); font-size: 18px; font-weight: 600; color: var(--accent); cursor: pointer; }
.meaning { font-weight: 700; margin: 2px 0 6px; }
.note { font-size: 14px; }
.ex { margin-top: 8px; padding-left: 10px; border-left: 3px solid var(--line); font-size: 14px; }
.ex-en { display: block; font-family: var(--en); font-size: 15px; }
.ex-ja { display: block; color: var(--muted); font-size: 12px; }
.expr.active { background: var(--hl); }
.source { margin-top: 30px; font-size: 12px; color: var(--muted); }

/* プレイヤー */
.player { position: fixed; left: 0; right: 0; bottom: 0; background: var(--ink); color: var(--bg); display: flex; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.player.pending { justify-content: center; font-size: 13px; }
.play { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 18px; cursor: pointer; flex: none; }
.bar { flex: 1; min-width: 0; }
.track { height: 6px; background: #ffffff33; border-radius: 3px; cursor: pointer; position: relative; }
.fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; }
.time { display: flex; justify-content: space-between; font-size: 11px; margin-top: 5px; opacity: .8; font-variant-numeric: tabular-nums; }
.speed { flex: none; background: transparent; color: var(--bg); border: 1px solid #ffffff55; border-radius: 16px; padding: 4px 10px; font-size: 13px; cursor: pointer; }
@media (prefers-color-scheme: dark) { .player { background: #0c0b08; color: var(--ink); } .speed { color: var(--ink); } }

/* 文字サイズ（player.js が --scale を変える） */
.card-en { font-size: var(--font-base, 18px); }
.card-ja { font-size: var(--font-desc-base, 14.5px); }
.title-en { font-size: calc(28px * var(--scale, 1)); }
.title-ja { font-size: calc(14px * var(--scale, 1)); }
.en { font-size: var(--font-base, 19px); }
.ja { font-size: var(--font-desc-base, 14px); }
.phrase { font-size: var(--font-base, 18px); }
.meaning { font-size: calc(var(--font-base, 18px) * 0.88); }
.note, .ex { font-size: var(--font-desc-base, 14px); }
.ex-en { font-size: calc(var(--font-base, 18px) * 0.85); }
.ex-ja { font-size: calc(var(--font-base, 18px) * 0.68); }

.size { display: flex; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.size button { background: var(--paper); color: var(--ink); border: 0; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.size button + button { border-left: 1px solid var(--line); }
.size button:active { background: var(--hl); }

/* 画像 */
.hero { margin: 0 0 16px; }
.hero img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--line); }
.hero figcaption { font-size: 11px; color: var(--muted); text-align: right; margin-top: 4px; }
.thumb {
  width: 84px;
  height: 84px;
  flex-shrink: 0;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--line);
  display: block;
}
.cat .src { font-weight: 400; letter-spacing: 0.5px; opacity: .85; margin-left: 4px; }

/* タブ（YouTube アプリスタイル：アンダーライン式） */
.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  max-width: 720px;
  margin: 0 auto;
  padding: 0 12px;
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar {
  display: none;
}
.tab {
  flex: none;
  background: transparent;
  color: var(--muted);
  border: none;
  border-radius: 0;
  padding: 12px 14px 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color .2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.tab:hover {
  color: var(--ink);
}
.tab[aria-selected="true"] {
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}
.tab::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10px;
  right: 10px;
  height: 2.5px;
  background: #ff334b; /* YouTube Red / アクセントカラー */
  border-radius: 2px 2px 0 0;
  opacity: 0;
  transform: scaleX(0.4);
  transition: opacity .2s ease, transform .2s cubic-bezier(0.16, 1, 0.3, 1);
}
.tab[aria-selected="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}
.tools { flex-wrap: wrap; gap: 8px; }

/* CNN10 */
.cat-cnn10 { background: #6b4fbb; }
@media (prefers-color-scheme: dark) { .cat-cnn10 { background: #9d86e0; } }
.cat-bbc { background: #a8324a; }
@media (prefers-color-scheme: dark) { .cat-bbc { background: #e0788c; } }
.video { margin: 0 0 16px; }
.ja-audio { margin: -6px 0 16px; }
.ja-audio-label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.ja-audio audio { display: block; width: 100%; }
.video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 10px; background: #000; }
/* 開閉できる本文と概要 */
.fold > summary.xhead { display: block; list-style: none; cursor: pointer; }
.fold > summary.xhead::-webkit-details-marker { display: none; }
.fold > summary.xhead::before { content: "▸"; display: inline-block; width: 18px; color: var(--accent); }
.fold[open] > summary.xhead::before { content: "▾"; }
.tr-turn { margin-bottom: 14px; }
.tr-speaker { font-size: 12px; font-weight: 700; color: var(--accent); }
.tr-text { margin: 0; font-family: var(--en); font-size: calc(18px * var(--scale)); line-height: 1.65; }
.tr-ja { margin: 4px 0 0; font-size: calc(14px * var(--scale)); line-height: 1.7; color: var(--muted); }
.tr-show { display: none; margin-top: 4px; padding: 2px 10px; font-size: 12px; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 20px; cursor: pointer; }
body.hide-ja .tr-show { display: inline-block; }
body.hide-ja .tr-ja { display: none; }
body.hide-ja .tr-turn.tr-open .tr-ja { display: block; }

/* 単語の意味 */
.para { grid-template-columns: 36px 1fr; }
.num { min-height: 44px; padding: 4px 0 0; border: 0; background: none; color: var(--accent); font-family: var(--en); font-size: 12px; line-height: 1.3; text-align: left; align-self: start; cursor: pointer; }
.num-play { display: block; font-size: 15px; }
.en { cursor: text; }
.w { cursor: pointer; border-radius: 3px; -webkit-tap-highlight-color: transparent; }
.w-on { background: var(--hl); box-shadow: 0 0 0 2px var(--hl); }
@media (hover: hover) { .w:hover { background: var(--hl); } }
.gloss { position: absolute; z-index: 30; width: min(320px, calc(100vw - 16px)); max-height: 40vh; overflow-y: auto; padding: 10px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px #0004; font-size: 14px; line-height: 1.55; }
.gloss-head { font-family: var(--en); font-weight: 600; font-size: 16px; }
.gloss-body + .gloss-head { margin-top: 8px; }
.gloss-none { color: var(--muted); }

/* 暗記カード（Anki参考のレイアウト・下部専用バー） */
.fc-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; margin-bottom: 8px; }
.fc-topbar-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.fc-topbar-right { display: flex; align-items: center; gap: 4px; margin-left: auto; flex-shrink: 0; }
.fc-font-stepper { display: inline-flex; align-items: center; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); overflow: hidden; }
.fc-font-step-btn { width: 28px; height: 100%; border: 0; background: transparent; color: var(--ink); font: 700 14px/1 var(--ja); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.fc-font-step-btn:disabled { opacity: .35; cursor: default; }
.fc-font-step-val { padding: 0 5px; font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fc-progress { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fc-cnt-new { color: #56a3ff; }
.fc-cnt-again { color: #ff6b57; }
.fc-cnt-done { color: #4ecb71; }
.fc-cnt-sep { color: var(--muted); font-weight: 400; }
.fc-today-stat { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fc-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; transition: color .15s, background .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
@media (hover: hover) { .fc-icon-btn:hover { background: var(--paper); color: var(--ink); } }
.fc-icon-btn:active { transform: scale(.93); }
.fc-icon-btn:disabled { opacity: .35; cursor: default; }
.fc-icon-btn svg { width: 20px; height: 20px; display: block; }
.fc-icon-btn .ico, .fc-dock-btn .ico { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.fc-flag-svg { width: 18px; height: 18px; display: block; fill: currentColor; stroke: none; }
.fc-flag-picker { position: relative; display: inline-flex; align-items: center; }
.fc-flag-trigger[data-flag="red"], .fc-flag-btn.fc-flag-red, .fc-flag-badge[data-flag="red"] .fc-flag-svg, .deck-flag-badge.fc-flag-red .fc-flag-svg { color: #e0453a; }
.fc-flag-trigger[data-flag="blue"], .fc-flag-btn.fc-flag-blue, .fc-flag-badge[data-flag="blue"] .fc-flag-svg, .deck-flag-badge.fc-flag-blue .fc-flag-svg { color: #2f80ed; }
.fc-flag-trigger[data-flag="yellow"], .fc-flag-btn.fc-flag-yellow, .fc-flag-badge[data-flag="yellow"] .fc-flag-svg, .deck-flag-badge.fc-flag-yellow .fc-flag-svg { color: #eab308; }
.fc-flag-trigger[data-flag="purple"], .fc-flag-btn.fc-flag-purple, .fc-flag-badge[data-flag="purple"] .fc-flag-svg, .deck-flag-badge.fc-flag-purple .fc-flag-svg { color: #a855f7; }
.fc-flag-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 40; display: flex; align-items: center; gap: 4px; padding: 6px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.28); }
.fc-flag-btn { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink); font-family: var(--ja); font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.fc-flag-btn span { color: var(--ink); }
.fc-flag-btn.is-active { border-color: var(--line); background: var(--bg); }
@media (hover: hover) { .fc-flag-btn:hover, .fc-flag-clear:hover { background: var(--hl); } }
.fc-flag-clear { height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-family: var(--ja); font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.fc-flag-badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 6px; font-size: 11px; font-weight: 700; line-height: 1; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.fc-flag-badge .fc-flag-svg { width: 13px; height: 13px; }
.fc-deck-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; position: relative; }
.fc-deck-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.fc-deck-picker { position: relative; flex: 1 1 130px; min-width: 0; }
.fc-deck-select { flex: 1 1 130px; min-width: 0; min-height: 38px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-family: var(--ja); font-size: 13px; }
.fc-deck-trigger { width: 100%; min-height: 38px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-family: var(--ja); font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer; text-align: left; }
.fc-deck-trigger:disabled { opacity: .45; cursor: default; }
.fc-deck-trigger-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fc-deck-trigger-caret { flex: none; font-size: 11px; color: var(--muted); }
.fc-deck-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 210px; max-height: 260px; overflow-y: auto; z-index: 45; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); box-shadow: 0 10px 28px rgba(0, 0, 0, .42); display: flex; flex-direction: column; gap: 2px; }
.fc-deck-option { width: 100%; min-height: 36px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-family: var(--ja); font-size: 13px; text-align: left; display: flex; align-items: center; gap: 8px; cursor: pointer; }
.fc-deck-option::before { content: ""; width: 14px; flex: none; font-size: 12px; font-weight: 700; color: var(--accent); }
.fc-deck-option.is-selected { background: color-mix(in srgb, var(--ink) 8%, transparent); font-weight: 700; }
.fc-deck-option.is-selected::before { content: "✓"; }
.fc-deck-option-new { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; border-radius: 0 0 8px 8px; color: var(--accent); font-weight: 600; }
@media (hover: hover) { .fc-deck-option:hover { background: var(--hl); } }
.fc-deck-create-inline { display: flex; gap: 6px; padding: 6px 4px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.fc-deck-new-input { flex: 1; min-width: 0; min-height: 34px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-family: var(--ja); font-size: 13px; }
.fc-deck-new-save { flex: none; min-height: 34px; padding: 0 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: #fff; font-family: var(--ja); font-size: 12px; font-weight: 700; cursor: pointer; }
.fc-deck-add-btn { flex: none; min-height: 38px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-family: var(--ja); font-size: 12.5px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.fc-deck-add-btn.is-in-deck { border-color: #2e8540; background: rgba(46, 133, 64, .18); color: #2e8540; }
@media (prefers-color-scheme: dark) { .fc-deck-add-btn.is-in-deck { color: #7ee787; } }
.fc-card, .fc-done { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 22px; }
.fc-card { min-height: 220px; position: relative; touch-action: pan-y pinch-zoom; }
.fc-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 24px; min-height: 24px; margin-bottom: 10px; }
.fc-index { font-size: 12.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.fc-card[data-flag="red"] { box-shadow: inset 0 3px 0 #e0453a; background: color-mix(in srgb, #e0453a 7%, var(--paper)); }
.fc-card[data-flag="blue"] { box-shadow: inset 0 3px 0 #2f80ed; background: color-mix(in srgb, #2f80ed 7%, var(--paper)); }
.fc-card[data-flag="yellow"] { box-shadow: inset 0 3px 0 #eab308; background: color-mix(in srgb, #eab308 7%, var(--paper)); }
.fc-card[data-flag="purple"] { box-shadow: inset 0 3px 0 #a855f7; background: color-mix(in srgb, #a855f7 7%, var(--paper)); }
.fc-front { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 110px; }
.fc-phrase { font-family: var(--en); font-size: calc(28px * var(--fc-scale, var(--scale))); font-weight: 700; text-align: center; line-height: 1.25; overflow-wrap: anywhere; }
.fc-front-ex { font-family: var(--en); font-size: calc(18px * var(--fc-scale, var(--scale))); color: var(--ink); text-align: center; line-height: 1.5; max-width: 34em; }
.fc-btn { display: block; width: 100%; min-height: 44px; margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font-family: var(--ja); font-size: 15px; font-weight: 700; cursor: pointer; }
.fc-divider { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.fc-meaning { margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--line); font-size: calc(19px * var(--fc-scale, var(--scale))); font-weight: 700; text-align: center; }
.fc-ex-en { margin-top: 4px; font-family: var(--en); font-size: calc(18px * var(--fc-scale, var(--scale))); line-height: 1.5; }
.fc-ex-ja { margin-top: 6px; font-size: calc(15px * var(--fc-scale, var(--scale))); color: var(--muted); line-height: 1.5; }
.fc-note { margin-top: 4px; font-size: calc(14px * var(--fc-scale, var(--scale))); line-height: 1.6; }
.fc-weak { display: inline-block; padding: 0 8px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; }
.fc-grade { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin-top: 0; }
.fc-grade-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 44px; min-height: 44px; margin-top: 0; padding: 2px; font-size: 12px; font-weight: 700; line-height: 1.2; border-radius: 10px; white-space: nowrap; }
.fc-grade-btn small { display: block; font-size: 10px; font-weight: 600; opacity: .92; margin-bottom: 1px; }
.fc-again { background: #b9382c; border-color: #b9382c; color: #fff; }
.fc-hard { background: #c87a19; border-color: #c87a19; color: #fff; }
.fc-good { background: #2e8540; border-color: #2e8540; color: #fff; }
.fc-easy { background: #246bb3; border-color: #246bb3; color: #fff; }
.fc-skip-grade { background: rgba(255, 255, 255, .07); border-color: var(--line); color: var(--ink); }
.fc-known-style { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.fc-score { margin: 0; text-align: center; font-weight: 700; white-space: pre-line; line-height: 1.7; }
.fc-done-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.fc-done-actions .fc-btn { flex: 1 1 140px; margin-top: 0; }

/* 暗記カード専用下部バー */
#bar-wrap[data-mode="cards"] #reader-play-controls { display: none !important; }
#bar-wrap:not([data-mode="cards"]) #fc-dock { display: none !important; }
.fc-dock [hidden] { display: none !important; }
.fc-dock-front { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; }
.fc-dock-btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; height: 44px; min-height: 44px; padding: 0 8px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .06); color: var(--ink); font-family: var(--ja); font-size: 13.5px; font-weight: 700; white-space: nowrap; cursor: pointer; transition: background .15s, transform .1s; -webkit-tap-highlight-color: transparent; }
.fc-dock-btn:active { transform: scale(.97); }
.fc-dock-btn .ico { width: 20px; height: 20px; display: block; }
.fc-dock-btn:disabled, .fc-grade-btn:disabled { opacity: .35; cursor: default; }
.fc-dock-answer { background: var(--ink); border-color: var(--ink); color: var(--bg); }
body.fc-reviewing #site-bottom-nav { display: none !important; }
body.fc-reviewing .deck { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
body.fc-reviewing .fc-dock {
  --ink: #f4efe3;
  --bg: #1c1915;
  --muted: #b0aa9e;
  --line: #48443d;
  color-scheme: dark;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 688px;
  margin: 0 auto;
  z-index: 1000;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: rgba(28, 25, 21, .97);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .35);
  box-sizing: border-box;
  color: var(--ink);
}
@media (min-width: 720px) {
  body.fc-reviewing .fc-dock { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

/* 全画面バックドロップ（メニュー展開時のタップ貫通を完全遮断） */
.site-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: transparent !important; /* 背景を暗くせず、下の記事を100%鮮明に見せる */
  backdrop-filter: none !important; /* ぼかしを全廃し、フォントサイズ変更をリアルタイムに確認可能に */
  -webkit-backdrop-filter: none !important;
  z-index: 1001; /* メニュー以外のどこをタップしても閉じる透明なタッチ検出レイヤー */
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.site-backdrop.is-open,
body.menu-open .site-backdrop {
  display: block !important;
}
.menu-badge { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }

/* 暗記カードのページ */
.deck-start { margin-bottom: 18px; }
.deck-due { margin: 0; font-weight: 700; }
.deck-filters-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.deck-filter-select { min-height: 36px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); font-family: var(--ja); font-size: 13px; }
.deck-filter { margin-bottom: 0; font-size: 13px; color: var(--muted); }
.deck-list { list-style: none; margin: 0; padding: 0; }
.deck-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.deck-item-badges { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.deck-cat-badge, .deck-flag-badge { display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 700; border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.deck-phrase { display: block; font-family: var(--en); font-size: 17px; font-weight: 600; }
.deck-meaning { display: block; font-size: 14px; }
.deck-info { display: block; font-size: 12px; color: var(--muted); }
.settings, .settings-box {
  margin-top: 24px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.settings summary { font-weight: 700; cursor: pointer; }
.settings fieldset, .settings-box fieldset {
  margin: 16px 0 0;
  padding: 0 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
}
.settings fieldset:last-child, .settings-box fieldset:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.settings legend, .settings-box legend {
  padding: 0;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.settings fieldset label, .settings-box fieldset label {
  display: block;
  padding: 6px 0;
  font-size: 14px;
}
.settings input[type="password"], .settings-box input[type="password"] {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}
.settings-help { margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.settings-row { display: flex; gap: 8px; }
#library-articles { overflow-wrap: anywhere; font-size: 14px; }
#library-report-text { width: 100%; margin-top: 12px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; }

.deck-footer-hint {
  margin-top: 32px;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.deck-footer-hint a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
}
.transcript { display: block; text-align: center; margin: 24px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); text-decoration: none; font-size: 14px; }

/* YouTube 動画学習ページ連動 */
.yt-block { cursor: pointer; border-radius: 8px; padding: 6px 10px; margin-left: -10px; margin-bottom: 12px; transition: background .2s; }
.yt-block:hover { background: var(--paper); }
.yt-block.active { background: var(--hl); }
.yt-time { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.expr-jump { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 12px; color: var(--accent); background: none; border: 1px solid var(--line); border-radius: 14px; padding: 2px 10px; cursor: pointer; transition: background .2s; }
.expr-jump:hover { background: var(--paper); }
body.hide-ja .yt-block .tr-ja { display: none; }

/* YouTube 記事のレイアウト（下部バー余白） */
.is-yt { padding-bottom: 74px; }

/* Reader playback: single-row bottom bar aligned with article width, no site navigation. */
.reader-playback {
  --ink: #f4efe3;
  --bg: #1c1915;
  --muted: #b0aa9e;
  --line: #48443d;
  color-scheme: dark;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  width: 100%;
  max-width: 688px;
  margin: 0 auto;
  z-index: 1000;
  display: block;
  touch-action: pan-y pinch-zoom;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: rgba(28, 25, 21, .97);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, .35);
  box-sizing: border-box;
  color: var(--ink);
}
@media (min-width: 720px) {
  .reader-playback {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }
}
.reader-playback .bar-btn:disabled { opacity: .35; cursor: default; }
.reader-playback .reader-time { min-width: 0; display: grid; gap: 3px; text-align: center; }
.reader-playback #tts-label { color: var(--muted); font-size: 10px; line-height: 1.2; }
.reader-playback #tts-pos { font: 12px var(--ja); font-variant-numeric: tabular-nums; white-space: nowrap; }
#reader-audio-status { margin: 2px 3px 2px; font-size: 11px; line-height: 1.5; color: var(--muted); text-align: center; }

.reader-control-face {
  display: grid;
  width: 100%;
  box-sizing: border-box;
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(76px, 1.35fr) repeat(3, minmax(0, 1fr));
  gap: 4px;
  align-items: center;
  justify-items: center;
  min-width: 0;
}
.reader-playback .bar-btn { width: 40px; height: 44px; justify-self: center; }
.reader-playback .bar-btn-play { width: 40px; }
.reader-playback .play-disc { width: 36px; height: 36px; }
.reader-playback .reader-ja { font: 12px var(--ja); width: 40px; }
.reader-ja[aria-pressed="false"] { color: var(--muted); text-decoration: line-through; }

/* Legacy video player controls. */
.yt-bar-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  width: 100%;
  max-width: none;
  height: calc(54px + env(safe-area-inset-bottom, 0px));
  padding: 0 max(8px, calc((100% - 440px) / 2)) env(safe-area-inset-bottom, 0px);
  background: rgba(28, 25, 21, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 0;
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  box-sizing: border-box;
}
.yt-slider {
  display: flex;
  width: 200%;
  height: 100%;
  transition: transform 0.28s cubic-bezier(0.2, 0, 0, 1);
}
.yt-bar-wrap.show-ctrl .yt-slider {
  transform: translateX(-50%);
}
.bar-panel {
  width: 50%;
  height: 100%;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}
.bar-panel-nav {
  justify-content: space-around;
  padding: 0 10px;
}
.bar-panel-ctrl {
  gap: 8px;
  justify-content: space-between;
  padding: 0 14px;
}
.bar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: #f5f5f7;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background .15s, transform .1s, color .15s;
}
@media (hover: hover) { .bar-btn:hover { background: rgba(255, 255, 255, 0.1); } }
.bar-btn:active { transform: scale(0.92); }
.bar-btn .ico {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .9;
}
.bar-btn .ico-num {
  font-family: var(--en);
  font-size: 8px;
  font-weight: 700;
  fill: currentColor;
  stroke: none;
}
.play-disc {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.play-disc .ico-fill { width: 18px; height: 18px; fill: currentColor; }
.play-disc .ico-play { margin-left: -1px; }
.play-disc .ico-pause { display: none; }
.bar-btn-play.is-playing .ico-play { display: none; }
.bar-btn-play.is-playing .ico-pause { display: block; }
.bar-btn-play:hover { background: none; }
.bar-seek-wrap {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}
.yt-track {
  width: 100%;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}
.yt-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
}
.yt-time-text {
  font-size: 10px;
  font-family: var(--en);
  color: var(--muted);
  text-align: right;
  line-height: 1;
}

/* ボトムバー：時間表示・速度・準備中 */
.bar-time-row {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-family: var(--en);
  color: var(--muted);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.bar-seg-label { font-family: var(--ja); }
.bar-speed {
  flex: none;
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 14px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--en);
  font-weight: 700;
  cursor: pointer;
  min-width: 46px;
}
.speed-backdrop {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(0, 0, 0, 0.2);
}
.speed-menu {
  position: fixed;
  bottom: 74px;
  right: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 1000;
  min-width: 140px;
  animation: speedPop .15s ease-out;
}
@keyframes speedPop {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.speed-menu-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  padding: 4px 8px 2px;
}
.speed-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 14px;
  font-family: var(--en);
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s;
}
.speed-opt:hover, .speed-opt:active {
  background: var(--hl);
}
.speed-opt.is-active {
  background: var(--hl);
  color: var(--accent);
  font-weight: 700;
}
.speed-opt-check {
  font-size: 13px;
  opacity: 0;
}
.speed-opt.is-active .speed-opt-check {
  opacity: 1;
}
.bar-pending {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.bar-btn[disabled] { opacity: .35; cursor: default; }
.bar-btn[disabled]:active { transform: none; }

/* YouTube ハブページ */
.yt-hub-hero { margin-bottom: 24px; }
.yt-hub-hero h1 { font-size: 26px; margin: 0 0 6px; font-family: var(--en); }
.yt-hub-hero p { margin: 0; font-size: 13px; color: var(--muted); }

.yt-add-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 28px;
}
.yt-add-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--ink);
}
.yt-input-row {
  display: flex;
  gap: 8px;
}
.yt-url-input {
  flex: 1;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
.yt-add-btn {
  background: #c4302b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity .15s;
}
.yt-add-btn:active { opacity: .7; }
.yt-help {
  font-size: 11px;
  color: var(--muted);
  margin: 8px 0 0;
}
.yt-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  background: var(--hl);
  border: 1px solid var(--line);
  line-height: 1.5;
}

.yt-cand-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.yt-cand-card {
  display: flex;
  gap: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  align-items: center;
  transition: background .15s;
}
@media (hover: hover) { .yt-cand-card:hover { background: var(--hl); } }
.yt-cand-thumb {
  width: 96px;
  height: 54px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--line);
}
.yt-cand-info {
  flex: 1;
  min-width: 0;
}
.yt-cand-ch {
  font-size: 11px;
  font-weight: 600;
  color: #c4302b;
  margin-bottom: 2px;
}
.yt-cand-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-bottom: 4px;
}
.yt-cand-action {
  font-size: 11px;
  color: var(--muted);
}
.yt-cand-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 2px 10px;
  font-size: 11px;
  color: var(--ink);
  cursor: pointer;
  transition: all .15s;
}
.yt-cand-btn:hover {
  background: var(--ink);
  color: var(--bg);
}

.video-sublink {
  text-align: right;
  font-size: 11px;
  margin-top: -10px;
  margin-bottom: 14px;
}
.video-sublink a {
  color: var(--muted);
  text-decoration: underline;
}


/* Reddit カテゴリバッジ */
.cat-reddit { background: #d94c1a; }
@media (prefers-color-scheme: dark) { .cat-reddit { background: #ef6c3b; } }

/* トップページ：モード切替スイッチャー（学習記事一覧 ⇄ ニュース候補） */
.view-switcher {
  max-width: 720px;
  margin: 14px auto 4px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.view-switch-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  font-family: var(--ja);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.view-switch-btn[aria-selected="true"] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.view-badge {
  display: inline-block;
  padding: 0 7px;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-family: var(--en);
  font-weight: 700;
  line-height: 1.5;
}

/* ニュース候補一覧（Discover Feed） */
.feed-custom-box {
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  margin: 10px 0 8px;
}
.feed-custom-btn {
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.feed-intro-hint {
  display: none;
}
.feed-card {
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.feed-card .card-top {
  gap: 6px;
  margin-bottom: 4px;
}
.feed-pill {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}
.feed-pill-action {
  background: var(--hl);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}
.feed-pill-done {
  background: #2f8a6b22;
  color: var(--ai);
  border-color: var(--ai);
  font-weight: 700;
}

/* ニュース候補プレビュー・ボトムシート / モーダル */
.fm-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 680px) {
  .fm-overlay {
    align-items: center;
    padding: 20px;
  }
}
.fm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(2px);
}
.fm-sheet {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 680px;
  max-height: 88vh;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
@media (min-width: 680px) {
  .fm-sheet {
    border-radius: 16px;
    max-height: 85vh;
  }
}
.fm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.fm-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.fm-ext-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  white-space: nowrap;
}
.fm-source-badge {
  font-size: 11.5px;
  color: var(--accent);
  background: var(--hl);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 2px 9px;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 600;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.fm-source-badge:hover {
  background: var(--accent);
  color: #fff;
}
.fm-hero-caption {
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
  margin-top: 5px;
}
.fm-hero-caption a {
  color: inherit;
  text-decoration: underline;
}
.fm-hero-caption a:hover {
  color: var(--accent);
}
.fm-source-footer {
  margin-top: 18px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fm-source-footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
}
.fm-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fm-content {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
}
.fm-hero {
  margin: 0 0 12px;
}
.fm-hero img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: var(--line);
}
.fm-title-en {
  font-family: var(--en);
  font-size: 21px;
  line-height: 1.32;
  margin: 0 0 12px;
}
.fm-ja-box {
  background: var(--hl);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.fm-title-ja {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  margin-bottom: 6px;
}
.fm-gist-ja {
  font-size: 13px;
  color: var(--ink);
  opacity: 0.88;
  line-height: 1.6;
}
.fm-section-label {
  font-family: var(--en);
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  margin-bottom: 10px;
}
.fm-section-label span {
  font-family: var(--ja);
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 6px;
}
.fm-para-en {
  font-family: var(--en);
  font-size: 15px;
  line-height: 1.65;
  margin: 0 0 12px;
  color: var(--ink);
}
.fm-instant-banner {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 14px;
}
.fm-study-para {
  margin-bottom: 16px;
}
.fm-footer {
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.fm-btn-primary {
  flex: 2;
  min-width: 200px;
  min-height: 46px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--ja);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  padding: 8px 14px;
  text-align: center;
  transition: opacity .15s, transform .1s;
}
.fm-btn-primary small {
  font-weight: 400;
  font-size: 11px;
  opacity: 0.92;
}
.fm-btn-primary:active { transform: scale(0.98); }
.fm-btn-primary[disabled] { opacity: 0.6; cursor: wait; }
.fm-btn-secondary {
  flex: 1;
  min-width: 140px;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ja);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 8px 12px;
  transition: background .15s;
}
.fm-btn-secondary:hover { background: var(--hl); }
.fm-btn-secondary[disabled] { opacity: 0.5; cursor: default; }

/* カテゴリスワイプ連動アニメーション */
.tab-slide-container {
  will-change: transform;
}
.slide-from-right {
  animation: slideFromRight 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.slide-from-left {
  animation: slideFromLeft 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes slideFromRight {
  0% { transform: translateX(36px); opacity: 0.65; }
  100% { transform: translateX(0); opacity: 1; }
}
@keyframes slideFromLeft {
  0% { transform: translateX(-36px); opacity: 0.65; }
  100% { transform: translateX(0); opacity: 1; }
}

#feed-empty {
  padding: 40px 16px;
  text-align: center;
  font-size: 14px;
}

/* ニュース候補カルーセルスワイパー（ネイティブスクロールスナップ） */
.feed-swipe-container {
  position: relative;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin: 0 -16px;
  padding: 0;
  width: calc(100% + 32px);
}
.feed-swipe-container::-webkit-scrollbar {
  display: none;
}

.feed-panel {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  box-sizing: border-box;
  padding: 0 16px;
}

.feed-panel .feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 200px;
}

.feed-panel-empty {
  padding: 60px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* メニュー内文字サイズコントローラー */
.menu-size-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  gap: 8px;
}
.menu-size-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.menu-divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}
.size button[aria-pressed="true"],
.size button.active {
  background: var(--hl);
  color: var(--accent);
  font-weight: 700;
}

/* 設定画面の文字サイズグループ */
.size-setting-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.btn-size-choice {
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}
.btn-size-choice:hover {
  background: var(--hl);
}
.btn-size-choice[aria-pressed="true"],
.btn-size-choice.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

/* 学習記事カルーセルスワイパー（ネイティブスクロールスナップ） */
.study-swipe-container {
  position: relative;
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin: 0 -16px;
  padding: 0;
  width: calc(100% + 32px);
}
.study-swipe-container::-webkit-scrollbar {
  display: none;
}

.study-panel {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  box-sizing: border-box;
  padding: 0 16px;
}

/* メニュー内 [- フォント +] コントローラー */
.menu-font-ctrl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 4px 6px;
}
.font-step-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}
.font-step-btn:active {
  background: var(--hl);
  transform: scale(0.95);
}
.font-step-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}


/* YouTube スワイプコンテナ（ネイティブスクロールスナップ：普通の教材ページと同じ仕様） */
.yt-swipe-container {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin: 0 -16px;
  padding: 0;
  width: calc(100% + 32px);
}
.yt-swipe-container::-webkit-scrollbar {
  display: none;
}

.yt-panel {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  box-sizing: border-box;
  padding: 0 16px;
}

/* YouTube 登録チャンネルタブ UI */
.yt-view-switcher {
  margin-top: 12px;
  margin-bottom: 16px;
}
.yt-ch-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.yt-ch-intro {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}
.yt-add-ch-toggle-btn {
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.yt-add-ch-toggle-btn:hover {
  background: var(--hl);
  border-color: var(--ink);
}
.yt-add-ch-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
}
.yt-ch-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.yt-ch-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  transition: border-color .2s;
}
.yt-ch-card:hover {
  border-color: var(--accent);
}
.yt-ch-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.yt-ch-meta {
  flex: 1;
  min-width: 0;
}
.yt-ch-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.yt-ch-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.yt-ch-badge {
  font-size: 10px;
  font-weight: 700;
  background: rgba(196, 48, 43, 0.15);
  color: #e0443e;
  border: 1px solid rgba(196, 48, 43, 0.3);
  padding: 1px 6px;
  border-radius: 10px;
}
.yt-ch-tag {
  font-size: 10px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 10px;
}
.yt-ch-handle {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.yt-ch-action {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.yt-ch-fetch-btn {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all .2s;
}
.yt-ch-fetch-btn:hover {
  background: var(--ink);
  color: var(--bg);
}
.yt-ch-del-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}
.yt-ch-del-btn:hover {
  color: #e0443e;
}
.yt-ch-desc {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}
.yt-ch-videos {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.yt-video-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
}
.yt-ch-open-link {
  color: var(--accent);
  text-decoration: none;
}
.yt-video-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.yt-video-card {
  display: flex;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  transition: background .15s;
}
.yt-video-card:hover {
  background: var(--hl);
}
.yt-video-thumb {
  width: 90px;
  height: 52px;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #000;
}
.yt-video-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.yt-video-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.yt-video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}
.yt-make-btn {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #c4302b;
  text-decoration: none;
  padding: 2px 10px;
  border-radius: 12px;
  transition: opacity .15s;
}
.yt-make-btn:hover {
  opacity: .85;
}
.yt-loading, .yt-error {
  text-align: center;
  padding: 16px;
  font-size: 13px;
  color: var(--muted);
}




/* -------------------------------------------
   YouTube 登録チャンネル サブタブ UI
------------------------------------------- */
.yt-sub-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.yt-sub-tab {
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}

.yt-sub-tab:hover {
  background: var(--hl);
  color: var(--ink);
}

.yt-sub-tab.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.yt-api-prompt {
  background: var(--bg);
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.yt-api-prompt-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}

.yt-api-prompt-desc {
  margin: 0 0 10px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.45;
}

/* -------------------------------------------
   ボトムナビゲーションバー（下部固定ドック）
------------------------------------------- */
.site-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  transform: none;
  width: 100%;
  max-width: none;
  height: calc(58px + env(safe-area-inset-bottom, 0px));
  background: rgba(28, 25, 21, 0.78);
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  box-sizing: border-box;
  padding: 0 max(8px, calc((100% - 720px) / 2)) env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* 未選択のアイテム：薄いグレー（YouTubeアプリと同じ） */
.site-bottom-nav .nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  max-width: 68px;
  margin: 0;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  border-radius: 20px;
  text-decoration: none;
  color: #dedee3;
  opacity: 0.9;
  background: transparent !important;
  transition: opacity .18s ease, color .18s ease, transform .15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  cursor: pointer;
}

.site-bottom-nav .nav-item:active {
  opacity: 0.9;
  transform: scale(0.94);
}

/* 今開いているページのアイテム：アイコンだけが真っ白に発光（YouTubeアプリ完全一致：余計な座布団なし） */
.site-bottom-nav .nav-item.active {
  opacity: 1 !important;
  color: #ffffff !important;
  background: transparent !important;
  box-shadow: none !important;
}

.site-bottom-nav .nav-ico {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  pointer-events: none; /* タップ抜けを防止して親リンクで確実に受ける */
  transition: transform .15s ease, fill .15s ease, stroke-width .15s ease, color .15s ease, opacity .15s ease;
}

.site-bottom-nav .nav-label { font-size: 10px; line-height: 1.2; white-space: nowrap; font-weight: 700; }
.mode-entry { max-width: 680px; margin: 32px auto; padding: 0 20px 120px; }
.mode-entry p { line-height: 1.8; }
.mode-status { color: var(--muted); font-size: 13px; }

.site-bottom-nav .nav-item.active .nav-ico {
  color: #ffffff !important;
  transform: scale(1.1);
}

/* ホームアイコン：選択中は中身が真っ白に塗りつぶされる（YouTubeのSolid Home） */
.site-bottom-nav .nav-ico-home {
  fill: currentColor;
  stroke: none;
}

/* 最新ニュースアイコン：外枠＋3本線で構成され、選択中は真っ白に発光 */
.site-bottom-nav .nav-ico-discover {
  fill: currentColor;
  stroke: none;
}

/* YouTubeアイコン：選択中は再生三角が白塗り */
.site-bottom-nav .nav-ico-youtube path {
  fill: currentColor;
}
.site-bottom-nav .nav-item.active .nav-ico-youtube {
  stroke-width: 2.3;
}

/* 暗記カード ＆ メニューアイコン：選択中は太い純白線 */
.site-bottom-nav .nav-item.active .nav-ico-cards {
  stroke-width: 2.5;
}
.site-bottom-nav .nav-item.active .nav-ico-menu {
  stroke-width: 2.7;
}

.site-bottom-nav .nav-ico-wrap {
  position: relative;
  display: inline-flex;
}

.site-bottom-nav .nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  font-size: 10px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  padding: 0 4px;
  border-radius: 8px;
}

/* 記事ページではボトムナビ非表示 */
body.is-article .site-bottom-nav,
.is-yt .site-bottom-nav,
.article-page .site-bottom-nav {
  display: none !important;
}

/* ボトムナビ被り防止の余白（コンテンツとボトムナビが被らないよう十分な高さを確保） */
body:not(.list-page):has(.site-bottom-nav) .index,
body:has(.site-bottom-nav) .settings-page,
body:has(.site-bottom-nav) .article,
body:has(.site-bottom-nav) .deck {
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 20px)) !important;
}

/* ボトムナビ内ボタン（完全リセット ＆ タップ領域確保） */
.site-bottom-nav button.nav-item {
  background: none;
  border: none;
  padding: 0;
  margin: 0 2px;
  font: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -------------------------------------------
   ボトムメニュー ポップアップ（右端メニュー）
------------------------------------------- */
.bottom-menu-popup {
  display: none;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  width: calc(100% - 24px);
  max-width: 380px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.25);
  z-index: 1002;
  overflow: hidden;
  box-sizing: border-box;
}
.bottom-menu-popup.is-open {
  display: block !important;
}
.bottom-menu-content {
  padding: 8px;
}
.bottom-menu-divider {
  height: 1px;
  background: var(--line);
  margin: 6px 4px;
}
.bottom-menu-section-label {
  padding: 6px 14px 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.bottom-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  transition: background .15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.bottom-menu-item:hover,
.bottom-menu-item:active {
  background: var(--hl);
}
.bottom-menu-item .menu-link-ico {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  color: var(--muted);
  flex-shrink: 0;
}

/* -------------------------------------------
   YouTube 登録チャンネル ＆ 詳細画面 UI
------------------------------------------- */
.yt-section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.3px;
}

.yt-sub-toggle-btn {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 14px;
  cursor: pointer;
  transition: all .2s;
  user-select: none;
}

.yt-sub-toggle-btn.unsubscribed {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
}
.yt-sub-toggle-btn.unsubscribed:hover {
  background: var(--hl);
  border-color: var(--ink);
}

.yt-sub-toggle-btn.subscribed {
  background: rgba(46, 160, 67, 0.15);
  color: #3fb950;
  border: 1px solid rgba(46, 160, 67, 0.4);
}
.yt-sub-toggle-btn.subscribed:hover {
  background: rgba(224, 68, 62, 0.15);
  color: #e0443e;
  border-color: rgba(224, 68, 62, 0.4);
}

.yt-ch-card [data-action="open-detail"] {
  cursor: pointer;
}

.yt-empty-subscribed {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 18px 16px;
  text-align: center;
}
.yt-empty-subscribed p {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}
.yt-empty-sub-desc {
  margin-top: 6px !important;
  font-size: 11.5px !important;
  font-weight: 400 !important;
  color: var(--muted) !important;
  line-height: 1.5;
}

/* チャンネル詳細画面 */
.yt-detail-header {
  margin-bottom: 12px;
}
.yt-back-btn {
  background: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: all .2s;
}
.yt-back-btn:hover {
  background: var(--ink);
  color: var(--bg);
}

.yt-detail-title-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.yt-detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.yt-detail-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  font-family: var(--en);
}
.yt-detail-desc {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* -------------------------------------------
   Pull-to-refresh（下に引っ張って更新）
------------------------------------------- */
.ptr-container {
  height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8e8e93;
  font-size: 13px;
  font-weight: 500;
  transition: height 0.22s cubic-bezier(0.2, 0.9, 0.4, 1);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}
.ptr-container.ptr-active {
  transition: none;
}
.ptr-container.ptr-refreshing {
  height: 48px !important;
  transition: height 0.22s ease;
}
.ptr-content {
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}
.ptr-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 15px;
  transition: transform 0.2s ease;
}
.ptr-container.ptr-ready .ptr-icon {
  transform: rotate(180deg);
}
.ptr-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: ptr-spin 0.75s linear infinite;
}
.ptr-container.ptr-refreshing .ptr-icon {
  display: none;
}
.ptr-container.ptr-refreshing .ptr-spinner {
  display: inline-block;
}
@keyframes ptr-spin {
  to { transform: rotate(360deg); }
}

/* 保存済み・接続済みボタンの強調 */
.fc-btn.is-saved {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  font-weight: 600;
}

/* ===== ニュース本文＋段落和訳リーディング画面 ===== */
.pv-body-article {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.pv-para-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  transition: border-color .2s;
}
.pv-para-box:hover {
  border-color: var(--muted);
}
.pv-para-en {
  font-family: var(--en);
  font-size: var(--font-base, 18px) !important;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 10px;
  cursor: pointer;
}
.pv-para-ja {
  font-size: var(--font-desc-base, 14.5px) !important;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

/* ===== YouTube Hub フォントサイズ可変連動 ===== */
.yt-cand-title,
.yt-video-title {
  font-size: var(--font-base, 16px) !important;
}
.yt-cand-ch,
.yt-video-meta,
.yt-ch-desc,
.yt-ch-handle {
  font-size: var(--font-desc-base, 13px) !important;
}
.yt-ch-name {
  font-size: var(--font-base, 16px) !important;
}

/* ===== チャンネルアバター＆非表示ボタン ===== */
.yt-ch-card {
  position: relative;
}
.yt-ch-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.yt-ch-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid var(--line);
  background: var(--line);
}
.yt-ch-meta {
  flex: 1;
  min-width: 0;
}
.yt-hide-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px;
  padding: 4px 8px;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
}
.yt-hide-btn:hover {
  background: var(--hl);
  color: #ff4d4f;
  border-color: #ff4d4f;
}

/* 動画カード内の非表示ボタン */
.yt-video-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.yt-video-hide-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  padding: 3px 8px;
  cursor: pointer;
  transition: all .2s;
}
.yt-video-hide-btn:hover {
  color: #ff4d4f;
  border-color: #ff4d4f;
}

/* ===== 設定画面：非表示リスト管理 ===== */
.settings-hidden-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.hidden-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.hidden-item-title {
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.hidden-item-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--line);
  color: var(--muted);
  margin-right: 6px;
}
.btn-unhide {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s;
}
.btn-unhide:hover {
  background: var(--ink);
  color: var(--bg);
}

/* ===== 最新ニュース本文ページ専用ボトムバー（下部固定ドック） ===== */
.preview-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: none;
  margin: 0;
  height: calc(54px + env(safe-area-inset-bottom, 0px));
  background: rgba(28, 25, 20, 0.96);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(12px, calc((100% - 440px) / 2)) env(safe-area-inset-bottom, 0px);
  z-index: 95;
  box-sizing: border-box;
}

/* 一覧に戻るボタン */
.pv-bar-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 20px;
  text-decoration: none;
  transition: all .2s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.pv-bar-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
.pv-bar-btn .ico {
  width: 18px;
  height: 18px;
}

/* フォントサイズコントローラー（[- 18px +]） */
.pv-bar-font-ctrl {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 2px 4px;
  gap: 2px;
}
.pv-bar-font-ctrl .font-step-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background .2s;
}
.pv-bar-font-ctrl .font-step-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.pv-bar-font-ctrl .font-step-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* 教材化ボタン（オレンジグラデーションアクセント） */
.pv-bar-generate {
  background: linear-gradient(135deg, #ff6b3d, #e04b1a);
  color: #ffffff !important;
  padding: 7px 14px;
  border-radius: 18px;
  box-shadow: 0 2px 8px rgba(224, 75, 26, 0.35);
  font-weight: 700;
  font-size: 13px;
}
.pv-bar-generate:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.pv-bar-generate:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.pv-gen-ico {
  font-size: 14px;
}

/* 作成済み記事がある場合のボタン */
.pv-bar-existing {
  background: var(--ink);
  color: var(--bg) !important;
  padding: 7px 14px;
  border-radius: 18px;
  font-weight: 700;
  font-size: 13px;
}

/* 本文インライン画像引用 */
.pv-inline-figure {
  margin: 20px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
}
.pv-inline-img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  display: block;
}
.pv-inline-caption {
  padding: 8px 14px;
  font-size: 11.5px;
  color: var(--muted);
  text-align: right;
  border-top: 1px solid var(--line);
}
.pv-inline-caption a {
  color: var(--muted);
  text-decoration: underline;
}

/* -------------------------------------------
   最新ニュースカードの独立アクションボタン化
------------------------------------------- */
article.card.feed-card {
  position: relative;
  display: block;
  text-decoration: none;
  cursor: pointer;
}
.feed-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}
.feed-card-action-bar {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 5;
}
button.feed-pill-btn,
.feed-pill-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--accent, #ff6b3d);
  background: var(--hl, rgba(255, 107, 61, 0.15));
  color: var(--accent, #ff6b3d);
  border-radius: 14px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: all .15s ease;
}
button.feed-pill-btn:active,
.feed-pill-btn:active {
  transform: scale(0.94);
}
button.feed-pill-btn.feed-pill-done,
.feed-pill-btn.feed-pill-done {
  background: rgba(47, 138, 107, 0.18);
  color: #34d399;
  border-color: #059669;
}

/* -------------------------------------------
   教材ページ（custom.html）の 3画面スワイプ UI
------------------------------------------- */
.custom-tabs-nav {
  display: flex;
  background: rgba(28, 25, 21, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 4px;
  width: calc(100% - 32px);
  max-width: 688px;
  margin: 10px auto 16px;
  box-sizing: border-box;
  gap: 4px;
  position: relative;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.c-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 4px;
  background: transparent;
  border: none;
  color: var(--muted, #8e8e93);
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.c-tab.active {
  background: var(--ink, #ffffff);
  color: var(--bg, #14120e) !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}
.c-tab-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
}
.c-tab.active .c-tab-num {
  background: var(--bg, #14120e);
  color: var(--ink, #ffffff);
}

.custom-article-wrapper {
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
  overflow-x: hidden;
}
.custom-article-wrapper .ja,
.custom-article-wrapper .title-ja,
.custom-article-wrapper .ex-ja,
.custom-article-wrapper .fc-ex-ja {
  color: var(--reader-translation);
}
.custom-swipe-container {
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
  overflow-anchor: none;
  touch-action: pan-x pan-y pinch-zoom;
}
.custom-swipe-container::-webkit-scrollbar {
  display: none;
}
.custom-swipe-page {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  box-sizing: border-box;
  padding: 0 16px calc(140px + env(safe-area-inset-bottom, 0px));
  min-height: var(--reader-pane-min-height, 0px);
}
.reader-heading-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 22px; }
.reader-heading-meta .level { font-size: 11px; line-height: 1.4; padding: 1px 8px; border: 1px solid var(--line); border-radius: 20px; color: var(--muted); white-space: nowrap; }
.custom-article-wrapper .para { display: block; }
.custom-article-wrapper .para .num { display: inline-flex; align-items: center; justify-content: flex-start; vertical-align: middle; gap: 3px; min-width: 44px; min-height: 44px; margin-right: 4px; padding: 0 4px 0 0; font-size: 12px; }
.custom-article-wrapper .para .num-play { display: inline; font-size: 12px; }
.custom-article-wrapper .xhead { margin-top: 20px; padding-top: 12px; }
.custom-article-wrapper .reader-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 20px 0 12px;
  padding-top: 12px;
  border-top: 2px solid var(--ink);
}
.custom-article-wrapper .reader-section-bar .xhead {
  margin: 0;
  padding: 0;
  border-top: 0;
}
.custom-article-wrapper .reader-section-bar + .xhead {
  margin-top: 4px;
  margin-bottom: 14px;
  padding-top: 0;
  border-top: 0;
}
.reader-inline-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.reader-inline-tools .reader-speed-wrap { position: relative; width: 52px; }
.reader-inline-tools .bar-speed {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 2px 4px;
  font-size: 12px;
  text-align: center;
  text-align-last: center;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.reader-inline-tools .reader-font {
  display: grid;
  grid-template-columns: 28px 34px 28px;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 2px;
  gap: 0;
}
.reader-inline-tools .font-step-btn {
  width: 28px;
  height: 36px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.reader-inline-tools .font-step-val {
  min-width: 0;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.custom-article-wrapper .para-subhead {
  margin-top: 28px;
  margin-bottom: 16px;
}
.custom-article-wrapper .para-subhead .en {
  font-weight: 700;
  font-size: calc(var(--font-base, 19px) + 2px);
  line-height: 1.45;
  margin-bottom: 4px;
}
.custom-article-wrapper .para-subhead .ja {
  font-weight: 700;
  font-size: calc(var(--font-desc-base, 14px) + 1.5px);
}

/* -------------------------------------------
   フォントサイズステッパー（[ － ] 18px [ ＋ ]）
------------------------------------------- */
.size.font-stepper {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 16px;
  padding: 1px 3px;
  gap: 2px;
  overflow: hidden;
}
.size.font-stepper .font-step-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  color: var(--ink, #ffffff);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  padding: 0;
  transition: background .15s ease, transform .1s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.size.font-stepper .font-step-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}
.size.font-stepper .font-step-btn:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.16);
}
.size.font-stepper .font-step-val {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink, #ffffff);
  min-width: 34px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

/* Release notices occupy their own space and never cover navigation or content. */
.app-update-notice {
  position: relative; margin: 12px auto;
  width: min(calc(100% - 24px), 640px); padding: 12px 16px; border-radius: 12px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  box-shadow: 0 4px 20px #0003; font-size: 14px;
}
.app-update-notice .fc-btn { width: auto; margin: 0; padding: 8px 12px; }

/* Home/news only: complete category pages own vertical scrolling. */
body.list-page { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.list-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.list-page .list-view { height: 100%; min-height: 0; position: relative; }
.list-page #view-study, .list-page #view-discover { min-height: 0; }
.list-page .list-view[hidden] { display: none; }
.list-page main.index { max-width: none; margin: 0; padding: 0; min-height: 0; height: 100%; }
.list-page .study-swipe-container, .list-page .feed-swipe-container {
  height: 100%; width: 100%; margin: 0; align-items: stretch;
}
.list-page .study-panel, .list-page .feed-panel {
  height: 100%; overflow-y: auto; overflow-x: hidden; position: relative;
  padding: 0; overscroll-behavior-y: contain; scrollbar-width: none;
}
.list-page .study-panel::-webkit-scrollbar, .list-page .feed-panel::-webkit-scrollbar { display: none; }
.list-page .list-content { max-width: 720px; box-sizing: border-box; margin: 0 auto; padding: calc(var(--list-chrome-height, 160px) + 8px) 16px calc(100px + env(safe-area-inset-bottom, 0px)); }
.list-page .tabs { box-sizing: border-box; width: 100%; flex-shrink: 0; position: static; }
.list-page .tab { transition: none; }
.list-stage > .masthead { position: absolute; inset: 0 0 auto; z-index: 21; width: 100%; box-sizing: border-box; padding: 4px 12px 4px 16px; background: var(--bg); justify-content: space-between; align-items: center; }
.list-toolbar { position: absolute; top: var(--list-brand-height, 53px); left: 0; right: 0; z-index: 20; background: var(--bg); }
.list-stage > .masthead, .list-toolbar { transform: none; }
.list-stage > .masthead { top: calc(-1 * var(--list-chrome-offset, 0px)); }
.list-toolbar { top: calc(var(--list-brand-height, 53px) - var(--list-chrome-offset, 0px)); }
.list-page .masthead .mark { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-weight: 700; }
.list-chrome-hidden > .masthead, .list-chrome-hidden .list-toolbar { pointer-events: none; }
#list-search-open { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); cursor: pointer; }
#list-search-open svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; }
#list-search { position: fixed; inset: max(12px, env(safe-area-inset-top, 0px)) 0 auto; margin: 0 auto; width: min(680px, calc(100% - 32px)); box-sizing: border-box; max-height: min(85dvh, calc(100dvh - max(12px, env(safe-area-inset-top, 0px)) - 16px)); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; padding: 20px; background: var(--bg); color: var(--ink); }
#list-search[open] { display: flex; flex-direction: column; }
#list-search > :not(#list-search-results) { flex-shrink: 0; }
#list-search::backdrop { background: rgba(0,0,0,.5); }
.list-search-heading { display: flex; align-items: center; justify-content: space-between; }
.list-search-heading h2 { margin: 0; font-size: 22px; }
#list-search-close { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
#list-search-query { display: block; width: 100%; box-sizing: border-box; margin: 12px 0; padding: 12px; font: inherit; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); }
#list-search label, #list-search-status { font-size: 14px; }
#list-search-results { list-style: none; padding: 0; margin: 0; min-height: 0; overflow-y: auto; flex: 1; }
#list-search-results a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; line-height: 1.5; }
#list-search-results small { display: block; color: var(--muted); margin-bottom: 4px; }
.list-page .feed-custom-box { width: calc(100% - 32px); max-width: 688px; margin: 10px auto 8px; flex-shrink: 0; }
.list-page .app-update-notice { flex-shrink: 0; }

.book-page { max-width: 720px; padding: 24px 20px 120px; margin: auto; }
.book-page h1 { font-size: 26px; line-height: 1.5; }
.book-shelf { display: grid; gap: 24px; }
.book-tile { display: block; padding: 24px; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; }
.book-cover { display: flex; align-items: center; width: 130px; min-height: 160px; padding: 18px; background: #243b50; color: #fff5dd; font-family: var(--en); font-size: 24px; border-radius: 4px 14px 14px 4px; box-sizing: border-box; }
.book-cover-image { display: block; width: 150px; max-width: 100%; aspect-ratio: 2 / 3; height: auto; object-fit: contain; border-radius: 4px; }
#news-category-order { list-style: none; padding: 0; }
#news-category-order li { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
#news-category-order span { flex: 1; }
#news-category-order button { min-width: 44px; min-height: 44px; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; }
#news-category-order button:disabled { opacity: .35; }
.book-detail-cover { margin-top: 24px; }
.cover-credit, .catalog-note { color: var(--muted); font-size: 13px; line-height: 1.7; }
.catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.catalog-heading h1 { margin: 0; }
.catalog-search-button { display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); }
.catalog-search-button svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 2; }
.catalog-search { margin: 12px 0; padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
.catalog-search > div { display: flex; gap: 8px; margin-top: 8px; }
.catalog-search input { min-width: 0; flex: 1; }
.catalog-search input, .catalog-search button, .song-page button, .song-add button { min-height: 44px; padding: 10px 12px; font: inherit; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); }
.catalog-card[hidden] { display: none; }
.book-page [hidden] { display: none !important; }
.song-tile { display: block; margin: 20px 0; padding: 20px; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; }
.song-tile h2 { margin-top: 0; }
.song-listen { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 24px 0; }
.song-listen a { display: inline-block; padding: 12px 0; }
#song-video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.song-editor, .song-add { margin: 24px 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; }
.song-editor summary, .song-add summary { cursor: pointer; font-weight: 700; min-height: 28px; padding: 8px 0; }
.song-editor label, .song-add label { display: block; margin: 16px 0 8px; }
.song-editor textarea, .song-add input { width: 100%; box-sizing: border-box; padding: 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--paper); color: var(--ink); }
.song-editor button, .song-add button { margin-top: 16px; }
#song-passages section { padding: 12px 0; border-top: 1px solid var(--line); }
.song-english, .song-japanese { white-space: pre-line; line-height: 1.9; overflow-wrap: anywhere; }
.song-english { font-family: var(--en); }
.song-japanese { color: var(--reader-translation); }
.song-guide { margin-top: 32px; line-height: 1.8; }
.song-guide dt { font-weight: 700; }
.song-guide dd { margin: 4px 0 16px; }
.book-start { display: inline-block; padding: 12px 20px; margin: 12px 0; border-radius: 12px; background: var(--ink); color: var(--bg); }
.book-toc { padding-left: 24px; }
.book-toc li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.book-toc a { line-height: 1.6; }
.book-toc small { display: block; color: var(--muted); margin-top: 4px; }
.book-reader article p { line-height: 1.9; margin: 24px 0; }
.book-en { font-family: var(--en); }
.book-ja { color: var(--reader-translation); }
.book-notes details { padding: 16px 0; border-top: 1px solid var(--line); line-height: 1.8; }
.book-notes summary { cursor: pointer; font-weight: 700; }
.book-chapter-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 32px; }
.book-chapter-nav a { padding: 12px 0; }
/* Music library: compact album rows and playlist collections. */
/* Song controls stay distinct from their labels in both themes. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.music-tabs { display: flex; gap: 0; margin: 10px 0 14px; border-bottom: 1px solid var(--line); }
.music-tabs button { min-height: 44px; padding: 10px 8px; border: 0; border-radius: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 500; }
.music-tabs button[aria-selected="true"] { background: transparent; color: var(--ink); font-weight: 700; }
.music-library-tools { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.music-library-tools select { flex: 1; min-width: 0; }
.lyrics-page select, .lyrics-page button, .song-page select { min-height: 44px; padding: 8px 12px; font: inherit; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; }
.lyrics-page .music-tabs button[aria-selected="true"] { background: transparent; color: var(--ink); font-weight: 700; }
.lyrics-page .music-tabs button { font-weight: 500; }
.music-row-shell { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.music-row-shell:has(> .song-tile[hidden]) { display: none; }
.lyrics-page .song-tile, .playlist-tile { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; margin: 0; padding: 14px 0; border: 0; border-radius: 0; text-decoration: none; background: transparent; color: var(--ink); text-align: left; }
.music-row-text { display: block; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.music-row-text h2 { margin: 0 0 3px; font-size: 17px; line-height: 1.4; }
.music-row-text p { margin: 0; color: var(--muted); line-height: 1.4; font-size: 14px; }
.music-row-text small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.5; font-size: 12px; }
.music-art { display: block; width: 64px; height: 64px; flex-shrink: 0; position: relative; overflow: hidden; border-radius: 5px; background: #6e5265; color: white; }
.music-art-fallback { display: grid; place-items: center; height: 100%; font-size: 32px; }
.music-art img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.music-edit-link { display: grid; place-items: center; width: 44px; min-height: 44px; font-size: 24px; text-decoration: none; flex-shrink: 0; }
.music-row-actions { display: flex; flex-direction: column; gap: 4px; }
.music-row-actions button { min-width: 44px; padding: 4px; }
.music-row-actions button:disabled { opacity: .3; }
.lyrics-page:not(:has(#playlist-editor[open])) .music-row-actions { display: none; }
.playlist-tile { width: 100%; border-bottom: 1px solid var(--line) !important; }
.playlist-mosaic { display: grid; grid-template-columns: 1fr 1fr; width: 64px; height: 64px; overflow: hidden; border-radius: 5px; flex-shrink: 0; background: #6e5265; }
.playlist-mosaic > .music-art { width: 100%; height: 100%; border-radius: 0; min-height: 0; }
.playlist-mosaic.single { grid-template-columns: 1fr; }
.playlist-hero { display: flex; align-items: center; gap: 20px; margin: 24px 0; }
.playlist-hero h2 { margin: 0; overflow-wrap: anywhere; }
#playlist-art { display: block; width: 110px; height: 110px; }
#playlist-art > .playlist-mosaic { width: 100%; height: 100%; }
.playlist-choice { display: flex !important; align-items: center; gap: 12px; min-height: 44px; margin: 8px 0 !important; overflow-wrap: anywhere; }
.song-editor .playlist-choice input { width: 22px; height: 22px; flex-shrink: 0; }
.song-editor input, .song-editor select { width: 100%; min-width: 0; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; background: var(--paper); color: var(--ink); }
.song-form-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.song-hero { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 24px; align-items: center; margin-top: 24px; }
.song-hero h1 { margin: 6px 0; overflow-wrap: anywhere; }
.song-hero p { margin: 6px 0; }
.song-art-large { aspect-ratio: 1; width: 100%; }
.song-art-large > .music-art { width: 100%; height: 100%; border-radius: 10px; }
.song-art-large .music-art-fallback { font-size: 64px; }
.song-eyebrow { font-size: 11px; color: var(--muted); letter-spacing: .12em; }
.song-key-badge { display: inline-block; padding: 4px 10px; border-radius: 8px; background: var(--hl); font-size: 13px; overflow-wrap: anywhere; }
#song-info-open { display: inline-block; padding: 8px 0; min-height: 44px; font-size: 14px; }
#song-key { margin-right: 8px; }
.song-background-details { margin: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; }
.song-background-details summary { min-height: 44px; padding: 8px 0; cursor: pointer; font-weight: 700; }
#song-video iframe { min-height: 200px; border-radius: 12px; }
#song-background { white-space: pre-line; line-height: 1.9; overflow-wrap: anywhere; }
#song-background-sources a, #song-source a { display: block; font-size: 12px; line-height: 1.8; padding: 6px 0; overflow-wrap: anywhere; color: var(--muted); }
@media (max-width: 480px) { .song-hero { grid-template-columns: 100px minmax(0, 1fr); gap: 16px; } .song-hero h1 { font-size: 24px; } }
/* Book shelf and reading surface, independent of the news Reader. */
.book-shelf-page .book-tile { display: flex; align-items: center; gap: 18px; padding: 18px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.book-shelf-page .book-cover-image, .book-shelf-page .book-cover { width: 76px; flex-shrink: 0; }
.book-shelf-page .book-cover { min-height: 114px; padding: 8px; font-size: 14px; }
.book-tile-text { min-width: 0; }
.book-tile-text h2 { font-size: 18px; line-height: 1.5; margin: 0 0 8px; }
.book-tile-text p { margin: 5px 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.book-shelf-progress { display: inline-block; margin-top: 6px; font-size: 13px; color: var(--accent); }
.book-page-heading { display: flex; align-items: center; gap: 18px; font-weight: 700; margin-bottom: 22px; }
.book-back { display: grid; place-items: center; min-width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; font: 32px/1 sans-serif; text-decoration: none; }
.book-overview { display: flex; align-items: start; gap: 20px; }
.book-overview .book-cover-image, .book-overview .book-cover { width: 104px; flex-shrink: 0; }
.book-overview h1 { font-size: 23px; line-height: 1.5; margin: 0 0 10px; }
.book-overview p { font-size: 14px; line-height: 1.6; margin: 6px 0; }
.book-edition-tag { display: inline-block; padding: 4px 8px; border-radius: 8px; background: var(--hl); }
.book-detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 20px 0; }
.book-detail-actions a { display: inline-block; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; margin: 0; }
.book-description { padding: 18px; margin: 24px 0; background: var(--paper); border-radius: 14px; }
.book-description h2 { font-size: 17px; margin: 0 0 10px; }
.book-description p { margin: 0; line-height: 1.9; }
.book-toc { list-style: none; padding: 0; }
.book-toc li { padding: 0; }
.book-toc a { display: flex; align-items: center; gap: 14px; padding: 16px 0; text-decoration: none; }
.book-toc strong { display: block; font-size: 15px; line-height: 1.6; font-weight: 600; }
.book-toc small { font-size: 12px; color: var(--muted); }
.book-chapter-number { color: var(--muted); font-size: 13px; min-width: 26px; }
.book-read-check { margin-left: auto; flex-shrink: 0; color: var(--accent); }
.book-colophon dl { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 16px; margin: 28px 0; }
.book-colophon dt { color: var(--muted); font-size: 14px; }
.book-colophon dd { margin: 0; overflow-wrap: anywhere; }
.book-word-filters { display: flex; flex-wrap: wrap; gap: 12px; }
.book-word-filters input { min-width: 0; flex: 1; }
.book-word-filters input, .book-word-filters select { min-height: 44px; padding: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 8px; font: inherit; }
.book-word-list { list-style: none; padding: 0; }
.book-word-row { padding: 16px 0; border-bottom: 1px solid var(--line); }
.book-word-row small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.book-reading-page { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.book-reading-page .book-reader { padding-top: 0; padding-bottom: 150px; }
.book-reader-top { position: sticky; top: 0; z-index: 80; display: flex; align-items: center; gap: 6px; margin: 0 -20px 24px; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 13px; }
.book-reader-top > span { flex: 1; font-weight: 700; }
.book-reader-top button, .book-dialog button, #book-complete { min-height: 44px; min-width: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink); font: inherit; }
.book-reader-kicker { font-size: 12px; color: var(--muted); letter-spacing: .07em; }
#book-reader-status { min-height: 22px; margin: 4px 0; font-size: 12px; line-height: 22px; }
.book-reader h1 { font-size: 24px; font-family: inherit; line-height: 1.6; margin: 18px 0 28px; }
.book-reader-content p, .book-notes p, .book-notes li { font-size: var(--font-base, 18px); line-height: 1.95; }
.book-reader .book-en { font-family: inherit; }
.book-passage { scroll-margin-top: 80px; }
.book-found { background: var(--hl); outline: 2px solid var(--accent); border-radius: 8px; }
.book-summary { margin: 28px 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
.book-summary h2, .book-keywords h2, .book-key-sentences h2, .book-note-section h2 { font-size: 16px; margin: 24px 0 10px; }
.book-summary ul, .book-keywords ul, .book-key-sentences ul { padding-left: 20px; margin-bottom: 0; }
.book-keywords, .book-key-sentences, .book-note-section { margin: 24px 0; }
.book-keywords li { margin-bottom: 8px; line-height: 1.65; }
.book-keywords .book-ja { display: inline-block; margin-left: 8px; color: var(--muted); font-size: 0.9em; }
.book-key-ja { display: block; color: var(--muted); font-size: 0.9em; margin-top: 2px; }
.book-hide-japanese .book-ja, .book-hide-japanese .book-summary { display: none; }
.book-hide-japanese .book-passage:has(.book-ja):not(:has(.book-en)) { display: none; }
#book-complete { margin-top: 28px; }
#book-complete[aria-pressed="true"], #book-bookmark[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.book-dialog { width: min(680px, calc(100% - 24px)); max-height: 85dvh; overflow: auto; border: 1px solid var(--line); padding: 20px; border-radius: 20px; background: var(--bg); color: var(--ink); }
.book-dialog::backdrop { background: rgba(0,0,0,.5); }
.book-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.book-dialog-heading h2 { margin: 0; font-size: 20px; }
.book-dialog > button, .book-dialog > a { display: block; margin: 16px 0; min-height: 44px; }
.book-font-controls { display: flex; align-items: center; justify-content: center; gap: 20px; padding: 24px 0; }
#book-search-query { width: 100%; padding: 12px; min-height: 44px; font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; }
#book-search-results { list-style: none; padding: 0; }
#book-search-results button { width: 100%; text-align: left; margin: 6px 0; }
.book-dock { position: fixed; bottom: 0; left: 0; right: 0; transform: none; z-index: 1000; width: 100%; max-width: none; height: calc(64px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; justify-content: space-around; gap: 4px; padding: 4px max(8px, calc((100% - 520px) / 2)) calc(4px + env(safe-area-inset-bottom, 0px)); border: 0; border-top: 1px solid rgba(255,255,255,.2); border-radius: 0; background: rgba(28,25,21,.78); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); color: #fff; box-shadow: 0 -4px 20px rgba(0,0,0,.35); }
.book-dock[hidden] { display: none; }
.book-dock-viewport { flex: 1; min-width: 0; height: 100%; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; }
.book-dock-viewport::-webkit-scrollbar { display: none; }
.book-dock-face { flex: 0 0 100%; width: 100%; min-width: 0; scroll-snap-align: start; display: flex; align-items: center; justify-content: space-around; gap: 2px; }
.book-dock button { min-height: 44px; min-width: 40px; padding: 4px; color: #fff; background: transparent; border: 0; border-radius: 12px; font: 15px/1.2 -apple-system, sans-serif; }
.book-dock button small { display: block; font-size: 10px; }
#book-audio-play { width: 38px; min-width: 38px; height: 38px; min-height: 38px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 14px; display: grid; place-items: center; padding: 0; }
.book-reader .reader-section-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 18px; flex-wrap: wrap; }
.book-reader .reader-inline-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.book-reader #book-audio-speed { min-height: 34px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: inherit; font-size: 13px; }
.book-progress-link { display: block; padding: 12px 14px; margin: 10px 0 12px; text-decoration: none; color: inherit; }
.book-progress-link progress { margin: 8px 0 0; height: 8px; }
.book-progress-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14px; }
#book-japanese { font-size: 11px; }
#book-japanese[aria-pressed="false"] { text-decoration: line-through; opacity: .65; }
#book-audio-time { font: 11px/1.3 ui-monospace, monospace; white-space: nowrap; }
#book-dock-switch { flex: 0 0 44px; min-width: 44px; font-size: 32px; padding: 0; }
.book-reading-page .site-bottom-nav { display: none; }
.book-reading-page #book-nav-face .site-bottom-nav { position: static; transform: none; width: 100%; max-width: none; height: 56px; padding: 0; border: 0; background: transparent; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.book-reading-page #book-nav-face .nav-item { padding: 3px 0; }
.book-reading-page #book-nav-face .nav-label { font-size: 9px; }
.book-reading-page #book-nav-face .nav-ico { width: 19px; height: 19px; }
/* Book and learning controls stay within their own pages. */
.routine-badge{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:0 8px;border:1px solid var(--border,#8886);border-radius:24px;font:600 13px system-ui;text-decoration:none;color:inherit;white-space:nowrap}
.catalog-heading .routine-badge{margin-left:auto}.catalog-heading .catalog-search-button{margin-left:0}
#list-masthead .routine-badge{margin-left:auto;margin-right:8px;min-height:44px;height:44px;min-width:44px}
.learning-card,.book-count-panel{margin:16px 0;padding:18px;border:1px solid var(--border,#8885);border-radius:18px;background:var(--card-bg,transparent)}
.learning-card h2,.book-count-panel h2{font-size:18px;margin:0 0 12px}.learning-card progress{display:block;width:100%;height:10px;margin:12px 0;accent-color:#1ca890}
.book-series-tabs{display:flex;gap:8px;overflow-x:auto;padding:6px 0 14px}.book-series-tabs button{flex-shrink:0;min-height:44px;padding:8px 14px;border-radius:18px;border:1px solid var(--border,#8886);background:transparent;color:inherit}.book-series-tabs button[aria-pressed=true]{background:#268c7a;color:white}
.book-sort-label{display:flex;align-items:center;gap:12px;margin-bottom:16px}.book-sort-label select{min-height:44px;background:transparent;color:inherit;border:1px solid #8886;border-radius:8px;padding:6px}
.book-translation{font-size:.9em;line-height:1.9;margin:8px 0 22px;padding:0;border:0;background:transparent;color:var(--muted)}
.book-speaking{color:inherit;background:color-mix(in srgb,var(--ink) 8%,transparent)!important;box-shadow:none;border-radius:6px;padding:2px 6px}.book-hide-japanese .book-translation{display:none}
.book-count-panel button,.learning-page button{min-height:44px;padding:8px 14px;border:1px solid #8886;border-radius:12px;background:transparent;color:inherit;cursor:pointer}.book-count-panel button{display:block;width:100%;margin:8px 0}.book-count-panel button:disabled{opacity:.6}
.learning-page label{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:12px 0}.learning-page input,.learning-page select{font:inherit;min-height:44px;max-width:140px;width:100px;background:transparent;color:inherit;border:1px solid #8887;border-radius:8px;padding:8px}.routine-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;border-bottom:1px solid #8884;padding:10px 0}.routine-row label{flex:1;min-width:180px}.routine-row input{width:86px}.learning-day{padding:14px 0;border-bottom:1px solid #8884;line-height:1.8}.learning-page .catalog-heading h1{font-size:22px}.learning-page .catalog-heading a{font-size:14px}.learning-page ol{padding-left:20px}.learning-page li{padding:12px 0;line-height:1.8}.learning-page li button{display:block;margin-top:8px}
/* Keep all daily controls on one compact row at phone widths. */
.routine-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;padding:12px 0}.routine-row label{display:flex;flex-direction:column;align-items:flex-start;min-width:0;font-size:14px;gap:8px}.routine-row button{align-self:end;margin-bottom:12px;padding:8px;white-space:nowrap;font-size:13px}.learning-card progress{appearance:none;border:0;border-radius:8px;overflow:hidden;background:var(--line)}.learning-card progress::-webkit-progress-bar{background:var(--line)}.learning-card progress::-webkit-progress-value{background:#1ca890}.learning-card progress::-moz-progress-bar{background:#1ca890}
/* Lyric reading and playlist editing. */
.song-listen a{display:inline-flex;align-items:center;gap:8px}.song-listen img{width:24px;height:24px;object-fit:contain}.song-listen button,#song-info-open,.song-text-heading button{min-height:44px;border:1px solid var(--line);border-radius:12px;padding:8px 12px;background:var(--paper);color:var(--ink);font:inherit}
.song-text-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.song-text-heading h2{margin:12px 0}#song-translation-toggle[aria-pressed=false]{text-decoration:line-through;opacity:.7}.song-hide-translation .song-japanese{display:none}
#song-passages section{margin:0 0 18px}#song-passages .song-stanza-start{margin-top:36px}#song-passages .song-english{margin:0 0 6px;line-height:1.75}#song-passages .song-japanese{margin:0;line-height:1.8;color:var(--muted);font-size:.9em}
.song-info-dialog{max-width:620px}.song-info-dialog label{display:block;margin:14px 0 6px}.song-info-dialog input,.song-info-dialog textarea,.song-info-dialog select{width:100%;min-height:44px;border:1px solid var(--line);border-radius:8px;padding:10px;color:var(--ink);background:var(--paper);font:inherit}.song-info-dialog textarea{resize:vertical}
.song-background-details li{margin:14px 0;line-height:1.9}.song-guide dt{font-weight:700;margin:22px 0 8px}.song-guide dd{margin-left:0;line-height:1.9}
.playlist-manage{display:flex;align-items:flex-start;gap:12px}.playlist-manage .song-editor{flex:1;margin:0}.playlist-manage summary{list-style:none;display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px}.playlist-manage summary::-webkit-details-marker{display:none}.playlist-manage svg,.icon-button svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8}.icon-button{min-width:44px;min-height:44px;border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--ink)}
#playlist-tracks .music-row-shell{display:flex;align-items:center;gap:8px}#playlist-tracks input[type=checkbox]{width:22px;height:22px;flex-shrink:0;accent-color:var(--accent)}#playlist-tracks .song-tile{flex:1;min-width:0}#playlist-tracks .music-art{width:48px;height:48px;flex-basis:48px}#playlist-tracks .music-row-text h2{font-size:15px}#playlist-tracks .music-row-text small{display:none}
.playlist-drag-handle{touch-action:none;cursor:grab;min-width:44px;min-height:44px;border:0;background:transparent;color:var(--muted);font-size:24px}.playlist-drag-handle:active{cursor:grabbing}.playlist-dragging{outline:2px solid var(--accent);background:var(--paper)}.playlist-drag-handle:disabled{opacity:.3}
.playlist-add-tracks{margin-top:28px;border-top:1px solid var(--line);padding-top:20px}#playlist-song-search,#song-lookup-query{width:100%;min-height:44px;padding:10px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);font:inherit}.playlist-choice{min-height:44px;margin:0;padding:12px 0;border-bottom:1px solid var(--line)}.playlist-choice input{flex-shrink:0}
.song-import-preview,.song-metadata-candidate{display:flex;align-items:center;gap:12px}.song-import-preview{padding:14px 0}.song-import-preview p{font-size:13px;color:var(--muted)}.song-metadata-candidate{width:100%;text-align:left;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--ink);padding:12px 0;font:inherit;min-height:64px}.song-metadata-candidate .music-art{flex-shrink:0}#song-lookup-results{max-height:380px;overflow-y:auto}#song-lookup-form>button{min-height:44px;margin:10px 0}.song-import{border-bottom:1px solid var(--line);padding-bottom:16px}#song-add-preview:empty,#song-add-provenance:empty{display:none}
/* Paired lines form a stanza, rather than a separate card for every line. */
#song-passages>section{border:0;padding:0;margin:0 0 18px}#song-passages .song-stanza-start{margin-top:32px}#song-passages .song-english{font:var(--font-base,18px)/1.8 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}#song-passages .song-japanese{font-size:calc(var(--font-base,18px)*.9)}
.playlist-manage{position:relative;display:block;min-height:44px;margin-bottom:20px}.playlist-manage .song-editor{padding:0;border:0;border-radius:0;background:none}.playlist-manage summary{width:44px;height:44px;padding:0;border:1px solid var(--line);border-radius:12px;background:var(--paper)}.playlist-manage form{margin-top:16px;padding:16px;border:1px solid var(--line);border-radius:12px}.playlist-manage #playlist-delete{position:absolute;top:0;left:56px}
.playlist-check{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;margin:0;cursor:pointer}#playlist-tracks .playlist-check input{margin:0}.playlist-drag-handle{user-select:none;-webkit-user-select:none}

/* Paint the news header at its actual position instead of rasterizing a moving layer. */
.list-stage > .masthead,.list-toolbar{filter:none;backdrop-filter:none;-webkit-backdrop-filter:none;will-change:auto}
.list-stage>.masthead{gap:6px;padding:4px 16px}.list-page .masthead .mark{font-size:24px;flex-shrink:0}#list-masthead .routine-badge{margin:0 0 0 auto;flex-shrink:0;padding:0 4px}
#list-url-open{display:flex;flex-direction:column;justify-content:center;align-items:center;flex:0 0 56px;min-height:44px;border:1px solid var(--line);border-radius:12px;background:var(--paper);color:var(--ink);font:11px/1.25 -apple-system,BlinkMacSystemFont,sans-serif;padding:3px}#list-search-open{flex:0 0 44px}
#list-url-dialog{position:fixed;inset:max(12px,env(safe-area-inset-top,0px)) 0 auto;margin:0 auto;width:min(680px,calc(100% - 32px));max-height:85dvh;overflow:auto;border:1px solid var(--line);border-radius:18px;padding:20px;background:var(--bg);color:var(--ink)}#list-url-dialog::backdrop{background:rgba(0,0,0,.5)}#list-url-close{min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink)}#list-url-dialog .feed-custom-box{display:flex;flex-direction:column;gap:12px;margin:12px 0}#list-url-dialog input{width:100%;min-height:44px}#list-url-dialog .feed-custom-btn{min-height:44px;white-space:normal}#list-url-dialog label{font-size:14px}
/* Music dialogs use the top layer, above both faces of the navigation. */
.music-dialog { position:fixed; inset:max(12px,env(safe-area-inset-top,0px)) 0 auto; margin:0 auto; width:min(620px,calc(100% - 24px)); max-height:calc(100dvh - 36px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)); padding:20px; overflow-y:auto; overscroll-behavior:contain; color:var(--ink); background:var(--bg); border:1px solid var(--muted); border-radius:18px; }
.music-dialog .book-dialog-heading { margin-bottom:18px; }
.music-dialog label { display:block; margin:18px 0 6px; font:600 12px/1.5 -apple-system,BlinkMacSystemFont,sans-serif; color:var(--muted); }
.music-dialog input,.music-dialog textarea,.music-dialog select,.lyrics-page input:not([type=checkbox]),.lyrics-page select,.song-key-picker select { background:color-mix(in srgb,var(--bg),var(--ink) 9%); border:1px solid color-mix(in srgb,var(--bg),var(--ink) 35%); color:var(--ink); border-radius:10px; min-height:44px; padding:10px; font:16px/1.5 -apple-system,BlinkMacSystemFont,sans-serif; width:100%; box-sizing:border-box; }
.music-dialog input::placeholder { color:var(--muted); opacity:1; }
.music-dialog button,.lyrics-page #song-add-open,.lyrics-page .music-edit-link,.song-hero-actions button,#song-playlist-open { background:color-mix(in srgb,var(--bg),var(--ink) 14%); color:var(--ink); border:1px solid color-mix(in srgb,var(--bg),var(--ink) 35%); border-radius:10px; min-height:44px; padding:10px 14px; font:inherit; }
.music-dialog button[type=submit] { background:var(--ink); color:var(--bg); margin-top:18px; }
.music-dialog button:focus-visible,.music-dialog input:focus-visible,.music-dialog textarea:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.music-dialog .book-dialog-heading button { margin:0; min-width:44px; }
.music-dialog .playlist-choice { display:flex; align-items:center; gap:12px; font-size:16px; color:var(--ink); }
.music-dialog .playlist-choice input { width:22px; min-height:22px; height:22px; }
#song-add-open { margin:0 0 18px; }
.lyrics-page .playlist-tile { padding:14px 0; font:inherit; }
.lyrics-page .music-edit-link { width:44px; padding:6px; background:transparent; border:0; }
.song-hero-actions { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.song-key-picker { max-width:145px; }
.song-key-picker select,.music-dialog select,.lyrics-page select { appearance:none; -webkit-appearance:none; cursor:pointer; }
.song-hero-actions #song-info-open { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; padding:8px; }
#song-playlist-open { margin-top:10px; font-size:12px; }
.song-memo { margin:18px 0; white-space:pre-line; line-height:1.7; color:var(--muted); }
#song-quick-status:empty { display:none; }
#song-text,#song-background-section,#song-expressions-section { scroll-margin-top:20px; }
.song-dock #song-dock-switch { flex:0 0 32px; min-width:32px; font-size:32px; padding:0; }
.song-dock #song-controls-face button { flex:1; min-width:0; font-size:19px; padding:4px 1px; }
.song-dock #song-controls-face small { font-size:9px; white-space:nowrap; }
.song-dock #song-translation-toggle[aria-pressed=false] { opacity:.6; }
.song-dock #song-nav-face .site-bottom-nav { position:static; transform:none; width:100%; max-width:none; height:56px; padding:0; border:0; background:transparent; box-shadow:none; backdrop-filter:none; -webkit-backdrop-filter:none; }
.song-dock #song-nav-face .nav-item { padding:3px 0; }
.song-dock #song-nav-face .nav-label { font-size:9px; }
.song-dock #song-nav-face .nav-ico { width:19px; height:19px; }
#menu-sync-status { font-size:12px; color:var(--muted); padding:8px 16px; margin:0; }
.song-empty-guide { padding:18px; border:1px solid var(--line); border-radius:14px; line-height:1.8; }
.song-empty-guide>ul { list-style:disc; padding-left:24px; margin:16px 0; }
.song-empty-guide li { padding:12px 0; }
.song-empty-guide li>p { font-size:14px; color:var(--muted); margin:8px 0; }
.song-empty-guide summary { font-weight:700; min-height:44px; cursor:pointer; padding:10px 0; }
#song-codex-request { width:100%; box-sizing:border-box; padding:12px; font:13px/1.7 -apple-system,sans-serif; color:var(--ink); background:var(--paper); border:1px solid var(--line); border-radius:10px; }
.song-dropzone { border:2px dashed var(--muted); padding:24px 12px; border-radius:12px; text-align:center; cursor:pointer; }
.song-dropzone.drag-over,.song-dropzone:focus-visible { border-color:var(--accent); outline:2px solid var(--accent); outline-offset:3px; }
.song-registration-note { border-left:3px solid var(--accent); padding:10px 14px; line-height:1.7; font-size:14px; }
@media (hover:none),(pointer:coarse) { .song-dropzone { display:none; } }
/* Music page controls share one compact row; details have their own header. */
.music-library-tools { display:grid; grid-template-columns:auto minmax(0,1fr); gap:12px; margin-bottom:16px; }
.music-library-tools #song-add-open,.music-library-tools #playlist-add-open { margin:0; white-space:nowrap; font-size:14px; }
.lyrics-page .music-library-tools select { width:100%; min-width:0; font-size:14px; }
.music-back { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; padding:8px; color:var(--ink); text-decoration:none; margin-bottom:8px; }
.music-back svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:2.5; }
.song-hero-actions #song-playlist-open { width:44px; height:44px; margin:0; padding:8px; font-size:inherit; }
.song-key-picker { width:110px; max-width:110px; flex:0 1 110px; }
.song-key-picker select { font-size:14px; padding:8px; }
.song-meta-icons { display:inline-flex; gap:8px; align-items:center; flex-shrink:0; }
.song-memo label { display:block; margin-bottom:6px; font-size:12px; font-weight:600; color:var(--muted); }
.song-memo textarea { width:100%; box-sizing:border-box; min-height:76px; max-height:180px; resize:vertical; padding:10px; font:16px/1.6 -apple-system,sans-serif; background:color-mix(in srgb,var(--bg),var(--ink) 9%); color:var(--ink); border:1px solid color-mix(in srgb,var(--bg),var(--ink) 35%); border-radius:10px; }
#song-memo-status { min-height:18px; margin:4px 0; font-size:12px; }
.song-info-dialog { max-height:calc(100dvh - 140px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)); }
.song-info-dialog[open] { display:flex; flex-direction:column; }
.song-info-dialog .book-dialog-heading { flex-shrink:0; }
#song-info-form { display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.song-info-fields { overflow:auto; min-height:0; padding-right:4px; }
.song-info-footer { display:flex; justify-content:space-between; gap:16px; flex-shrink:0; padding-top:14px; }
.song-info-footer button,.song-info-footer button[type=submit] { margin:0; min-width:80px; }
.music-dialog .danger-button { color:#ef7777; border-color:#b74343; }
#song-info-status:empty { display:none; }
.song-guide h2 { font-size:22px; margin:24px 0 16px; }
.song-guide dt { font-size:1.12em; }
.song-dock #song-controls-face button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; }
.song-dock #song-controls-face svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.8; }
.song-dock #song-controls-face small { font-size:10px; }
.music-toast { position:fixed; top:calc(12px + env(safe-area-inset-top,0px)); left:50%; transform:translateX(-50%); z-index:1200; width:max-content; max-width:calc(100% - 32px); box-sizing:border-box; margin:0; padding:12px 18px; border:1px solid var(--muted); border-radius:14px; background:var(--ink); color:var(--bg); box-shadow:0 5px 20px #0004; pointer-events:none; font-size:14px; }
.playlist-source-tabs { display:flex; gap:8px; margin:14px 0; }
.playlist-source-tabs button { flex:1; }
.playlist-source-tabs button[aria-selected=true] { background:var(--ink); color:var(--bg); }
#playlist-global-form { display:flex; gap:8px; }
#playlist-global-query { min-width:0; flex:1; }
#playlist-tracks { position:relative; }
#playlist-tracks .music-row-shell { position:relative; }
#playlist-tracks .playlist-dragging { z-index:20; box-shadow:0 8px 24px #0006; opacity:.95; }
.music-playlist-page { overscroll-behavior-x:contain; }
/* Compact headings align across ニュース・保存教材・多読・歌詞 at 53px height and 16px side inset. */
.catalog-page .book-page { padding: 0 16px 120px; }
.list-stage > .masthead, .catalog-heading {
  box-sizing: border-box;
  height: 53px;
  min-height: 53px;
  gap: 6px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.list-stage > .masthead { padding: 4px 16px; }
.catalog-heading { padding: 4px 0; }
.list-page .masthead .mark, .catalog-heading h1 {
  margin: 0;
  font: 700 24px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  flex-shrink: 0;
}
#list-masthead .routine-badge, .catalog-heading .routine-badge {
  margin: 0 0 0 auto;
  flex-shrink: 0;
  padding: 0 8px;
  min-width: 44px;
  min-height: 44px;
  height: 44px;
}
#list-search-open, .catalog-heading .catalog-search-button {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.music-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.page-help-button { display:inline-flex; align-items:center; justify-content:center; flex:0 0 44px; width:44px; height:44px; color:var(--ink); border-radius:50%; }
.page-help-button svg { width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.8; }
.page-help-button:focus-visible { outline:2px solid var(--accent); }
.page-title-row { display:flex; align-items:center; gap:8px; }
.page-title-row>h1 { flex:1; min-width:0; }
.site-bottom-nav .nav-label { display:none; }
.bottom-menu-content .bottom-menu-item { display:flex; align-items:center; gap:12px; }
.bottom-menu-content .menu-link-ico { flex:0 0 24px; width:24px; height:24px; fill:none; stroke:currentColor; stroke-width:1.8; }
.song-add-dialog { max-height:calc(100dvh - 140px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)); }
.song-add-dialog #song-lookup-results { max-height:240px; }
.music-import-entry { display:flex; align-items:center; gap:12px; flex-wrap:wrap; font-size:12px; margin:8px 0 16px; }
.music-import-entry button,.playlist-source-tabs button,#playlist-global-form button { min-height:44px; padding:8px 12px; font:inherit; background:var(--paper); color:var(--ink); border:1px solid var(--muted); border-radius:10px; }
#music-import-dialog { max-height:calc(100dvh - 140px); }
#music-import-preview { max-height:240px; overflow:auto; padding-left:20px; }
.help-page { padding-top:0; }
.help-toc { display:flex; flex-wrap:wrap; gap:8px 16px; margin:16px 0 24px; }
.help-section { scroll-margin-top:16px; border-top:1px solid var(--line); padding:16px 0; }
.help-section h2,.help-ai h2 { font-size:20px; }
.help-section li { margin:12px 0; line-height:1.9; }
.help-section ul { padding-left:22px; }
.help-ai { border:1px solid var(--line); border-radius:14px; padding:16px; margin-bottom:24px; scroll-margin-top:12px; }
.help-ai label { display:block; font-size:13px; margin:8px 0; }
.help-ai textarea { width:100%; padding:12px; font:16px/1.7 -apple-system,sans-serif; color:var(--ink); background:var(--paper); border:1px solid var(--muted); border-radius:10px; }
.help-ai button { min-height:44px; padding:10px 18px; font:inherit; color:var(--bg); background:var(--ink); border:0; border-radius:10px; margin:10px 0; }
#help-ai-answer { white-space:pre-wrap; }
#help-ai-links { display:flex; flex-wrap:wrap; gap:12px; margin:12px 0; }
.music-detail-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:8px; }
.music-detail-heading .music-back { margin:0; }

/* Music registration is handled by Codex until end-to-end intake is available. */
.music-registration-entry { display: none !important; }

/* Music study controls are scoped to music pages. */
/* Music library primary bar: single-row red-underline swipeable tabs. */
.lyrics-page .music-tabs {
  display: flex;
  gap: 0;
  margin: 10px 0 14px;
  padding: 0;
  border-bottom: 1px solid var(--line);
}
.lyrics-page .music-tabs button {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
}
.lyrics-page .music-tabs button[aria-selected="true"] {
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}
.lyrics-page .music-tabs button::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 14%;
  right: 14%;
  height: 2.5px;
  border-radius: 2px 2px 0 0;
  background: #ff334b;
  opacity: 0;
}
.lyrics-page .music-tabs button[aria-selected="true"]::after {
  opacity: 1;
}
#music-categories,
#music-categories[hidden] {
  display: none !important;
}
.music-category-tools { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 10px; }
.music-category-tools select { min-width:130px; max-width:100%; }
.music-folder-row { display:flex; gap:6px; margin:12px 0; }
.music-folder-row input { width:0; flex:1; min-width:0; }
.music-folder-row button { flex:0 0 auto; }
.song-study-fields { display:flex; flex-wrap:wrap; gap:12px; margin:18px 0; padding:14px; background:var(--paper); border:1px solid var(--line); border-radius:14px; }
.song-study-fields label { display:flex; flex-direction:column; gap:6px; font-size:13px; color:var(--muted); flex:1 1 120px; }
.song-study-fields select { width:100%; color:var(--ink); font-size:16px; }
#song-study-status { flex:1 1 100%; font-size:13px; margin:0; }
.song-study-summary { color:var(--muted); }
#song-passages .song-line-note { margin:6px 0 12px; padding:12px 14px; border-left:1px solid var(--line); background:var(--paper); border-radius:8px; color:var(--ink); font-size:.88em; line-height:1.9; }
#song-notes-toggle[aria-pressed=true] { color:var(--accent); }


/* Compact song details: accessible labels stay available without visible headings. */
.song-page { padding-top:4px; }
.song-page #song-back { margin-bottom:0; }
.song-page .song-hero { margin-top:0; align-items:start; }
.song-page #song-info-open,.song-page #song-playlist-open,.song-page #song-text-open,.song-page #song-font-open { border:0; background:transparent; box-shadow:none; padding:8px; }
.song-study-fields { padding:0; border:0; background:none; gap:8px; margin:12px 0; align-items:center; }
.song-study-fields label { flex:0 0 auto; display:block; }
.song-study-fields #song-rating { width:150px; letter-spacing:2px; }
.song-study-fields #song-comprehension { width:62px; font-size:23px; text-align:center; }
.song-study-fields select { border:0; background:transparent; }
.song-memo label.sr-only { position:absolute; margin:0; }
.song-heading-actions { display:flex; align-items:center; gap:6px; }
#song-font-open { font-size:20px; }
.song-font-controls { display:flex; align-items:center; gap:12px; }
.song-font-controls>span:last-of-type { font-size:26px; }
#song-font-size { flex:1; min-width:0; padding:0; border:0; background:transparent; accent-color:var(--accent); }
#song-font-value { font-variant-numeric:tabular-nums; min-width:3.2em; }
#song-passages { font-size:var(--font-base,18px); }
#song-passages .song-english { font-size:inherit; }
#song-passages .song-japanese { font-size:.9em; }
#song-passages .song-line-note { font-family:inherit; font-size:.9em; font-weight:400; }
.song-note-trigger { cursor:pointer; }
.song-note-trigger:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.karaoke-folder-assignment { display:grid; gap:6px; margin:14px 0; }
.page-help-button svg { width:22px; height:22px; }

.song-study-fields select { appearance:none; -webkit-appearance:none; cursor:pointer; }
#song-study-status:empty,#song-memo-status:empty,#song-quick-status:empty { display:none; }

.song-page #song-records-toggle { border:0; background:transparent; box-shadow:none; font-size:14px; padding:8px; }
.song-records { margin:12px 0; }
.song-records .song-key-picker { display:block; width:110px; max-width:100%; margin-bottom:8px; }

/* Only reading content scales; music headers, tabs, forms and menus stay compact. */
#song-text,#song-background-section,#song-expressions-section { font-size:var(--font-base,18px); }
.lyrics-page .music-row-text h2 { font-size:calc(var(--font-base,18px) * 17 / 18); }
.lyrics-page .music-row-text p { font-size:calc(var(--font-base,18px) * 14 / 18); }
.lyrics-page .music-row-text small { font-size:calc(var(--font-base,18px) * 12 / 18); }
.lyrics-page .playlist-hero h2 { font-size:calc(var(--font-base,18px) * 24 / 18); }
.song-page .song-guide h2,.song-page .song-text-heading h2 { font-size:calc(var(--font-base,18px) * 22 / 18); }
.song-page #song-background,.song-page .song-guide dl { font-size:inherit; }
.book-reader-content h2 { font-size:calc(var(--font-base,18px) * 22 / 18); }
.book-reader h1 { font-size:calc(var(--font-base,18px) * 24 / 18); }
.book-notes summary { font-size:var(--font-base,18px); }
.book-shelf-page .book-tile-text h2 { font-size:var(--font-base,18px); }
.book-shelf-page .book-tile-text p,.book-shelf-page .book-shelf-progress { font-size:calc(var(--font-base,18px) * 13 / 18); }
.song-page .song-meta-icons .icon-button { display:inline-flex; align-items:center; justify-content:center; margin:0; line-height:1; }
.song-page .song-meta-icons svg { display:block; flex-shrink:0; }
/* Stage headings, comprehension badges, folder ungrouped section & karaoke controls (v63). */
.music-stage-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 18px 0 4px;
  padding: 4px 0 6px;
  border-bottom: 1px solid var(--line);
}
.music-stage-heading:first-child { margin-top: 4px; }
.music-stage-badge {
  display: inline-block;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.song-stage-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
  border: 1px solid var(--line);
}
.song-stage-pill[data-stage="0"] {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.14);
  border-color: rgba(255, 107, 107, 0.35);
}
.song-stage-pill[data-stage="1"] {
  color: #f0b429;
  background: rgba(240, 180, 41, 0.14);
  border-color: rgba(240, 180, 41, 0.35);
}
.song-stage-pill[data-stage="2"] {
  color: #34c759;
  background: rgba(52, 199, 89, 0.14);
  border-color: rgba(52, 199, 89, 0.35);
}
.music-stage-count {
  font-size: 12px;
  color: var(--muted);
}
.music-ungrouped-songs { margin-top: 22px; }
.music-ungrouped-songs[hidden] { display: none; }
.music-ungrouped-head {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  padding: 8px 0 6px;
  border-bottom: 1px solid var(--line);
}
.karaoke-controls {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}
.lyrics-page .karaoke-action-btn {
  flex: 1;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
}
.lyrics-page .karaoke-action-btn[aria-expanded="true"] {
  border-color: #ff334b;
  color: var(--ink);
}
.karaoke-sort-drawer {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.karaoke-sort-drawer[hidden] { display: none; }
.karaoke-chip-group { display: grid; gap: 6px; }
.karaoke-chip-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.karaoke-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.lyrics-page .karaoke-chip {
  min-height: 36px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.lyrics-page .karaoke-chip[aria-pressed="true"] {
  border-color: #ff334b;
  color: var(--ink);
  background: rgba(255, 51, 75, 0.14);
  font-weight: 700;
}
.karaoke-pickup {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 51, 75, 0.45);
  background: color-mix(in srgb, var(--paper), #ff334b 8%);
}
.karaoke-pickup[hidden] { display: none; }
.karaoke-pickup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.karaoke-pickup-badge {
  font-size: 12px;
  font-weight: 700;
  color: #ff5b6e;
}
.lyrics-page .karaoke-pickup-clear {
  min-height: 32px;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 8px;
}
.karaoke-pickup .music-row-shell { border-bottom: 0; }
.karaoke-pickup .song-tile { padding: 8px 0 4px; }

/* Preview translation retry keeps its space and remains reachable while reading. */
.pv-translation-tools { position:sticky; top:0; z-index:12; display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:52px; padding:4px 8px; background:var(--bg); border-bottom:1px solid var(--line); }
#pv-translation-status { font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#pv-translation-retry { flex-shrink:0; min-height:44px; padding:8px 12px; font:14px/1.4 -apple-system,sans-serif; color:var(--ink); background:var(--paper); border:1px solid var(--muted); border-radius:10px; }

.pv-published { font-size:13px; color:var(--muted); margin:12px 0; }

/* ニュース・ブックマーク一覧カードの日時とブックマークボタン */
.card-top { gap: 6px; overflow: visible; }
.card-top .cat { flex: 0 1 auto; min-width: 0; }
.card-date { margin-left: auto; flex-shrink: 0; font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.card-bookmark-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.card-bookmark-btn svg,
.reader-bookmark-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linejoin: round;
  transition: transform .12s ease, color .15s ease, fill .15s ease;
}
.card-bookmark-btn[aria-pressed="true"],
.reader-bookmark-btn[aria-pressed="true"] {
  color: var(--accent);
}
.card-bookmark-btn[aria-pressed="true"] svg,
.reader-bookmark-btn[aria-pressed="true"] svg {
  fill: currentColor;
}
.card-bookmark-btn:active svg,
.reader-bookmark-btn:active svg {
  transform: scale(0.9);
}
.top { align-items: center; gap: 10px; height: 48px; min-height: 48px; padding: 0 16px; }
.top .back { display: inline-flex; align-items: center; gap: 2px; text-decoration: none; min-height: 24px; }
.back-ico { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.top .date { margin-left: auto; }
.top-bookmark-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.top-bookmark-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linejoin: round;
  transition: transform .12s ease, color .15s ease, fill .15s ease;
}
.top-bookmark-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--paper));
  color: var(--accent);
}
.top-bookmark-btn[aria-pressed="true"] svg {
  fill: currentColor;
}
.top-bookmark-btn:active svg {
  transform: scale(0.9);
}
.reader-bookmark-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  font: 600 12px/1 var(--ja);
  white-space: nowrap;
  cursor: pointer;
}
.reader-bookmark-btn svg {
  width: 15px;
  height: 15px;
}
.reader-bookmark-btn[aria-pressed="true"] {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--paper));
}

/* 暗記カード設定・ショートカットモーダル＆カード一覧管理 */
.fc-settings-modal { position: fixed; inset: 0; z-index: 1200; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-start; justify-content: center; padding: max(8dvh, 44px) 16px 16px; }
.fc-settings-sheet { width: 100%; max-width: 480px; max-height: 85dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 36px rgba(0, 0, 0, .4); overflow: hidden; }
.fc-settings-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--paper); flex-shrink: 0; }
.fc-settings-head h3 { margin: 0; font-size: 16px; font-weight: 700; }
.fc-settings-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink); font-size: 15px; cursor: pointer; }
.fc-settings-tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--paper); padding: 0 12px; gap: 4px; flex-shrink: 0; }
.fc-settings-tab { flex: 1; padding: 10px 8px; border: 0; border-bottom: 2.5px solid transparent; background: transparent; color: var(--muted); font-family: var(--ja); font-size: 13.5px; font-weight: 700; cursor: pointer; }
.fc-settings-tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.fc-settings-body { padding: 14px 16px; height: min(350px, calc(82dvh - 96px)); min-height: 320px; overflow-y: auto; }
.fc-settings-note { margin: 0 0 10px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.fc-settings-subhead { margin: 14px 0 6px; font-size: 13px; font-weight: 700; }
.fc-shortcut-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fc-shortcut-table th, .fc-shortcut-table td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.fc-shortcut-table th { width: 42%; font-weight: 600; color: var(--ink); }
.fc-shortcut-table kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; }
.fc-gesture-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.fc-pref-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.fc-num-stepper { display: inline-flex; align-items: center; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); overflow: hidden; }
.fc-num-step-btn { width: 34px; height: 100%; border: 0; background: transparent; color: var(--ink); font: 700 16px/1 var(--ja); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
@media (hover: hover) { .fc-num-step-btn:hover { background: var(--hl); } }
.fc-num-stepper input[type="number"] { width: 52px; height: 100%; min-height: 0; padding: 0 4px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); font-size: 14px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield; }
.fc-num-stepper input[type="number"]::-webkit-outer-spin-button,
.fc-num-stepper input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.fc-pref-check { display: flex; align-items: center; gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; cursor: pointer; }
.deck-today-summary { margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.deck-item-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.deck-item-select { min-height: 30px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font-family: var(--ja); font-size: 12px; }
.deck-item-btn { min-height: 30px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); color: var(--ink); font-family: var(--ja); font-size: 12px; font-weight: 600; cursor: pointer; }
.deck-item-btn.is-suspended { border-color: var(--accent); color: var(--accent); }
.deck-suspended-badge { display: inline-block; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
/* Learning charts & spreadsheet reading history (v64). */
.learning-stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.learning-stat-box { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); display: flex; flex-direction: column; gap: 2px; }
.learning-stat-box span { font-size: 11px; color: var(--muted); }
.learning-stat-box strong { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.learning-chart-svg { display: block; width: 100%; height: auto; margin-top: 6px; }
.learning-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 6px; font-size: 12px; color: var(--muted); }
.learning-legend span { display: inline-flex; align-items: center; gap: 5px; }
.learning-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; }
.learning-work-bars { display: flex; flex-direction: column; gap: 10px; }
.learning-work-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.learning-work-meta span { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.learning-work-meta small { color: var(--muted); flex-shrink: 0; font-variant-numeric: tabular-nums; }
.learning-work-track { height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.learning-work-fill { height: 100%; border-radius: 999px; background: #1ca890; }
.learning-history-filters { display: flex; gap: 8px; margin: 10px 0 8px; }
.learning-history-filters input { flex: 1; min-width: 0; width: auto; max-width: none; }
.learning-history-filters select { width: auto; min-width: 86px; }
#learning-history-list { list-style: none; padding: 0; margin: 8px 0 0; }
.learning-history-item { padding: 10px 0; border-bottom: 1px solid var(--line); }
.learning-history-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.learning-kind-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(28, 168, 144, 0.16); color: #1ca890; }
.learning-kind-badge[data-kind="漫画"] { background: rgba(240, 180, 41, 0.16); color: #f0b429; }
.learning-kind-badge[data-kind="絵本"] { background: rgba(110, 168, 254, 0.16); color: #6ea8fe; }
.learning-history-sub { font-size: 12px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.learning-history-note { margin: 6px 0 0; font-size: 13px; line-height: 1.65; color: var(--ink); }

/* DUO 3.0 */
body.duo-has-dock .site-bottom-nav { display: none; }
body.duo-has-dock .duo-page { padding-bottom: 108px; }
.duo-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.duo-title { margin: 0; font-size: 20px; }
.duo-status { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.duo-setup-panel { padding: 16px; margin-bottom: 16px; }
.duo-setup-title { margin: 0 0 8px; font-size: 16px; }
.duo-setup-desc { margin: 0 0 12px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.duo-upload-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.duo-upload-btn { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.duo-import-progress { margin: 10px 0 0; font-size: 12px; color: var(--accent-strong, var(--accent)); min-height: 18px; }
.duo-section-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.duo-section-select { flex: 1; min-width: 0; min-height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); padding: 0 10px; font-size: 14px; }
.duo-progress-summary { margin: 0 0 12px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.duo-mode-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.duo-listen-tools, .duo-cloze-tools, .duo-instant-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.duo-speed-select { min-height: 32px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); padding: 0 10px; font-size: 12px; }
.duo-check-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.duo-counter { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.duo-sentence-list, .duo-cloze-list { display: flex; flex-direction: column; gap: 10px; }
.duo-sent-item, .duo-cloze-item { padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); transition: background-color 0.15s ease, border-color 0.15s ease; }
.duo-sent-item.is-active { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.duo-sent-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.duo-sent-num { border: 1px solid var(--border); background: var(--surface-2, var(--surface)); color: var(--ink); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-variant-numeric: tabular-nums; cursor: pointer; }
.duo-rev-pill { border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 999px; padding: 3px 10px; font-size: 11px; cursor: pointer; }
.duo-rev-pill.is-active { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.duo-sent-en, .duo-cloze-en { margin: 0 0 6px; font-size: 16px; line-height: 1.65; color: var(--ink); }
.duo-sent-ja { margin: 0; font-size: 13px; line-height: 1.55; color: var(--muted); }
.duo-sentence-list.duo-hide-ja .duo-sent-ja { display: none; }
.duo-sentence-list.duo-shadow-hide .duo-sent-en { filter: blur(5px); transition: filter 0.15s ease; }
.duo-sentence-list.duo-shadow-hide .duo-sent-item.is-active .duo-sent-en,
.duo-sentence-list.duo-shadow-hide .duo-sent-en:hover { filter: none; }
.duo-cloze-blank { display: inline-block; min-width: 42px; padding: 1px 7px; margin: 0 2px; border-radius: 6px; border: 1px dashed var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); font: inherit; font-size: 14px; cursor: pointer; vertical-align: baseline; }
.duo-cloze-blank.is-revealed { border-style: solid; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--ink); font-weight: 600; }
.duo-instant-card { padding: 18px 16px; }
.duo-instant-num { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.duo-instant-ja { margin: 0 0 12px; font-size: 16px; line-height: 1.65; color: var(--ink); }
.duo-instant-en { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); font-size: 16px; line-height: 1.65; color: var(--ink); }
.duo-instant-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.duo-dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface); border-top: 1px solid var(--border); padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
.duo-dock-row { max-width: 760px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.duo-dock-play { width: 42px; height: 42px; border-radius: 999px; border: none; background: #fff; color: #111; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.28); }
.duo-dock-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 78px; text-align: center; }
.pill-btn.is-on, .seg-btn.is-on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }


/* === DUO 3.0 Player & 3-Level Memorize === */
.duo-progress-badge { font-size: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 4px 10px; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.duo-mode-tabs { grid-template-columns: repeat(2, 1fr); }
.duo-submode-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.duo-segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); padding: 2px; gap: 2px; }
.duo-segmented button { border: none; background: transparent; color: var(--muted); font-size: 12px; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.duo-segmented button.is-active { background: var(--accent); color: #fff; font-weight: 600; }
.duo-view-toggle, .duo-pill-btn { border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-size: 12px; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.duo-view-toggle.is-on, .duo-pill-btn.is-on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); font-weight: 600; }
.duo-primary-outline { border-color: var(--accent); color: var(--accent); }

.duo-player-card { padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.duo-player-meta { display: flex; align-items: center; gap: 8px; }
.duo-player-num { font-size: 12px; font-weight: 700; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 3px 10px; border-radius: 999px; font-variant-numeric: tabular-nums; }
.duo-player-phase { font-size: 11px; color: var(--muted); background: var(--surface-2, var(--surface)); border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; }
.duo-player-body { min-height: 120px; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 8px 0; }
.duo-player-en { margin: 0; font-size: 20px; line-height: 1.65; color: var(--ink); font-weight: 500; }
.duo-player-ja { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
.duo-player-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.duo-gap-control { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 3px 8px; }
.duo-gap-control button { width: 22px; height: 22px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2, var(--surface)); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; }
.duo-gap-control output { min-width: 34px; text-align: center; color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 600; }

.duo-dock-btn { min-width: 40px; height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2, var(--surface)); color: var(--ink); font-size: 13px; cursor: pointer; font-variant-numeric: tabular-nums; }

.duo-level-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 10px; }
.duo-level-btn { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); cursor: pointer; }
.duo-level-btn.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.duo-level-btn.is-cleared .duo-level-stat { color: #22c55e; font-weight: 700; }
.duo-level-title { font-size: 12px; font-weight: 600; }
.duo-level-stat { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.duo-mem-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.duo-mem-progress-track { height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; margin-bottom: 12px; }
.duo-mem-progress-fill { height: 100%; background: var(--accent); transition: width 0.25s ease; }

.duo-mem-card { padding: 18px 16px; display: flex; flex-direction: column; gap: 14px; }
.duo-mem-en { font-size: 18px; line-height: 1.7; color: var(--ink); }
.duo-mem-ja { margin: 0; font-size: 16px; line-height: 1.65; color: var(--ink); }
.duo-mem-answer { padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); font-size: 18px; line-height: 1.65; color: var(--ink); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.duo-mem-audio-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.duo-mem-grade-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.duo-grade-btn { padding: 10px 4px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2, var(--surface)); color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer; }
.duo-grade-btn.is-again { border-color: #ef4444; color: #ef4444; }
.duo-grade-btn.is-hard { border-color: #f59e0b; color: #f59e0b; }
.duo-grade-btn.is-good { border-color: #3b82f6; color: #3b82f6; }
.duo-grade-btn.is-easy { border-color: #22c55e; color: #22c55e; }

.duo-mem-complete { padding: 24px 16px; text-align: center; }
.duo-complete-title { margin: 0 0 8px; font-size: 20px; font-weight: 700; color: var(--accent); }
.duo-complete-desc { margin: 0 0 16px; font-size: 14px; color: var(--muted); }
.duo-complete-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* === Music Player Layout Refresh === */
.duo-topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.duo-top-tabs { display: inline-flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.duo-top-tabs button { border: none; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; padding: 6px 16px; border-radius: 999px; cursor: pointer; }
.duo-top-tabs button.is-active { background: var(--accent); color: #fff; }
.duo-icon-btn { min-width: 34px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-size: 16px; cursor: pointer; }
.duo-player-toprow { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.duo-list-open-btn { border: 1px solid var(--border); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.duo-list-open-btn.is-on { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }

.duo-player-shell { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 18px 16px; display: flex; flex-direction: column; gap: 16px; }
.duo-lyric-stage { display: flex; flex-direction: column; gap: 12px; }
.duo-lyric-meta { display: flex; align-items: center; gap: 8px; }
.duo-lyric-text { min-height: 150px; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 8px 4px; }
.duo-player-en { font-size: 21px; line-height: 1.65; }
.duo-player-ja { font-size: 15px; line-height: 1.6; }

.duo-seek-wrap { display: flex; flex-direction: column; gap: 4px; }
.duo-seek-bar { width: 100%; accent-color: var(--accent); cursor: pointer; height: 4px; margin: 0; }
.duo-seek-times { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.duo-transport { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 4px 0; }
.duo-tr-btn { width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2, var(--surface)); color: var(--ink); font-size: 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.duo-tr-sec { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.duo-tr-play { width: 60px; height: 60px; border-radius: 999px; border: none; background: var(--accent); color: #fff; font-size: 22px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }

.duo-quick-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.duo-settings-drawer { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 12px; background: var(--surface-2, var(--surface)); border: 1px solid var(--border); }
.duo-setting-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.duo-setting-label { font-size: 13px; color: var(--muted); }

/* === YouTube Music x Language Player Design === */
html:has(body.duo-page) {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}
body.duo-page {
  background: #030303;
  color: #ffffff;
  margin: 0;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: pan-y;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(56px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", sans-serif;
}
html, body { touch-action: manipulation; overscroll-behavior: none; }
.ym-app { width: 100%; max-width: 640px; height: 100%; margin: 0 auto; padding: calc(6px + env(safe-area-inset-top)) 6px 6px; flex: 1; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden; overscroll-behavior: none; box-sizing: border-box; }
.ym-update-banner { width: 100%; border: none; border-radius: 12px; background: #2563eb; color: #ffffff; font-size: 14px; font-weight: 700; padding: 10px 12px; margin-bottom: 10px; cursor: pointer; text-align: center; flex-shrink: 0; }
.ym-workspace { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ym-status { font-size: 13px; color: #f87171; text-align: center; margin: 4px 0; }
.ym-screen { display: flex; flex-direction: column; gap: 10px; flex: 1; min-height: 0; }
.ym-screen[hidden] { display: none; }

/* Top bar */
.ym-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ym-top-spacer { width: 30px; flex-shrink: 0; }
.ym-sec-picker { display: inline-flex; align-items: center; gap: 4px; min-width: 0; }
.ym-icon-ghost { border: none; background: transparent; color: #aaa; font-size: 20px; width: 30px; height: 32px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.ym-icon-ghost:disabled { opacity: 0.25; cursor: default; }
.ym-sec-select { appearance: none; -webkit-appearance: none; background: #1a1a1a; color: #fff; border: none; border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600; max-width: 185px; cursor: pointer; text-align: center; }
.ym-pill-switch { display: inline-flex; background: #1d1d1d; border-radius: 999px; padding: 3px; }
.ym-pill-switch button { border: none; background: transparent; color: #aaa; font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; cursor: pointer; }
.ym-pill-switch button.is-active { background: #363636; color: #fff; }

/* Stage (Artwork replacement) */
.ym-stage {
  background: radial-gradient(circle at 50% 20%, #1f2229 0%, #0f1014 100%);
  border-radius: 16px;
  padding: 10px 10px 10px;
  min-height: 100px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.ym-stage.is-list-open {
  padding: 6px 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}
.ym-stage-card { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: space-between; }
.ym-stage-card[hidden], .ym-inline-list[hidden] { display: none; }
.ym-inline-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.ym-stage-top { display: flex; align-items: center; gap: 10px; }
.ym-badge-num { font-size: 15px; font-weight: 700; color: #9a9a9a; font-variant-numeric: tabular-nums; }
.ym-badge-phase { font-size: 13.5px; font-weight: 700; color: #d4d4d4; padding: 2px 9px; border-radius: 6px; display: inline-block; }
.ym-lv-btn { border: none; cursor: pointer; }
.ym-lv-btn:active { opacity: 0.8; }
.ym-badge-phase.is-lv1 { background: rgba(16, 185, 129, 0.28); color: #6ee7b7; }
.ym-badge-phase.is-lv2 { background: rgba(245, 158, 11, 0.28); color: #fcd34d; }
.ym-badge-phase.is-lv3 { background: rgba(239, 68, 68, 0.28); color: #fca5a5; }
.ym-badge-count { margin-left: auto; font-size: 14px; color: #9a9a9a; font-variant-numeric: tabular-nums; }
.ym-stage-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; justify-content: flex-start; gap: 12px; padding: 6px 2px 4px; scrollbar-width: none; }
.ym-stage-body::-webkit-scrollbar { display: none; }
.ym-stage-body > * { flex-shrink: 0; }
.ym-lyric-en { margin: 0; font-size: var(--duo-font-en, 22px); line-height: 1.55; font-weight: 600; color: #ffffff; letter-spacing: -0.01em; }
.ym-lyric-ja { margin: 0; font-size: var(--duo-font-ja, 17px); line-height: 1.55; color: #b3b3b3; }

/* Track title */
.ym-track-info { padding: 0 2px; margin-top: -2px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ym-track-title { font-size: 22px; font-weight: 700; color: #fff; line-height: 1.25; }
.ym-track-sub { display: inline-block; border: none; font-size: 15px; font-weight: 700; color: #aaaaaa; margin-top: 0; padding: 4px 14px; border-radius: 999px; cursor: pointer; }
.ym-track-sub:active { opacity: 0.78; }
.ym-mode-menu {
  background: #181a22;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}
.ym-mode-menu[hidden] { display: none; }
.ym-mode-opt {
  width: 100%;
  border: none;
  background: transparent;
  color: #ffffff;
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}
.ym-mode-opt.is-active { background: rgba(255, 255, 255, 0.1); }
.ym-mode-dot { width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }
.ym-mode-dot.is-cd { background: #60a5fa; }
.ym-mode-dot.is-ja2en { background: #fbbf24; }
.ym-mode-dot.is-fav { background: #fde047; }
.ym-mode-dot.is-lv1 { background: #34d399; }
.ym-mode-dot.is-lv2 { background: #fbbf24; }
.ym-mode-dot.is-lv3 { background: #f87171; }
.ym-mode-opt-text { display: flex; flex-direction: column; gap: 1px; }
.ym-mode-opt-text strong { font-size: 14px; font-weight: 700; color: #fff; }
.ym-mode-opt-text small { font-size: 11.5px; color: #9ca3af; }
.ym-track-sub.is-cd { background: rgba(37, 99, 235, 0.35); color: #93c5fd; }
.ym-track-sub.is-ja2en { background: rgba(217, 119, 6, 0.35); color: #fcd34d; }
.ym-track-sub.is-fav { background: rgba(234, 179, 8, 0.28); color: #fde047; }
.ym-fav-btn { border: none; background: rgba(255, 255, 255, 0.08); color: #9a9a9a; width: 38px; height: 38px; border-radius: 999px; font-size: 20px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: transform 0.1s ease, color 0.15s ease, background 0.15s ease; }
.ym-fav-btn:active { transform: scale(0.92); }
.ym-fav-btn.is-fav { color: #facc15; background: rgba(250, 204, 21, 0.18); }
.ym-fav-sm { width: 32px; height: 32px; font-size: 17px; margin-left: auto; }
.ym-mem-list-ico { margin-left: 0; color: #e5e5e5; }
.ym-mem-explain { background: transparent; border: none; border-top: 1px solid rgba(255, 255, 255, 0.14); border-radius: 0; padding: 10px 0 0; margin-top: 4px; display: flex; flex-direction: column; gap: 6px; font-size: calc(var(--duo-font-ja, 17px) - 1px); line-height: 1.55; color: #cbd5e1; }
.ym-player-explain { margin-top: 4px; text-align: left; }
.ym-mem-explain[hidden] { display: none; }
.ym-mem-explain-pt { margin: 0; color: #d1d5db; }
.ym-mem-explain-vocab { margin: 0; padding: 4px 0 0; list-style: none; border-top: 1px solid rgba(255, 255, 255, 0.08); display: flex; flex-direction: column; gap: 3px; }
.ym-mem-explain-vocab li { display: flex; gap: 8px; align-items: baseline; font-size: calc(var(--duo-font-ja, 17px) - 2px); }
.ym-mem-explain-vocab strong { color: #93c5fd; font-weight: 700; flex-shrink: 0; }
.ym-mem-explain-vocab span { color: #cbd5e1; }
.ym-mem-subrow { display: flex; align-items: center; justify-content: flex-end; margin-top: -6px; }
.ym-mem-tools-stack { display: flex; flex-direction: column; gap: 8px; }
.ym-mem-tools-top { display: flex; align-items: center; justify-content: flex-start; gap: 8px; }
.ym-mem-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; justify-content: flex-start; gap: 12px; padding-top: 4px; }
.ym-mem-bottom { display: flex; flex-direction: column; gap: 10px; }
.ym-mem-answer-row { display: flex; justify-content: center; }
.ym-mem-answer-btn { padding: 10px 24px; font-size: 14px; }
.ym-mem-answer-btn[hidden] { display: none; }
.ym-mem-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ym-grade-grid[hidden] { display: none; }
.ym-mem-next-btn { width: 100%; padding: 14px; font-size: 15px; font-weight: 800; }
.ym-mem-next-btn[hidden] { display: none; }
.ym-mem-actions .ym-chip { font-size: 13.5px; padding: 10px 4px; width: 100%; min-width: 0; justify-content: center; text-align: center; box-sizing: border-box; }
.ym-list-fav-btn { border: none; background: transparent; color: #555c68; font-size: 16px; padding: 2px 4px; cursor: pointer; flex-shrink: 0; line-height: 1; }
.ym-list-fav-btn.is-fav { color: #facc15; }

/* Chips */
.ym-chips { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; padding: 0 0 10px; }
.ym-chips-left { flex: 1 1 0; min-width: max-content; display: flex; align-items: center; gap: 5px; }
.ym-chips-right { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: flex-end; }
.ym-chips .ym-sec-picker-bar { gap: 2px; flex-shrink: 0; }
.ym-chips .ym-sec-picker-bar .ym-icon-ghost { width: 32px; height: 32px; font-size: 22px; }
.ym-chips .ym-sec-list-btn { padding: 6px 10px; font-size: 13px; }
.ym-chips::-webkit-scrollbar { display: none; }
.ym-chip { border: none; background: #1d1d1d; color: #e5e5e5; font-size: 14px; font-weight: 600; padding: 7px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.ym-chip:disabled { opacity: 0.35; cursor: default; }
.ym-chip.is-on { background: #ffffff; color: #030303; }
.ym-chip-accent { background: #262626; color: #fff; border: 1px solid rgba(255,255,255,0.22); }
.ym-chip-icon { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; }

/* Drawer & Subcontrols */
.ym-countdown { margin-top: 14px; font-size: 30px; font-weight: 800; color: #ffffff; text-align: center; font-variant-numeric: tabular-nums; }
.ym-subcontrols-row { display: flex; align-items: center; justify-content: flex-start; gap: 8px; padding: 2px 0; }
.ym-controls-sec-row { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 0 4px; }
.ym-sec-picker-bar { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.ym-sec-picker-bar .ym-icon-ghost,
.ym-sheet-title-wrap .ym-icon-ghost { width: 40px; height: 40px; font-size: 26px; color: #e5e5e5; }
.ym-sec-list-btn { display: inline-flex; align-items: center; gap: 6px; border: none; background: #1d1d1d; color: #ffffff; font-size: 14px; font-weight: 700; padding: 7px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.ym-sec-list-btn.is-on { background: #ffffff; color: #030303; }
.ym-sec-list-btn:active { background: #2d2d2d; }
.ym-gap-inline-ctrl { gap: 4px; padding: 3px 6px; }
.ym-inline-label { font-size: 12.5px; font-weight: 600; color: #aaaaaa; padding-left: 2px; white-space: nowrap; }
.ym-gap-inline-ctrl output { min-width: 34px; font-size: 13.5px; }
.ym-font-inline { gap: 4px; padding: 3px 6px; }
.ym-font-inline output { min-width: 34px; font-size: 13.5px; }
.ym-subcontrols-row .ym-chip { font-size: 13.5px; padding: 7px 12px; }
.ym-drawer { background: #141414; border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.ym-drawer-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ym-drawer-label { font-size: 14.5px; color: #b3b3b3; white-space: nowrap; }
.ym-speed-wrap { display: flex; align-items: center; gap: 10px; flex: 1; justify-content: flex-end; }
.ym-speed-pill { background: #262626; color: #fff; font-size: 13.5px; font-weight: 700; padding: 4px 10px; border-radius: 8px; font-variant-numeric: tabular-nums; min-width: 46px; text-align: center; }
.ym-range { width: 130px; accent-color: #ffffff; cursor: pointer; }
.ym-gap-ctrl { display: inline-flex; align-items: center; gap: 8px; background: #222; border-radius: 999px; padding: 3px 8px; }
.ym-gap-ctrl button { width: 24px; height: 24px; border-radius: 999px; border: none; background: #333; color: #fff; font-size: 15px; cursor: pointer; }
.ym-gap-ctrl output { font-size: 14px; font-weight: 600; color: #fff; min-width: 38px; text-align: center; font-variant-numeric: tabular-nums; }

/* Seekbar */
.ym-seek { display: flex; flex-direction: column; gap: 3px; padding-top: 0; }
.ym-seek-input { width: 100%; height: 4px; accent-color: #ffffff; cursor: pointer; margin: 0; }
.ym-seek-times { display: flex; justify-content: space-between; font-size: 12.5px; color: #9a9a9a; font-variant-numeric: tabular-nums; }

/* Transport */
.ym-controls { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 6px; margin-top: -6px; }
.ym-ctrl-btn,
.ym-ctrl-sec { position: relative; border: none; background: transparent; color: #ffffff; width: 58px; height: 58px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.ym-ctrl-btn small,
.ym-ctrl-sec small { position: absolute; bottom: -5px; left: 50%; transform: translateX(-50%); font-size: 12.5px; color: #b3b3b3; font-weight: 700; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ym-play-circle { width: 52px; height: 52px; border-radius: 999px; border: none; background: #ffffff; color: #030303; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 6px 22px rgba(255, 255, 255, 0.18); }

/* List view & Bottom Sheet */
.ym-sub-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ym-sub-title { margin: 0; font-size: 18px; font-weight: 700; color: #fff; }
.ym-sub-meta { font-size: 12px; color: #9a9a9a; font-variant-numeric: tabular-nums; }

.ym-player-list-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 72px;
}
.ym-player-list-page[hidden] { display: none; }
.ym-list-page-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ym-to-player-btn { font-size: 13px; padding: 7px 11px; background: #262626; color: #fff; }
.ym-sheet-title-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ym-sheet-title-wrap .ym-sec-select { max-width: 170px; font-size: 14px; padding: 7px 12px; }
.ym-sheet-count { font-size: 11px; font-weight: 700; color: #93c5fd; background: rgba(37, 99, 235, 0.25); padding: 2px 7px; border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ym-page-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.ym-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.ym-sheet-backdrop[hidden] { display: none; }
.ym-sheet-backdrop.is-open { opacity: 1; }
#duo-global-settings { background: rgba(0, 0, 0, 0.16); backdrop-filter: none; -webkit-backdrop-filter: none; }
.ym-sheet {
  width: 100%;
  max-width: 640px;
  max-height: 76dvh;
  background: linear-gradient(180deg, #171921 0%, #101116 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px 22px 0 0;
  padding: 10px 14px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.72);
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  box-sizing: border-box;
}
.ym-sheet-backdrop.is-open .ym-sheet { transform: translateY(0); }
.ym-sheet-handle { padding: 2px 0 10px; cursor: grab; touch-action: none; }
.ym-sheet-handle span { display: block; width: 40px; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.28); margin: 0 auto; }
.ym-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); margin-bottom: 8px; }
.ym-sheet-close { border: none; background: rgba(255, 255, 255, 0.1); color: #e5e5e5; width: 32px; height: 32px; border-radius: 999px; font-size: 15px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ym-sheet-list { overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.ym-settings-sheet { max-height: 60dvh; }
.ym-settings-body { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 8px; }
.ym-set-listen-only[hidden],
.ym-set-mem-only[hidden],
.ym-set-not-home[hidden] { display: none; }
.ym-shortcut-btn { margin-left: auto; color: #ffffff; width: 38px; height: 38px; flex-shrink: 0; }
.ym-list-mode-btn { font-size: 13px; padding: 6px 11px; flex-shrink: 0; }
.ym-sheet-title-wrap { width: 100%; }
.ym-sc-start-btn { border: none; background: rgba(37, 99, 235, 0.28); color: #93c5fd; font-size: 14px; font-weight: 700; padding: 12px 14px; border-radius: 12px; cursor: pointer; text-align: left; }
.ym-sc-start-btn:active { background: rgba(37, 99, 235, 0.42); }
.ym-sc-sublabel { margin: 2px 0 -4px; font-size: 12px; color: #9ca3af; font-weight: 600; }
.ym-sc-slots { display: flex; flex-direction: column; gap: 8px; }
.ym-sc-slot-row { display: flex; align-items: center; gap: 8px; }
.ym-sc-play-btn { flex: 1; min-width: 0; border: none; background: rgba(255, 255, 255, 0.08); color: #ffffff; font-size: 14px; font-weight: 700; padding: 10px 12px; border-radius: 10px; cursor: pointer; text-align: left; }
.ym-sc-play-btn.is-empty { color: #9ca3af; font-weight: 500; }
.ym-sc-select { appearance: none; -webkit-appearance: none; background: #1d1f26; color: #e5e7eb; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.ym-help-sheet { max-height: 78dvh; }
.ym-help-body { overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 12px; font-size: 13.5px; line-height: 1.6; color: #d1d5db; }
.ym-help-sec h3 { margin: 0 0 6px; font-size: 14.5px; font-weight: 800; color: #ffffff; }
.ym-help-sec p { margin: 0 0 6px; }
.ym-help-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.ym-help-list strong { color: #93c5fd; }
.ym-help-note { font-size: 12px; color: #9ca3af; }
.ym-anki-counts { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ym-anki-new { color: #60a5fa; }
.ym-anki-learn { color: #f87171; }
.ym-anki-rev { color: #34d399; }
.ym-sc-home-lbl { flex: 1; font-size: 14px; font-weight: 700; color: #e5e7eb; }
.ym-fav-edit-btn { font-size: 13px; padding: 7px 12px; margin-left: auto; flex-shrink: 0; }
.ym-fav-edit-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 4px 0 8px; flex-shrink: 0; }
.ym-fav-edit-bar[hidden] { display: none; }
.ym-fav-edit-bar .ym-chip { text-align: center; justify-content: center; padding: 8px 4px; font-size: 13px; }
.ym-chip-danger { background: rgba(239, 68, 68, 0.22); color: #fca5a5; }
.ym-list-item.is-fav-edit { align-items: center; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ym-list-item.is-dragging { background: rgba(59, 130, 246, 0.24); border-left-color: #60a5fa; transform: scale(1.015); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); z-index: 2; position: relative; }
.ym-fav-edit-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ym-fav-chk { width: 18px; height: 18px; accent-color: #3b82f6; cursor: pointer; }
.ym-drag-handle { color: #9ca3af; font-size: 16px; padding: 4px 2px; cursor: grab; touch-action: none; }
.ym-fav-del-btn { border: none; background: rgba(239, 68, 68, 0.2); color: #fca5a5; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 8px; cursor: pointer; flex-shrink: 0; }
.ym-mini-player {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(56px + env(safe-area-inset-bottom) + 6px);
  width: calc(100% - 16px);
  max-width: 624px;
  z-index: 45;
  background: rgba(24, 26, 34, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
}
.ym-mini-info {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: #ffffff;
  text-align: left;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ym-mini-badge { font-size: 10.5px; font-weight: 800; color: #93c5fd; }
.ym-mini-title { font-size: 12.5px; font-weight: 700; color: #ffffff; }
.ym-mini-en { font-size: 12px; color: #b3b3b3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ym-mini-play-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: none;
  background: #ffffff;
  color: #030303;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.ym-sheet-resume {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(96, 165, 250, 0.35);
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.28) 0%, rgba(37, 99, 235, 0.12) 100%);
  color: #ffffff;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  cursor: pointer;
  text-align: left;
  flex-shrink: 0;
}
.ym-sheet-resume:active { background: rgba(37, 99, 235, 0.38); }
.ym-resume-badge { font-size: 11px; font-weight: 800; color: #93c5fd; background: rgba(37, 99, 235, 0.35); padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.ym-resume-text { font-size: 13.5px; font-weight: 700; color: #ffffff; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ym-resume-play { font-size: 12.5px; font-weight: 800; color: #93c5fd; white-space: nowrap; }
.ym-sheet-list { overflow-y: auto; overscroll-behavior: contain; padding-right: 2px; }
.ym-settings-sheet { max-height: 60dvh; }
.ym-settings-body { display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 8px; }
.ym-set-listen-only[hidden],
.ym-set-mem-only[hidden],
.ym-set-not-home[hidden] { display: none; }
.ym-shortcut-btn { margin-left: auto; color: #ffffff; width: 38px; height: 38px; flex-shrink: 0; }
.ym-list-mode-btn { font-size: 13px; padding: 6px 11px; flex-shrink: 0; }
.ym-sheet-title-wrap { width: 100%; }
.ym-sc-start-btn { border: none; background: rgba(37, 99, 235, 0.28); color: #93c5fd; font-size: 14px; font-weight: 700; padding: 12px 14px; border-radius: 12px; cursor: pointer; text-align: left; }
.ym-sc-start-btn:active { background: rgba(37, 99, 235, 0.42); }
.ym-sc-sublabel { margin: 2px 0 -4px; font-size: 12px; color: #9ca3af; font-weight: 600; }
.ym-sc-slots { display: flex; flex-direction: column; gap: 8px; }
.ym-sc-slot-row { display: flex; align-items: center; gap: 8px; }
.ym-sc-play-btn { flex: 1; min-width: 0; border: none; background: rgba(255, 255, 255, 0.08); color: #ffffff; font-size: 14px; font-weight: 700; padding: 10px 12px; border-radius: 10px; cursor: pointer; text-align: left; }
.ym-sc-play-btn.is-empty { color: #9ca3af; font-weight: 500; }
.ym-sc-select { appearance: none; -webkit-appearance: none; background: #1d1f26; color: #e5e7eb; border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 10px; padding: 10px 12px; font-size: 13px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.ym-help-sheet { max-height: 78dvh; }
.ym-help-body { overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding: 4px 2px 12px; font-size: 13.5px; line-height: 1.6; color: #d1d5db; }
.ym-help-sec h3 { margin: 0 0 6px; font-size: 14.5px; font-weight: 800; color: #ffffff; }
.ym-help-sec p { margin: 0 0 6px; }
.ym-help-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; }
.ym-help-list strong { color: #93c5fd; }
.ym-help-note { font-size: 12px; color: #9ca3af; }
.ym-anki-counts { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ym-anki-new { color: #60a5fa; }
.ym-anki-learn { color: #f87171; }
.ym-anki-rev { color: #34d399; }
.ym-sc-home-lbl { flex: 1; font-size: 14px; font-weight: 700; color: #e5e7eb; }
.ym-fav-edit-btn { font-size: 13px; padding: 7px 12px; margin-left: auto; flex-shrink: 0; }
.ym-fav-edit-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 4px 0 8px; flex-shrink: 0; }
.ym-fav-edit-bar[hidden] { display: none; }
.ym-fav-edit-bar .ym-chip { text-align: center; justify-content: center; padding: 8px 4px; font-size: 13px; }
.ym-chip-danger { background: rgba(239, 68, 68, 0.22); color: #fca5a5; }
.ym-list-item.is-fav-edit { align-items: center; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.ym-list-item.is-dragging { background: rgba(59, 130, 246, 0.24); border-left-color: #60a5fa; transform: scale(1.015); box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); z-index: 2; position: relative; }
.ym-fav-edit-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.ym-fav-chk { width: 18px; height: 18px; accent-color: #3b82f6; cursor: pointer; }
.ym-drag-handle { color: #9ca3af; font-size: 16px; padding: 4px 2px; cursor: grab; touch-action: none; }
.ym-fav-del-btn { border: none; background: rgba(239, 68, 68, 0.2); color: #fca5a5; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 8px; cursor: pointer; flex-shrink: 0; }

.ym-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.ym-list-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 8px 10px 7px;
  border-radius: 12px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.ym-list-item:hover { background: rgba(255, 255, 255, 0.06); }
.ym-list-item.is-active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.05) 100%);
  box-shadow: inset 3px 0 0 #60a5fa;
}
.ym-list-left { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 28px; flex-shrink: 0; padding-top: 2px; }
.ym-list-num { font-size: 12px; font-weight: 700; color: #7f8794; text-align: center; font-variant-numeric: tabular-nums; }
.ym-list-item.is-active .ym-list-num { color: #93c5fd; }
.ym-list-body { flex: 1; min-width: 0; }
.ym-list-en { margin: 0 0 4px; font-size: var(--duo-list-font-en, 15px); font-weight: 600; line-height: 1.48; color: #f5f5f5; }
.ym-list-ja { margin: 0; font-size: var(--duo-list-font-ja, 13px); line-height: 1.45; color: #8e95a3; }
.ym-list-status { width: 22px; display: flex; align-items: center; justify-content: center; padding-top: 3px; flex-shrink: 0; }
.ym-list-play { font-size: 11px; color: #555c68; }
.ym-list-item.is-active .ym-list-play { display: none; }
.ym-eq { display: none; align-items: flex-end; gap: 2px; height: 14px; }
.ym-list-item.is-active .ym-eq { display: inline-flex; }
.ym-eq span { width: 3px; border-radius: 2px; background: #60a5fa; height: 5px; }
.ym-eq span:nth-child(1) { height: 7px; }
.ym-eq span:nth-child(2) { height: 13px; }
.ym-eq span:nth-child(3) { height: 9px; }
.ym-list.is-playing .ym-list-item.is-active .ym-eq span:nth-child(1) { animation: ymEq 0.75s ease-in-out infinite alternate; }
.ym-list.is-playing .ym-list-item.is-active .ym-eq span:nth-child(2) { animation: ymEq 0.55s ease-in-out 0.15s infinite alternate; }
.ym-list.is-playing .ym-list-item.is-active .ym-eq span:nth-child(3) { animation: ymEq 0.65s ease-in-out 0.3s infinite alternate; }
@keyframes ymEq {
  0% { height: 4px; opacity: 0.65; }
  100% { height: 14px; opacity: 1; }
}
.ym-list.duo-hide-ja .ym-list-ja { display: none; }
.ym-list.duo-shadow-hide .ym-list-en { filter: blur(5px); }
.ym-list.duo-shadow-hide .ym-list-item.is-active .ym-list-en { filter: none; }

/* Memorize screen */
.ym-level-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ym-level-btn { border: none; border-radius: 12px; background: #161616; color: #b3b3b3; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; font-size: 12px; font-weight: 600; }
.ym-level-btn.is-active { background: #ffffff; color: #030303; }
.ym-level-btn small { font-size: 11px; opacity: 0.8; font-variant-numeric: tabular-nums; }
.ym-level-btn.is-cleared small { color: #22c55e; opacity: 1; font-weight: 700; }
.ym-mem-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ym-mem-meta-row:has(#duo-mem-wait-note:empty) { display: none; }
.ym-mem-tools-left { display: flex; flex-wrap: wrap; gap: 6px; }
.ym-mem-bar { height: 4px; border-radius: 999px; background: #1f1f1f; overflow: hidden; }
.ym-mem-fill { height: 100%; background: #ffffff; transition: width 0.25s ease; }
.ym-mem-card { background: #121212; border-radius: 16px; padding: 14px 12px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.ym-mem-answer { padding: 12px; border-radius: 12px; background: #1d1d1d; font-size: var(--duo-font-en, 20px); line-height: 1.55; color: #fff; }
.ym-grade-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding-top: 4px; }
.ym-grade { border: none; border-radius: 10px; padding: 10px 4px; cursor: pointer; color: #ffffff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; box-shadow: 0 2px 6px rgba(0,0,0,0.35); }
.ym-grade small { font-size: 11px; font-weight: 600; opacity: 0.9; line-height: 1.2; }
.ym-grade span { font-size: 14px; font-weight: 700; line-height: 1.25; }
.ym-grade.is-again { background: #b93c3c; }
.ym-grade.is-hard { background: #cc7a14; }
.ym-grade.is-good { background: #199e44; }
.ym-grade.is-easy { background: #1287e6; }
.ym-grade:active { filter: brightness(0.88); transform: scale(0.98); }

/* 穴あきアンダーラインのみ */
body.duo-page .duo-cloze-blank {
  display: inline-block;
  border: none;
  border-bottom: 2px solid #9a9a9a;
  border-radius: 0;
  background: transparent;
  color: transparent;
  padding: 0 2px;
  margin: 0 3px;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  vertical-align: baseline;
}
body.duo-page .duo-cloze-blank.is-revealed {
  border-bottom-color: rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #ffffff;
  font-weight: 600;
}
.ym-mem-complete { background: #121212; border-radius: 16px; padding: 26px 18px; text-align: center; }
.ym-complete-title { margin: 0 0 8px; font-size: 20px; font-weight: 700; color: #fff; }
.ym-complete-desc { margin: 0 0 18px; font-size: 13px; color: #aaa; }
.ym-complete-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

/* Bottom Navigation */
.ym-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: rgba(12, 12, 12, 0.94);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.ym-nav-btn { border: none; background: transparent; color: #7a7a7a; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0; cursor: pointer; }
.ym-nav-btn.is-active { color: #ffffff; }
.ym-nav-ico { font-size: 18px; line-height: 1; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.ym-nav-lbl { font-size: 11px; font-weight: 600; }

/* === Player Home (2 choices) & Subviews === */
.ym-home { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 6px 4px; }
.ym-home-title { margin: 0; font-size: 22px; font-weight: 800; color: #ffffff; letter-spacing: -0.02em; }
.ym-home-sub { margin: 0 0 8px; font-size: 14px; color: #9a9a9a; }
.ym-home-cards { display: flex; flex-direction: column; gap: 8px; }
.ym-home-mem-list { gap: 7px; }
.ym-home-mem-row { display: flex; align-items: stretch; gap: 7px; }
.ym-home-mem-row .ym-home-card { flex: 1; min-width: 0; }
.ym-home-mem-row .ym-home-mem-card { flex: 1; min-width: 0; padding: 9px 12px; gap: 8px; }
.ym-home-mem-row .ym-home-mem-card strong { font-size: 14.5px; }
.ym-home-mem-row .ym-home-stat { font-size: 15px; }
.ym-home-stats-link {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: #1a1c23;
  color: #d1d5db;
  font-size: 13px;
  font-weight: 700;
  padding: 0 13px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.ym-home-stats-link:active { background: #262934; }
.ym-home-stats-link[data-play-start] { width: 112px; padding: 0 6px; text-align: center; font-variant-numeric: tabular-nums; }
.ym-home-card {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: #141414;
  color: #ffffff;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, transform 0.1s ease;
}
.ym-home-card:active { background: #1f1f1f; transform: scale(0.99); }
.ym-home-card-ico { width: 40px; height: 40px; border-radius: 11px; background: rgba(255, 255, 255, 0.09); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; color: #ffffff; font-size: 18px; font-weight: 800; }
.ym-home-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ym-home-card-body strong { font-size: 17px; font-weight: 700; color: #ffffff; }
.ym-home-card-body span { font-size: 12px; color: #9a9a9a; }
.ym-home-stat { font-size: 18px; font-weight: 800; color: #ffffff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ym-home-arrow { font-size: 22px; color: #666; }

.ym-player-main { flex: 1; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 6px; }
.ym-player-main[hidden], .ym-home[hidden], .ym-player-list[hidden] { display: none; }
.ym-back-btn { font-size: 24px; color: #ffffff; }
.ym-back-label-btn { width: auto; font-size: 14.5px; font-weight: 700; padding: 6px 8px 6px 2px; white-space: nowrap; }
.ym-list-chip { padding: 7px 12px; font-size: 12px; }

/* === Memorize Stats / Progress List View === */
.ym-mem-study-view, .ym-stats-view { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.ym-mem-study-view[hidden], .ym-stats-view[hidden] { display: none; }
.ym-stats-btn { padding: 8px 14px; font-size: 14px; flex-shrink: 0; }
.ym-mem-study-view .ym-sub-header .ym-sec-select,
.ym-mem-study-view .ym-sub-header .ym-chip,
.ym-stats-header .ym-chip { font-size: 14px; padding: 8px 12px; }
.ym-stats-header { gap: 6px; }
.ym-select-wrap { position: relative; display: inline-flex; align-items: center; }
.ym-select-wrap .ym-sec-select {
  appearance: none;
  -webkit-appearance: none;
  background: #1d1f26;
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
}
.ym-select-caret { position: absolute; right: 10px; font-size: 11px; color: #b3b3b3; pointer-events: none; }

.ym-stats-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 10px 4px 4px; text-align: center; }
.ym-stat-col { border: 1px solid transparent; background: rgba(255, 255, 255, 0.03); border-radius: 12px; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.ym-stat-col.is-active { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.28); }
.ym-stat-col strong { font-size: 20px; font-weight: 800; color: #ffffff; font-variant-numeric: tabular-nums; }
.ym-stat-col span { font-size: 12px; color: #9a9a9a; display: inline-flex; align-items: center; gap: 5px; }
.ym-dot { display: inline-block; width: 8px; height: 8px; border-radius: 999px; }
.ym-dot.is-green { background: #10b981; }
.ym-dot.is-red { background: #ef4444; }
.ym-dot.is-gray { background: #52525b; }

.ym-stats-bar { height: 10px; border-radius: 999px; background: #3f3f46; overflow: hidden; display: flex; }
.ym-sbar-seg { height: 100%; transition: width 0.25s ease; }
.ym-sbar-seg.is-green { background: #10b981; }
.ym-sbar-seg.is-red { background: #ef4444; }

.ym-stats-list { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 6px; }
.ym-stats-sec-hdr {
  font-size: 13px;
  font-weight: 800;
  color: #93c5fd;
  letter-spacing: 0.03em;
  padding: 10px 4px 2px;
}
.ym-stats-sec-hdr:first-child { padding-top: 2px; }
.ym-stats-item { display: flex; flex-direction: column; padding: 11px 12px; border-radius: 12px; background: #121212; cursor: pointer; border: 1px solid rgba(255, 255, 255, 0.04); }
.ym-stats-item:active { background: #1a1a1a; }
.ym-stats-item.is-expanded { background: #171921; border-color: rgba(255, 255, 255, 0.14); }
.ym-stats-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ym-stats-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ym-stats-item-main strong { font-size: 15px; color: #ffffff; }
.ym-stats-sec { font-size: 12px; color: #9a9a9a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ym-stats-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.ym-stats-pill { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.ym-stats-pill.is-mastered { background: rgba(16, 185, 129, 0.22); color: #6ee7b7; }
.ym-stats-pill.is-review { background: rgba(239, 68, 68, 0.22); color: #fca5a5; }
.ym-stats-pill.is-unseen { background: rgba(255, 255, 255, 0.08); color: #9ca3af; }
.ym-stats-sub-rem { font-size: 11px; color: #9ca3af; font-variant-numeric: tabular-nums; }
.ym-stats-detail { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.ym-stats-detail[hidden] { display: none; }
.ym-stats-detail-ja { margin: 0 0 8px; font-size: 13px; color: #d1d5db; line-height: 1.5; white-space: pre-line; }
.ym-stats-detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 10px; }
.ym-stats-detail-grid div { background: rgba(255, 255, 255, 0.04); border-radius: 8px; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; }
.ym-stats-detail-grid span { font-size: 10px; color: #9ca3af; }
.ym-stats-detail-grid strong { font-size: 12px; color: #ffffff; font-variant-numeric: tabular-nums; }

.ym-home-label { margin: 14px 0 4px; font-size: 13px; font-weight: 700; color: #9a9a9a; letter-spacing: 0.04em; }
.ym-home-mem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ym-home-mem-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: #141414;
  color: #ffffff;
  padding: 18px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.ym-home-mem-card:active { background: #1f1f1f; transform: scale(0.98); }
.ym-home-mem-card strong { font-size: 18px; font-weight: 800; color: #ffffff; }
.ym-auth-gate { position: fixed; inset: 0; z-index: 200; background: #030303; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ym-auth-gate[hidden] { display: none; }
.ym-auth-card { width: 100%; max-width: 360px; background: #14161d; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 20px; padding: 24px 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7); }
.ym-auth-title { margin: 0; font-size: 22px; font-weight: 800; color: #ffffff; text-align: center; }
.ym-auth-desc { margin: 0; font-size: 13px; color: #9ca3af; text-align: center; }
.ym-auth-field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 700; color: #d1d5db; }
.ym-auth-field input { width: 100%; box-sizing: border-box; background: #0b0c10; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 10px; padding: 11px 12px; color: #ffffff; font-size: 16px; outline: none; }
.ym-auth-field input:focus { border-color: #60a5fa; }
.ym-auth-err { margin: 0; font-size: 13px; color: #fca5a5; text-align: center; }
.ym-auth-btn { border: none; border-radius: 12px; background: #2563eb; color: #ffffff; font-size: 15px; font-weight: 800; padding: 12px; cursor: pointer; margin-top: 4px; }
.ym-auth-btn:disabled { opacity: 0.5; cursor: default; }

.ym-home-mem-card span { font-size: 12px; color: #9a9a9a; }
.ym-home-mem-card .ym-anki-counts { display: inline-flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ym-home-mem-card .ym-anki-counts span { font-size: 16px; font-weight: 800; }
.ym-home-mem-card .ym-anki-new { color: #60a5fa; }
.ym-home-mem-card .ym-anki-learn { color: #f87171; }
.ym-home-mem-card .ym-anki-rev { color: #34d399; }

.ym-home-card.is-compact { padding: 13px 16px; gap: 10px; }
.ym-home-card.is-compact strong { font-size: 16px; font-weight: 700; color: #ffffff; margin-right: auto; }

/* Preserve dialogue line breaks across player, list, and memorize */
.ym-lyric-en, .ym-lyric-ja, .ym-list-en, .ym-list-ja, .ym-mem-answer { white-space: pre-line; }
