/* Learn kanji (Learn, Japanese): js/modules/kanjiTool.js.
   Colour-blind safe: a known kanji is a solid fill with a ✓, a seen one only
   an outline, and the highlighted kanji in a word is bold and underlined as
   well as tinted. */
.kt-page { display: flex; flex-direction: column; gap: 14px; }
.kt-intro { margin: 0; color: var(--text-muted); font-size: .95rem; text-align: center; }
.kt-summary { text-align: center; font-size: .85rem; color: var(--text-muted); }
.kt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.kt-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px; border-radius: 4px; border: 2px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font: inherit; min-width: 0; }
.kt-tile-char { font-size: 2.2rem; line-height: 1.15; }
.kt-tile-meaning { font-size: .72rem; color: var(--text-muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kt-tile-count { font-size: .7rem; color: var(--text-muted); }
.kt-tile.seen { border-color: var(--accent); }
.kt-tile.known { border-color: var(--good-fill); background: var(--good-fill); color: var(--good-on); }
.kt-tile.known .kt-tile-meaning, .kt-tile.known .kt-tile-count { color: inherit; opacity: .85; }
.kt-badge { position: absolute; top: 4px; right: 7px; font-weight: 800; font-size: .85rem; }
.kt-credit { font-size: .72rem; color: var(--text-muted); text-align: center; margin: 4px 0 0; }
.kt-credit a { color: inherit; }

.kt-head { flex-direction: row; text-align: left; align-items: center; gap: 16px; padding: 16px; }
.kt-strokes .ks-svg, .kt-strokes .ks-missing { width: 120px; height: 120px; }
.kt-head-text { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.kt-meaning { font-size: 1.15rem; font-weight: 700; }
.kt-meta { font-size: .85rem; color: var(--text-muted); }
.kt-known-tag { color: var(--good); font-weight: 700; }

.kt-readings { display: flex; flex-direction: column; gap: 8px; }
.kt-readings .tools-heading { margin-bottom: 0; }
.kt-explain { margin: 0; font-size: .88rem; color: var(--text-muted); }
.kt-sound { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border-radius: 4px; border: 2px solid var(--border); background: var(--surface); }
.kt-sound-kana { min-width: 3.2em; font-size: 1.35rem; font-weight: 800; color: var(--accent); text-align: center; }
.kt-sound-text { display: flex; flex-direction: column; gap: 2px; font-size: 1rem; }
.kt-sound-text b { color: var(--accent); }
.kt-sound-text small { font-size: .78rem; color: var(--text-muted); }
.kt-more { font-size: .88rem; color: var(--text-muted); padding: 0 4px; }
.kt-more summary { cursor: pointer; font-weight: 600; }
.kt-more p { margin: 6px 0 0; }
.kt-more [lang="ja"] { color: var(--text); }

.kt-words { display: flex; flex-direction: column; gap: 8px; }
.kt-word { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 10px; padding: 10px 14px; border-radius: 4px; border: 2px solid var(--border); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.kt-word-main { font-size: 1.6rem; line-height: 1.2; }
.kt-word-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.kt-read { font-size: 1.05rem; font-weight: 700; color: var(--accent); border-bottom: 2px solid var(--accent); }
.kt-word-en { grid-column: 1 / -1; font-size: .85rem; color: var(--text-muted); }
.kt-note { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; font-size: .82rem; color: var(--text); background: var(--accent-soft); border-radius: 4px; padding: 4px 8px; margin-top: 4px; }
.kt-note svg { width: 14px; height: 14px; }
.kt-hit { background: var(--accent-soft); color: inherit; border-radius: 4px; padding: 0 2px; font-weight: 800; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.kt-hit rt { color: var(--accent); font-weight: 700; text-decoration: none; }
/* Kana hidden by the shared furigana switch: the reading tag hides too,
   until the word is tapped. */
.kt-page.no-furigana .kt-read, .kt-page.no-furigana .kt-note { visibility: hidden; }
.kt-page.no-furigana .furigana-on .kt-read, .kt-page.no-furigana .furigana-on .kt-note { visibility: visible; }
.kt-tap-hint { text-align: center; color: var(--text-muted); font-size: .82rem; margin: 0; }
.kt-actions { display: flex; gap: 8px; justify-content: center; }
.kt-actions #kt-know { flex: 1; max-width: 260px; }
@media (max-width: 420px) {
  .kt-head { gap: 12px; padding: 12px; }
  .kt-strokes .ks-svg, .kt-strokes .ks-missing { width: 100px; height: 100px; }
  .kt-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
}
