/* ============================================================
   英単語帳 — スタイル
   ============================================================ */

:root {
  --bg: #f5f5f7;
  --bg-grad-1: #e8ecf5;
  --bg-grad-2: #f2f0f7;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-solid: #ffffff;
  --surface-2: rgba(118, 118, 128, 0.08);
  --surface-hover: rgba(118, 118, 128, 0.13);
  --border: rgba(60, 60, 67, 0.11);
  --border-strong: rgba(60, 60, 67, 0.18);
  --text: #1d1d1f;
  --text-sub: #4b4b51;
  --text-mute: #86868b;
  --accent: #0071e3;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --accent-2: #5e5ce6;
  --good: #1c9e5a;
  --good-soft: rgba(28, 158, 90, 0.12);
  --bad: #e5334c;
  --bad-soft: rgba(229, 51, 76, 0.1);
  --star: #f5a524;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.14), 0 4px 12px rgba(0, 0, 0, 0.06);
  --blur: saturate(180%) blur(20px);
  --blur-strong: saturate(180%) blur(40px);
  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --dur: 0.36s;
}

html[data-theme="dark"] {
  --bg: #000000;
  --bg-grad-1: #1c1c2e;
  --bg-grad-2: #0a0a0f;
  --surface: rgba(30, 30, 32, 0.66);
  --surface-solid: #1c1c1e;
  --surface-2: rgba(118, 118, 128, 0.24);
  --surface-hover: rgba(118, 118, 128, 0.36);
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f5f5f7;
  --text-sub: #c7c7cc;
  --text-mute: #8e8e93;
  --accent: #0a84ff;
  --accent-soft: rgba(10, 132, 255, 0.18);
  --accent-2: #7d7aff;
  --good: #30d158;
  --good-soft: rgba(48, 209, 88, 0.16);
  --bad: #ff453a;
  --bad-soft: rgba(255, 69, 58, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 12% -8%, var(--bg-grad-1), transparent 60%),
    radial-gradient(900px 500px at 88% 0%, var(--accent-soft), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
  padding-bottom: 92px;
}

/* 動きを減らす設定を尊重 */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* ---------- ヘッダー ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: var(--blur-strong);
  -webkit-backdrop-filter: var(--blur-strong);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  border-bottom: 1px solid var(--border);
}
@supports not (background: color-mix(in srgb, red, blue)) {
  .app-header { background: var(--bg); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .app-header { background: var(--bg); }
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-size: 1.02rem;
  white-space: nowrap;
}
.brand-mark {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 4px 14px var(--accent-soft);
  font-size: 0.86rem;
}
.brand small {
  display: block;
  font-weight: 500;
  font-size: 0.68rem;
  color: var(--text-mute);
  letter-spacing: 0.04em;
}

.header-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

.icon-btn {
  width: 38px; height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  cursor: pointer;
  display: grid; place-items: center;
  transition: transform 0.18s var(--ease), background-color 0.18s var(--ease),
    color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); transform: translateY(-1px); }
.icon-btn:active { transform: scale(0.94); }

/* ---------- 進捗バー ---------- */
.progress-strip {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 18px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-track {
  flex: 1;
  height: 7px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--good), #4ad9b0);
  transition: width 0.6s var(--ease);
}
.progress-label { font-size: 0.76rem; color: var(--text-mute); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- タブ ---------- */
.tabs {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  gap: 4px;
  position: relative;
}
.tab {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-mute);
  padding: 10px 14px 13px;
  cursor: pointer;
  position: relative;
  border-radius: 12px 12px 0 0;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
  display: inline-flex; align-items: center; gap: 7px;
}
.tab:hover { color: var(--text-sub); background: var(--accent-soft); }
.tab[aria-selected="true"] { color: var(--accent); }
.tab-indicator {
  position: absolute;
  bottom: 0; left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: transform 0.35s var(--ease), width 0.35s var(--ease);
  pointer-events: none;
}

/* ---------- レイアウト ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 20px 18px 40px; }

.panel { animation: panelIn 0.34s var(--ease) both; }
.panel[hidden] { display: none; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- ツールバー ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.search-wrap {
  position: relative;
  flex: 1 1 240px;
  min-width: 200px;
}
.search-wrap i {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-mute); font-size: 0.85rem; pointer-events: none;
}
.search-wrap input {
  width: 100%;
  padding: 11px 36px 11px 36px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.search-clear {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--text-mute);
  cursor: pointer; display: grid; place-items: center; font-size: 0.7rem;
  opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease);
}
.search-clear.show { opacity: 1; pointer-events: auto; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 99px;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}
.chip:hover { background: var(--surface-hover); transform: translateY(-1px); }
.chip[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px var(--accent-soft);
}
.chip .cnt { font-size: 0.72rem; opacity: 0.72; font-variant-numeric: tabular-nums; }
.chip .fa-star { font-size: 0.62rem; color: var(--star); }
.chip[aria-pressed="true"] .fa-star { color: #ffe9b8; }

/* ---------- 一覧 ---------- */
.list-meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
  font-size: 0.78rem; color: var(--text-mute);
}
.mini-toggle {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-sub); font: inherit; font-size: 0.78rem; font-weight: 600;
  padding: 6px 12px; border-radius: 99px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.2s var(--ease);
}
.mini-toggle:hover { background: var(--surface-hover); }
.mini-toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.word-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }

.word-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 13px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease),
    border-color 0.2s var(--ease), background-color 0.2s var(--ease);
  animation: itemIn 0.3s var(--ease) both;
}
.word-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.word-item:active { transform: translateY(0) scale(0.995); }
@keyframes itemIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.word-main { flex: 1; min-width: 0; }
.word-head { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.word-en {
  font-size: 1.06rem; font-weight: 700; letter-spacing: -0.01em;
  font-family: "Inter", sans-serif;
}
.word-stars { color: var(--star); font-size: 0.62rem; letter-spacing: 1px; }
.word-ja {
  margin-top: 3px;
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.5;
  transition: filter 0.25s var(--ease), opacity 0.25s var(--ease);
}
.word-note {
  margin-top: 5px; font-size: 0.72rem; color: var(--text-mute);
  background: var(--surface-2); display: inline-block;
  padding: 3px 8px; border-radius: 8px;
}
.masked .word-ja { filter: blur(6px); opacity: 0.55; }
.masked .word-item.revealed .word-ja { filter: none; opacity: 1; }

.word-tools { display: flex; gap: 6px; flex-shrink: 0; }
.tool-btn {
  width: 34px; height: 34px; border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-mute);
  cursor: pointer; display: grid; place-items: center;
  font-size: 0.82rem;
  transition: all 0.18s var(--ease);
}
.tool-btn:hover { transform: translateY(-1px) scale(1.05); color: var(--text); }
.tool-btn:active { transform: scale(0.9); }
.tool-btn.on-known { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.tool-btn.on-weak { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }

.word-item.is-known { border-left: 3px solid var(--good); }
.word-item.is-weak { border-left: 3px solid var(--bad); }

.empty {
  text-align: center; padding: 56px 20px; color: var(--text-mute);
}
.empty i { font-size: 2rem; opacity: 0.4; display: block; margin-bottom: 12px; }

/* ---------- フラッシュカード ---------- */
.card-stage {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}
.card-counter {
  font-size: 0.8rem; color: var(--text-mute); font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 10px;
}
.card-counter .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--border); }

.flashcard {
  width: 100%;
  max-width: 520px;
  height: 300px;
  perspective: 1400px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.flashcard-inner {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.3, 0.8, 0.25, 1);
}
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.flashcard-face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 26px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 28px; text-align: center; gap: 12px;
}
.flashcard-face.back {
  transform: rotateY(180deg);
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
}
.fc-word {
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  font-weight: 800; letter-spacing: -0.02em;
  font-family: "Inter", sans-serif;
  word-break: break-word;
}
.fc-stars { color: var(--star); font-size: 0.72rem; letter-spacing: 2px; }
.fc-hint { font-size: 0.74rem; color: var(--text-mute); }
.fc-meaning { font-size: clamp(1.05rem, 4.4vw, 1.35rem); font-weight: 600; line-height: 1.7; }
.fc-note { font-size: 0.75rem; color: var(--text-mute); }
.fc-badge {
  position: absolute; top: 14px; left: 16px;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em;
  color: var(--text-mute);
}
.fc-fav {
  position: absolute; top: 10px; right: 12px;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: transparent; color: var(--text-mute); cursor: pointer;
  transition: all 0.18s var(--ease);
}
.fc-fav:hover { background: var(--surface-2); color: var(--bad); }
.fc-fav.on { color: var(--bad); }

.card-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit; font-weight: 650; font-size: 0.9rem;
  padding: 11px 20px; border-radius: 14px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease),
    background-color 0.18s var(--ease), border-color 0.18s var(--ease), opacity 0.18s var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent; color: #fff;
}
.btn.good { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.btn.bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.lg { padding: 14px 26px; font-size: 0.98rem; border-radius: 16px; }
.btn.block { width: 100%; justify-content: center; }

.card-hintbar { font-size: 0.74rem; color: var(--text-mute); text-align: center; line-height: 1.8; }
kbd {
  font-family: inherit; font-size: 0.7rem;
  background: var(--surface-2); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px;
  color: var(--text-sub);
}

/* ---------- テスト ---------- */
.quiz-setup { max-width: 560px; margin: 0 auto; }
.card-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}
.card-box + .card-box { margin-top: 14px; }
.card-box h2 { margin: 0 0 4px; font-size: 1.05rem; }
.card-box p.sub { margin: 0 0 16px; font-size: 0.82rem; color: var(--text-mute); line-height: 1.6; }
.field { margin-bottom: 16px; }
.field > label {
  display: block; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.03em;
  color: var(--text-mute); margin-bottom: 8px; text-transform: uppercase;
}
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-btn {
  flex: 1 1 auto;
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-sub); font: inherit; font-size: 0.84rem; font-weight: 600;
  padding: 10px 12px; border-radius: 12px; cursor: pointer;
  transition: all 0.2s var(--ease); white-space: nowrap;
}
.seg-btn:hover { background: var(--surface-hover); }
.seg-btn[aria-pressed="true"] {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 4px 12px var(--accent-soft);
}

.quiz-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.quiz-count { font-size: 0.82rem; color: var(--text-mute); font-variant-numeric: tabular-nums; font-weight: 600; }
.quiz-score { display: flex; gap: 10px; font-size: 0.82rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.quiz-score .ok { color: var(--good); }
.quiz-score .ng { color: var(--bad); }

.quiz-progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-bottom: 18px; }
.quiz-progress > span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 99px; transition: width 0.4s var(--ease);
}

.quiz-question {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  padding: 30px 22px;
  text-align: center;
  margin-bottom: 14px;
  animation: qIn 0.32s var(--ease) both;
}
@keyframes qIn {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.quiz-prompt-label { font-size: 0.7rem; letter-spacing: 0.08em; color: var(--text-mute); font-weight: 700; }
.quiz-prompt {
  margin-top: 10px;
  font-size: clamp(1.4rem, 5.6vw, 2.05rem);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.4;
  word-break: break-word;
}
.quiz-prompt.ja { font-size: clamp(1.1rem, 4.2vw, 1.5rem); font-weight: 700; }

.quiz-options { display: grid; gap: 9px; }
.opt {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit; font-size: 0.92rem; font-weight: 600;
  padding: 14px 16px; border-radius: 15px;
  cursor: pointer;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s var(--ease), background-color 0.2s var(--ease),
    border-color 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.opt:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.opt:active:not(:disabled) { transform: scale(0.99); }
.opt .key {
  width: 25px; height: 25px; flex-shrink: 0;
  border-radius: 8px; background: var(--surface-2); color: var(--text-mute);
  display: grid; place-items: center; font-size: 0.74rem; font-weight: 700;
  transition: all 0.2s var(--ease);
}
.opt .txt { flex: 1; line-height: 1.5; }
.opt:disabled { cursor: default; }
.opt.correct {
  background: var(--good-soft); border-color: var(--good); color: var(--good);
  animation: pop 0.36s var(--ease);
}
.opt.correct .key { background: var(--good); color: #fff; }
.opt.wrong {
  background: var(--bad-soft); border-color: var(--bad); color: var(--bad);
  animation: shake 0.4s var(--ease);
}
.opt.wrong .key { background: var(--bad); color: #fff; }
.opt.dim { opacity: 0.45; }
@keyframes pop {
  0% { transform: scale(1); } 45% { transform: scale(1.025); } 100% { transform: scale(1); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); } 40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); } 80% { transform: translateX(2px); }
}

.quiz-feedback {
  margin-top: 14px; text-align: center; min-height: 26px;
  font-size: 0.88rem; font-weight: 700;
}
.quiz-feedback .fb {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 99px;
  animation: fbIn 0.28s var(--ease) both;
}
.quiz-feedback .fb.ok { background: var(--good-soft); color: var(--good); }
.quiz-feedback .fb.ng { background: var(--bad-soft); color: var(--bad); }
@keyframes fbIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 結果 */
.result { text-align: center; max-width: 520px; margin: 0 auto; }
.score-ring {
  width: 168px; height: 168px; margin: 4px auto 18px;
  position: relative;
}
.score-ring svg { transform: rotate(-90deg); }
.score-ring .track { stroke: var(--surface-2); }
.score-ring .bar {
  stroke: url(#scoreGrad);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s var(--ease);
}
.score-ring .num {
  position: absolute; inset: 0; display: grid; place-items: center;
  flex-direction: column;
}
.score-ring .num b { font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.score-ring .num span { font-size: 0.72rem; color: var(--text-mute); margin-top: 6px; display: block; }
.result h2 { margin: 0 0 6px; font-size: 1.3rem; }
.result .msg { color: var(--text-sub); font-size: 0.88rem; margin-bottom: 20px; }
.review-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.review-list li {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--bad);
  border-radius: var(--radius-sm); padding: 11px 14px;
  animation: itemIn 0.3s var(--ease) both;
}
.review-list .rw { font-weight: 700; font-family: "Inter", sans-serif; }
.review-list .rm { font-size: 0.82rem; color: var(--text-sub); margin-top: 2px; }
.result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }

/* ---------- トースト ---------- */
.toast-area {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none; width: max-content; max-width: 90vw;
}
.toast {
  background: var(--text); color: var(--bg);
  font-size: 0.82rem; font-weight: 650;
  padding: 10px 18px; border-radius: 99px;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s var(--ease) both;
  display: flex; align-items: center; gap: 8px;
}
.toast.out { animation: toastOut 0.25s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(0.96); } }

/* ---------- モバイル下部ナビ ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: none;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
@supports not (background: color-mix(in srgb, red, blue)) {
  .bottom-nav { background: var(--surface); }
}
.bottom-nav-inner { display: flex; max-width: 560px; margin: 0 auto; }
.bn-btn {
  flex: 1; border: 0; background: none; font: inherit;
  color: var(--text-mute); font-size: 0.66rem; font-weight: 700;
  padding: 7px 4px; cursor: pointer; border-radius: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.bn-btn i { font-size: 1.06rem; transition: transform 0.24s var(--ease); }
.bn-btn[aria-selected="true"] { color: var(--accent); background: var(--accent-soft); }
.bn-btn[aria-selected="true"] i { transform: translateY(-2px) scale(1.08); }

/* ---------- 詳細シート ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(12, 16, 26, 0.42);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s var(--ease);
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 71;
  left: 50%; bottom: 0;
  width: min(520px, 100%);
  transform: translate(-50%, 105%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-lg);
  padding: 10px 22px calc(26px + env(safe-area-inset-bottom));
  transition: transform 0.36s var(--ease);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-grip { width: 44px; height: 4px; border-radius: 99px; background: var(--border); margin: 4px auto 16px; }
.sheet h3 { margin: 0; font-size: 1.7rem; letter-spacing: -0.02em; font-family: "Inter", sans-serif; }
.sheet .sheet-stars { color: var(--star); font-size: 0.7rem; letter-spacing: 2px; margin-top: 6px; }
.sheet .sheet-mean { margin: 14px 0 0; font-size: 1rem; line-height: 1.8; color: var(--text-sub); }
.sheet .sheet-note { margin-top: 10px; font-size: 0.78rem; color: var(--text-mute); background: var(--surface-2); padding: 8px 12px; border-radius: 10px; }
.sheet-actions { display: flex; gap: 8px; margin-top: 20px; }
.sheet-actions .btn { flex: 1; justify-content: center; }

/* ============================================================
   追加機能（例文・音声・統計・モーダル・スペル入力）
   ============================================================ */

/* ---------- 例文（一覧） ---------- */
.meta-tools { display: flex; gap: 6px; flex-wrap: wrap; }

.word-ex {
  margin-top: 9px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--surface-2);
  border-left: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  animation: exIn 0.26s var(--ease) both;
}
@supports not (background: color-mix(in srgb, red, blue)) {
  .word-ex { border-left-color: var(--accent); }
}
@keyframes exIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}
.word-ex-en {
  margin: 0; font-size: 0.82rem; line-height: 1.6;
  font-family: "Inter", sans-serif; color: var(--text);
}
.word-ex-ja { margin: 4px 0 0; font-size: 0.76rem; line-height: 1.6; color: var(--text-mute); }
.word-ex mark, .fc-example mark, .sheet-ex mark, .quiz-prompt mark {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  padding: 0 2px;
  border-radius: 4px;
}
html[data-theme="dark"] .word-ex mark,
html[data-theme="dark"] .fc-example mark,
html[data-theme="dark"] .sheet-ex mark { color: var(--accent-2); }

/* 早慶バッジ */
.sokei-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 3px 8px; border-radius: 99px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  white-space: nowrap;
}
.word-item.is-sokei .word-en::after { content: none; }

/* ---------- 音声ボタン ---------- */
.fc-speak {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-sub);
  font: inherit; font-size: 0.76rem; font-weight: 650;
  padding: 7px 14px; border-radius: 99px;
  cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
  transition: all 0.18s var(--ease);
}
.fc-speak:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.fc-speak:active { transform: scale(0.95); }
.fc-speak.sm { font-size: 0.72rem; padding: 6px 12px; }
.fc-speak.speaking {
  background: var(--accent); border-color: var(--accent); color: #fff;
  animation: pulse 1.1s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50% { box-shadow: 0 0 0 7px var(--accent-soft); }
}
.icon-btn.round { border-radius: 50%; width: 36px; height: 36px; flex-shrink: 0; }
.icon-btn.round.sm { width: 30px; height: 30px; font-size: 0.76rem; }
.icon-btn.speaking { background: var(--accent); border-color: var(--accent); color: #fff; }
.tool-btn.speaking { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- カード：例文 ---------- */
.flashcard { height: 340px; }
.flashcard-face { justify-content: center; gap: 10px; overflow: hidden; }
.flashcard-face.back { justify-content: center; padding: 26px 22px; }
.fc-sokei {
  position: absolute; top: 13px; right: 52px;
  font-size: 0.62rem; font-weight: 700;
  padding: 3px 8px; border-radius: 99px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
}
.fc-example {
  width: 100%;
  margin-top: 4px;
  padding: 11px 13px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: left;
  display: flex; flex-direction: column; gap: 5px;
}
.fc-ex-en {
  margin: 0; font-size: 0.8rem; line-height: 1.6;
  font-family: "Inter", sans-serif; color: var(--text);
}
.fc-ex-ja { margin: 0; font-size: 0.73rem; line-height: 1.55; color: var(--text-mute); }
.fc-example .fc-speak { align-self: flex-start; margin-top: 2px; }

/* ---------- 詳細シート：例文 ---------- */
.sheet-head { display: flex; align-items: center; gap: 12px; }
.sheet-head h3 { flex: 1; min-width: 0; word-break: break-word; }
.sheet-badges { display: flex; align-items: center; gap: 8px; margin-top: 7px; flex-wrap: wrap; }
.sheet-ex {
  margin-top: 16px;
  padding: 13px 15px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.sheet-ex-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
  color: var(--text-mute); margin-bottom: 9px;
}
.sheet-ex-en {
  margin: 0; font-size: 0.92rem; line-height: 1.7;
  font-family: "Inter", sans-serif;
}
.sheet-ex-ja { margin: 6px 0 0; font-size: 0.8rem; line-height: 1.7; color: var(--text-mute); }
.sheet { max-height: 88vh; overflow-y: auto; }

/* ---------- テスト：例文プロンプト・スペル入力 ---------- */
.quiz-prompt.cloze {
  font-size: clamp(1rem, 3.6vw, 1.28rem);
  font-weight: 650; line-height: 1.85; text-align: left;
  font-family: "Inter", sans-serif;
}
.quiz-prompt .blank {
  display: inline-block;
  min-width: 92px;
  border-bottom: 2.5px solid var(--accent);
  margin: 0 4px;
  color: var(--accent);
  font-weight: 800;
  text-align: center;
}
.quiz-prompt-ja {
  margin: 12px 0 0; font-size: 0.8rem; color: var(--text-mute); line-height: 1.6;
}
.quiz-question .fc-speak { margin-top: 14px; }
.quiz-listen-icon {
  font-size: 2.4rem; color: var(--accent);
  margin: 6px 0 2px;
  animation: pulseScale 1.6s var(--ease) infinite;
}
@keyframes pulseScale {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 1; }
}

.spell-form { display: flex; flex-direction: column; gap: 10px; }
.spell-label {
  font-size: 0.76rem; font-weight: 700; letter-spacing: 0.03em;
  color: var(--text-mute); text-align: center;
}
.spell-row { display: flex; gap: 8px; }
.spell-input {
  flex: 1;
  padding: 14px 16px;
  border-radius: 15px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit; font-size: 1.05rem; font-weight: 650;
  font-family: "Inter", sans-serif;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.spell-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.spell-input.ok { border-color: var(--good); box-shadow: 0 0 0 4px var(--good-soft); }
.spell-input.ng { border-color: var(--bad); box-shadow: 0 0 0 4px var(--bad-soft); animation: shake 0.4s var(--ease); }
.btn.sm-btn { font-size: 0.78rem; padding: 8px 14px; align-self: center; }

/* ---------- 統計 ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 16px 14px;
  display: flex; flex-direction: column; gap: 2px;
  animation: itemIn 0.32s var(--ease) both;
}
.stat-label { font-size: 0.72rem; font-weight: 700; color: var(--text-mute); letter-spacing: 0.03em; }
.stat-num {
  font-size: 2rem; font-weight: 800; letter-spacing: -0.03em;
  line-height: 1.15; font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.stat-num.bad { color: var(--bad); }
.stat-sub { font-size: 0.72rem; color: var(--text-mute); }

.lvbar { margin-top: 14px; }
.lvbar-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8rem; font-weight: 650; margin-bottom: 6px;
}
.lvbar-head .lv { display: inline-flex; align-items: center; gap: 6px; }
.lvbar-head .lv .fa-star { color: var(--star); font-size: 0.6rem; }
.lvbar-head .num { color: var(--text-mute); font-size: 0.76rem; font-variant-numeric: tabular-nums; }
.lvbar-track { height: 9px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.lvbar-fill {
  height: 100%; border-radius: 99px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.8s var(--ease);
}
.lvbar-fill.sokei { background: linear-gradient(90deg, var(--good), #4ad9b0); }

.weak-chips { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; }
.weak-chips li { animation: itemIn 0.28s var(--ease) both; }
.weak-chips button {
  border: 1px solid var(--bad);
  background: var(--bad-soft);
  color: var(--bad);
  font: inherit; font-size: 0.8rem; font-weight: 650;
  font-family: "Inter", sans-serif;
  padding: 7px 13px; border-radius: 99px; cursor: pointer;
  transition: all 0.18s var(--ease);
}
.weak-chips button:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ---------- モーダル ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(12, 16, 26, 0.46);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 0.28s var(--ease);
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed; z-index: 81;
  left: 50%; bottom: 0;
  width: min(500px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  transform: translate(-50%, 105%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  box-shadow: var(--shadow-lg);
  padding: 10px 22px calc(20px + env(safe-area-inset-bottom));
  transition: transform 0.36s var(--ease);
}
.modal.open { transform: translate(-50%, 0); }
.modal-title { margin: 0 0 4px; font-size: 1.1rem; display: flex; align-items: center; gap: 9px; }
.modal-title i { color: var(--accent); }
.modal-body { padding: 12px 0 4px; }
.modal-actions { padding: 6px 0 4px; }
.modal-btn-row { display: flex; gap: 8px; }
.modal-btn-row .btn { flex: 1; justify-content: center; font-size: 0.82rem; padding: 10px 8px; }

.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem; font-weight: 600; line-height: 1.5;
}
.switch {
  flex-shrink: 0;
  width: 47px; height: 28px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer; padding: 0;
  position: relative;
  transition: background-color 0.24s var(--ease), border-color 0.24s var(--ease);
}
.switch > span {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  transition: transform 0.24s var(--ease);
}
.switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.switch[aria-checked="true"] > span { transform: translateX(19px); }
.switch:disabled { opacity: 0.4; cursor: not-allowed; }

.range {
  width: 100%; height: 6px; border-radius: 99px;
  background: var(--surface-2);
  -webkit-appearance: none; appearance: none;
  outline: none; cursor: pointer;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 8px var(--accent-soft);
  cursor: pointer;
  transition: transform 0.16s var(--ease);
}
.range::-webkit-slider-thumb:active { transform: scale(1.18); }
.range::-moz-range-thumb {
  width: 21px; height: 21px; border-radius: 50%; border: 0;
  background: var(--accent); cursor: pointer;
}
.field > label b { color: var(--accent); font-variant-numeric: tabular-nums; }

.select, .textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit; font-size: 0.88rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.76rem; resize: vertical; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.sub.warn { color: var(--bad); margin-top: 12px !important; }

/* ============ 発音記号・類義語・対義語 ============ */
.word-ipa, .fc-ipa, .sheet-ipa {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--text-mute);
  letter-spacing: 0.01em;
}
.word-ipa { font-size: 0.75rem; flex-shrink: 0; }
.fc-ipa { font-size: 0.85rem; margin: 6px 0 2px; text-align: center; }
.sheet-ipa { font-size: 0.84rem; margin: 2px 0 8px; }

.word-relations, .fc-relations, .sheet-relations { margin-top: 7px; display: grid; gap: 4px; }
.rel-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 5px;
  font-size: 0.72rem; line-height: 1.5;
}
.rel-tag {
  flex-shrink: 0;
  width: 17px; height: 17px; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.72rem;
}
.rel-syn .rel-tag { background: var(--good-soft); color: var(--good); }
.rel-ant .rel-tag { background: var(--bad-soft); color: var(--bad); }
.rel-chip {
  padding: 2px 7px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-sub);
  font-weight: 600; white-space: nowrap;
}
.rel-syn .rel-chip { border-color: color-mix(in srgb, var(--good) 24%, var(--border)); }
.rel-ant .rel-chip { border-color: color-mix(in srgb, var(--bad) 24%, var(--border)); }
@supports not (color: color-mix(in srgb, red, blue)) {
  .rel-syn .rel-chip, .rel-ant .rel-chip { border-color: var(--border); }
}

/* カード裏面は中央寄せ・小さめ */
.fc-relations-wrap { width: 100%; margin-top: 8px; }
.fc-relations .rel-row { justify-content: center; font-size: 0.68rem; }
.fc-relations .rel-chip { padding: 1px 6px; }

/* ============ 同期バッジ ============ */
.sync-state {
  font-size: 0.68rem; font-weight: 700;
  padding: 4px 9px; border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-mute);
  white-space: nowrap;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.sync-state[data-mode="saving"] { color: var(--accent); border-color: var(--accent); }
.sync-state[data-mode="saved"]  { color: var(--good); }
.sync-state[data-mode="error"]  { color: var(--bad); }
#account-btn.is-signed-in { color: var(--accent); border-color: var(--accent); }

/* ============ ヘッダーのアカウントボタン ============ */
.account-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px 5px 5px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-sub);
  font: inherit; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease),
              background-color 0.2s var(--ease), transform 0.14s var(--ease);
}
.account-btn:hover { border-color: var(--accent); color: var(--accent); }
.account-btn:active { transform: scale(0.97); }
.account-btn-avatar {
  flex-shrink: 0;
  width: 25px; height: 25px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-mute);
  font-size: 0.72rem;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.account-btn.is-signed-in { border-color: var(--accent); color: var(--accent); }
.account-btn.is-signed-in .account-btn-avatar {
  background: var(--accent); color: #fff; font-weight: 800; font-size: 0.74rem;
}
.account-btn-text {
  max-width: 92px; overflow: hidden; text-overflow: ellipsis;
}

/* ============ ログイン案内バナー ============ */
.signin-banner {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 15px;
  margin-bottom: 18px;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface);
  box-shadow: var(--shadow-sm);
  animation: sb-in 0.4s var(--ease) both;
}
@supports not (color: color-mix(in srgb, red, blue)) {
  .signin-banner { border-color: var(--border); }
}
@keyframes sb-in { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: none; } }
.sb-icon {
  flex-shrink: 0;
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 1rem;
}
.sb-body { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sb-body b { font-size: 0.9rem; font-weight: 700; }
.sb-body small { font-size: 0.76rem; color: var(--text-sub); line-height: 1.55; }
.sb-actions { flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.btn.sm-btn { padding: 8px 13px; font-size: 0.8rem; }
.icon-btn.round.sm { width: 30px; height: 30px; font-size: 0.78rem; }
@media (max-width: 640px) {
  .signin-banner { flex-wrap: wrap; gap: 10px; }
  .sb-body { flex-basis: calc(100% - 53px); }
  .sb-actions { width: 100%; }
  .sb-actions .btn { flex: 1; justify-content: center; }
}

/* ============ 統計タブの同期カード ============ */
.sync-card { margin-bottom: 16px; }
.sync-card-head { display: flex; align-items: center; gap: 13px; margin-bottom: 14px; }
.sync-card-icon {
  flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 13px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-mute); font-size: 1.05rem;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.sync-card.is-on .sync-card-icon { background: var(--good-soft); color: var(--good); }
.sync-card-text { display: grid; gap: 2px; min-width: 0; }
.sync-card-text b { font-size: 0.92rem; font-weight: 700; }
.sync-card-text small { font-size: 0.76rem; color: var(--text-sub); line-height: 1.55; }

/* ============ アカウントモーダル ============ */
.pw-wrap { position: relative; display: block; }
.pw-wrap .text-input { padding-right: 46px; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 9px;
  border: 0; background: transparent; color: var(--text-mute);
  cursor: pointer; font-size: 0.85rem;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.18s var(--ease), background-color 0.18s var(--ease);
}
.pw-toggle:hover { color: var(--accent); background: var(--surface-2); }
.field-hint { display: block; margin-top: 6px; font-size: 0.74rem; color: var(--text-mute); line-height: 1.5; }
.field-hint.is-bad { color: var(--bad); }
.field-hint.is-good { color: var(--good); }
.text-input.is-bad { border-color: var(--bad); }

.text-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 13px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit; font-size: 0.92rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.text-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.acc-tabs {
  display: flex; gap: 6px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 13px; margin: 14px 0 16px;
}
.acc-tab {
  flex: 1; padding: 9px 10px;
  border: 0; border-radius: 10px; background: transparent;
  color: var(--text-mute); font: inherit; font-size: 0.85rem; font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.acc-tab[aria-pressed="true"] {
  background: var(--surface); color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.acc-card {
  display: flex; align-items: center; gap: 13px;
  padding: 15px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  margin-bottom: 14px;
}
.acc-avatar {
  flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: #fff; font-size: 1rem;
}
.acc-meta { display: grid; gap: 2px; min-width: 0; }
.acc-meta b { font-size: 0.98rem; font-weight: 700; }
.acc-meta small { font-size: 0.76rem; color: var(--text-mute); }

.note-box {
  margin-top: 16px !important;
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bad-soft);
  line-height: 1.65;
}
.note-box i { color: var(--bad); margin-right: 4px; }

/* ---------- レスポンシブ ---------- */
@media (min-width: 720px) {
  .word-list { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .tabs { display: none; }
  .bottom-nav { display: block; }
  .header-inner { padding: 10px 14px; }
  .progress-strip { padding: 0 14px 10px; }
  main { padding: 16px 14px 30px; }
  .brand span.brand-text { font-size: 0.95rem; }
  .flashcard { height: 330px; }
  .word-item { padding: 12px 13px; gap: 10px; }
  .tool-btn { width: 32px; height: 32px; }
  .header-actions { gap: 6px; }
  .icon-btn { width: 36px; height: 36px; }
  .bn-btn { font-size: 0.62rem; }
  .stat-num { font-size: 1.7rem; }
  .modal { padding-left: 18px; padding-right: 18px; }
  .sheet { padding-left: 18px; padding-right: 18px; }
}

/* 単語カードの縦積み（例文表示時は1列のほうが読みやすい） */
@media (min-width: 720px) {
  .word-list.with-ex { grid-template-columns: 1fr; }
}
