/* K-POPカナルビ（template-kpop.php・inc/kpop.php・assets/js/kpop.js）。作りは コードで弾こう（chord.css）と そろえる */
.kp { display: grid; gap: var(--space-4); max-width: 560px; margin-inline: auto; }
.kp-card {
  display: grid; gap: var(--space-3);
  background: var(--grad-card); border-radius: var(--r-lg); padding: var(--space-5);
  box-shadow: var(--sh-md); border: 1px solid rgba(255,255,255,.9);
}
.kp-top { display: flex; align-items: center; gap: var(--space-3); }
.kp-buddy { flex: none; line-height: 0; }
.kp-top__text { display: grid; gap: 6px; min-width: 0; }
.kp-h { margin: 0; font-family: var(--font-display); font-size: var(--fs-lg); line-height: 1.35; color: var(--ink-900); text-wrap: balance; word-break: keep-all; overflow-wrap: anywhere; }
.kp-lead { margin: 0; font-size: var(--fs-sm); line-height: 1.7; color: var(--ink-700); }

.kp-form { display: grid; gap: 0; }
.kp-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.kp-input { font-size: max(16px, 1rem); } /* 16px より 小さいと iPhone が ズームする */
.kp-input::-webkit-search-cancel-button { cursor: pointer; }

/* サイトの ボタン（名前と 小さい字）。スマホは 2つずつ */
.kp-group { margin: var(--space-3) 0 8px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-900); }
.kp-sites { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; }
.kp-site {
  display: grid; place-items: center; align-content: center; gap: 2px; min-height: 58px; padding: 8px 6px;
  border-radius: var(--r-md); text-align: center; text-decoration: none; line-height: 1.25;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
.kp-site__name { font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 700; word-break: keep-all; overflow-wrap: anywhere; }
.kp-site__sub { font-size: var(--fs-xs); font-weight: 700; opacity: .85; }
.kp-site--find { background: var(--grad-cta); color: #fff; box-shadow: var(--sh-cta); }
.kp-site--jump, .kp-site--word { background: #fff; color: var(--sky-700); box-shadow: inset 0 0 0 2px var(--sky-200), var(--sh-sm); }
.kp-site--word { min-height: 48px; }
.kp-site:hover { transform: translateY(-1px); }
.kp-site:focus-visible { outline: 3px solid var(--color-ring); outline-offset: 2px; }
.kp-site[aria-disabled="true"] { opacity: .55; transform: none; }
.kp-mini { margin: 8px 0 0; font-size: var(--fs-xs); line-height: 1.6; color: var(--ink-500); }
.kp-mini[hidden] { display: none; }
/* めったに 要らない 説明は たたんでおく（app.css の .note-help を 小さく。洋楽和訳の「Musixmatch が ひらかないときは」） */
.note-help.kp-fold { margin-top: 4px; }
.note-help.kp-fold > summary { font-size: var(--fs-xs); }
.note-help.kp-fold > .note-help__body { margin-top: 0; padding: var(--space-3); }
.note-help.kp-fold .kp-mini { margin: 0; }
.kp-dir { margin: 8px 0; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-700); }

/* いちばん近い曲を 1回で ひらく（DuckDuckGo の「\」。注意書きつき） */
.kp-jump { margin-top: var(--space-3); padding: var(--space-3); border-radius: var(--r-md); background: var(--rose-50); }
.kp-jump[hidden] { display: none; }
.kp-jump .kp-group { margin-top: 0; }

/* ことばの いみ（AI） */
.kp-ai-box { display: grid; gap: 8px; margin-top: var(--space-3); }
.kp-ai-btn[disabled] { opacity: .7; cursor: progress; }
.kp-ai-left { margin: 0; text-align: center; }
.kp-ai { display: grid; gap: 8px; padding: var(--space-3) var(--space-4); border-radius: var(--r-md); background: #fff; box-shadow: inset 0 0 0 2px var(--sky-200), var(--sh-sm); }
.kp-ai[hidden] { display: none; }
.kp-ai__head { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.kp-ai__hangul { font-size: var(--fs-xl); font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.kp-ai__kana { font-size: var(--fs-base); font-weight: 700; color: var(--sky-700); }
.kp-ai__list { display: grid; gap: 6px; margin: 0; }
.kp-ai__row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr); gap: 8px; align-items: baseline; }
.kp-ai__row[hidden] { display: none; }
.kp-ai__row dt { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-500); }
.kp-ai__row dd { margin: 0; font-size: var(--fs-sm); line-height: 1.6; color: var(--ink-900); overflow-wrap: anywhere; }
.kp-ai-join { font-weight: 700; color: var(--sky-700); text-decoration: underline; text-underline-offset: 3px; }
/* 洋楽和訳（template-yogaku.php も この CSS を 使う）: 大事な ことば（英語のまま ＋ いみ。カタカナの 読みは 出さない） */
.kp-ai__words { display: grid; gap: 6px; padding-top: 8px; border-top: 1px dashed var(--border); }
.kp-ai__words[hidden] { display: none; }
.kp-ai__wordsh { margin: 0; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-500); }
.kp-ai__wordlist { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.kp-ai__wordlist li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.kp-ai__w { font-weight: 700; color: var(--ink-900); overflow-wrap: anywhere; }
.kp-ai__m { font-size: var(--fs-sm); color: var(--ink-700); }
.kp-say { min-height: 1.5em; margin: 8px 0 0; font-size: var(--fs-xs); font-weight: 700; line-height: 1.5; color: var(--sky-700); }
.kp-say:empty { min-height: 0; margin: 0; }

.kp-songs { display: grid; gap: 8px; padding-top: var(--space-3); border-top: 1px dashed var(--border); }
.kp-songs[hidden] { display: none; }
.kp-songs__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kp-sub { margin: 0; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-500); }
.kp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.kp-chip { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-gchip { display: inline-flex; align-items: center; text-decoration: none; }
.kp-chip:focus-visible, .kp-gchip:focus-visible, .kp-clear:focus-visible, .kp-all:focus-visible { outline: 3px solid var(--color-ring); outline-offset: 2px; }
.kp-clear {
  min-height: 40px; padding: 0 12px; border: 0; border-radius: var(--r-pill); background: transparent;
  font: inherit; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-500); cursor: pointer;
}
.kp-clear:hover { color: var(--sky-700); background: var(--sky-50); }
.kp-all { justify-self: start; min-height: 40px; display: inline-flex; align-items: center; font-size: var(--fs-sm); font-weight: 700; color: var(--sky-700); text-decoration: underline; text-underline-offset: 3px; }

.kp-join { text-align: center; }
.kp-join__h { margin: 0; font-family: var(--font-display); font-size: var(--fs-base); font-weight: 700; color: var(--ink-900); text-wrap: balance; word-break: keep-all; overflow-wrap: anywhere; }
.kp-join__login { margin: 0; font-size: var(--fs-xs); color: var(--ink-700); }
.kp-join__login a { font-weight: 700; color: var(--sky-700); }

.kp-note { margin: 0; font-size: var(--fs-xs); line-height: 1.7; text-align: center; color: var(--ink-500); }

@media (prefers-reduced-motion: reduce) {
  .kp-site { transition: none; }
  .kp-site:hover { transform: none; }
}
