.jp-word-match { box-sizing: border-box; max-width: 1100px; margin: 28px auto; padding: clamp(18px, 3vw, 32px); border: 1px solid #d0d5dd; border-radius: 14px; background: transparent; color: var(--jp-word-match-body-color, inherit); font-family: var(--jp-word-match-font-family, inherit) !important; }
.jp-word-match *, .jp-word-match button, .jp-word-match select, .jp-word-match input { font-family: inherit !important; }
.jp-word-match-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.jp-word-match .jp-word-match-header h2 { margin: 0 0 8px; color: inherit; font-size: 1.5em; }
.jp-word-match .jp-word-match-header p { margin: 0; color: inherit; }
/* Share the practice page's floating gear button and opaque settings palette. */
.jp-word-match .jp-word-match-settings { bottom: clamp(88px, 12vh, 120px); right: 18px; }
.jp-word-match .jp-word-match-settings-toggle { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 38px; min-height: 38px; padding: 7px 10px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; color: #344054; box-shadow: none; text-decoration: none; line-height: 1.4; cursor: pointer; }
.jp-word-match .jp-word-match-settings-toggle:hover, .jp-word-match .jp-word-match-settings-toggle:focus-visible { background: #f2f4f7; }
.jp-word-match .jp-word-match-settings-panel { box-sizing: border-box; width: min(300px, calc(100vw - 36px)); max-height: min(620px, calc(100dvh - 190px)); overflow-y: auto; background: #fff; color: #344054; border-color: #d0d5dd; box-shadow: 0 8px 24px rgba(16, 24, 40, .14); }
.jp-word-match-settings-panel[hidden] { display: none; }
.jp-word-match .jp-word-match-settings-panel label { display: grid; gap: 5px; margin: 0; color: #344054; font-size: 13px; }
.jp-word-match .jp-word-match-settings-panel select, .jp-word-match .jp-word-match-settings-panel input:not([type="checkbox"]) { box-sizing: border-box; width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid #d0d5dd; border-radius: 6px; background: #fff; color: #344054; font-size: 14px; box-shadow: none; }
.jp-word-match .jp-word-match-settings-panel option { background: #fff; color: #344054; }
.jp-word-match .jp-word-match-settings-panel [hidden] { display: none; }
.jp-word-match .jp-word-match-furigana { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.jp-word-match-furigana input { width: 16px; height: 16px; margin: 0; }
.jp-word-match .jp-word-match-start { justify-self: stretch; padding: 8px 12px; border: 0; border-radius: 6px; background: #344054; color: #fff; box-shadow: none; font-size: 14px; cursor: pointer; }
.jp-word-match .jp-word-match-restart { min-height: 40px; padding: 8px 14px; border: 1px solid #d0d5dd; border-radius: 8px; background: #fff; color: #344054; box-shadow: none; cursor: pointer; }
.jp-word-match-status { min-height: 1.5em; margin: 18px 0 8px; color: inherit; }
.jp-word-match-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(12px, 4vw, 40px); }
.jp-word-match-japanese, .jp-word-match-translations { display: grid; align-content: start; gap: 10px; }
.jp-word-match .jp-word-match-choice { position: relative; min-height: 54px; padding: 12px 36px 12px 16px; border: 1px solid #d0d5dd; border-radius: 9px; background: transparent; color: inherit; box-shadow: none; font-size: 1.1em; text-align: start; cursor: pointer; transition: border-color .15s, background-color .15s; }
.jp-word-match-choice:hover, .jp-word-match-choice:focus-visible { outline: 1px solid currentColor; outline-offset: 1px; }
.jp-word-match-choice.is-selected { outline: 2px solid currentColor; outline-offset: 1px; }
.jp-word-match .jp-word-match-choice.is-matched { border: 2px solid #12b76a !important; background: #ecfdf3 !important; color: #027a48 !important; outline: none; }
.jp-word-match .jp-word-match-choice.is-wrong { border: 2px solid #f04438 !important; background: #fef3f2 !important; color: #b42318 !important; outline: none; }
.jp-word-match-choice.is-matched::after, .jp-word-match-choice.is-wrong::after { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-weight: 700; }
.jp-word-match-choice.is-matched::after { content: "✓"; }
.jp-word-match-choice.is-wrong::after { content: "×"; }
.jp-word-match-choice:disabled { cursor: default; opacity: .65; }
.jp-word-match-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.jp-word-match-footer[hidden], .jp-word-match-footer button[hidden] { display: none; }
.jp-word-match-timer { margin-right: auto; font-variant-numeric: tabular-nums; }
.jp-word-match-score { margin-right: auto; }
.jp-word-match ruby { ruby-position: over; }
.jp-word-match rt { font-size: .5em; font-weight: 400; line-height: 1; }
@media (max-width: 600px) {
    .jp-word-match .jp-word-match-settings { bottom: clamp(76px, 12vh, 108px); right: 12px; }
    .jp-word-match-header h2 { font-size: 1.25em; }
    .jp-word-match-columns { gap: 8px; }
    .jp-word-match .jp-word-match-choice { min-height: 48px; padding: 10px 25px 10px 8px; font-size: 1em; overflow-wrap: anywhere; }
    .jp-word-match-choice.is-matched::after, .jp-word-match-choice.is-wrong::after { right: 7px; }
}
