/* ============================================================
 * 新デザイン（2026-09-13, md/WRITING_SCORE_REDESIGN_PLAN_2026-09-13.md）
 * breakdown-grid刷新／feedback-grid-topチェックリスト化／
 * feedback-section-wrapper→feedback-cardモジュール統合／語彙+αタグ
 *
 * ai_writers_custom_html.html にインラインで持っていたものを分離。
 * myscript.js を読み込むページ（AI添削ページ／マイページ／V2ライティング
 * ページ）全部で使うため、enqueue_custom_js() と同じ条件で読み込む。
 * ============================================================ */
/* 外枠の幅を先に固定し、中身をその枠に収める、という前提が無かったのが今回の一連の
   スマホ崩れ（改行されずテキストがフレーム外に見切れる／横スクロールカルーセルが
   88%でなく2列並びに見える／POINTのタブが3つ目だけ消える）の根本原因。
   flex/gridの子要素はデフォルトでmin-width:autoのため、中身（特に英語の連続文字列や
   ボタンラベル）の最小サイズより枠を縮められず、コンテナ側にはみ出す→上位の
   overflow:hiddenで見えなくなる、という流れだった。box-sizing統一＋各flex/grid子要素の
   min-width:0で「枠を先に決めて中身を収める」形に直す */
.score-card, .score-card * { box-sizing: border-box; }
.score-card { width: 100%; max-width: 100%; min-width: 0; }
/* score-header/score-main/score-subは元々ai_writers_custom_html.html側にしかスタイルが
   無く、そのHTMLを読み込まないマイページのモーダルでは無地になっていた。本番の見た目
   （紫グラデーションのヘッダーカード）をそのままこちらに移植し、全ページで効くようにする */
.score-card .score-header { text-align: center; background: linear-gradient(135deg, #7B62DF 0%, #9C89F0 100%); color: #fff; padding: 20px; border-radius: 12px; margin-bottom: 20px; box-shadow: 0 4px 12px rgba(123, 98, 223, 0.3); }
/* .score-mainという同名クラスがfunctions.php側の旧スマホカード用CSS
   （@media max-width:768px内、無地の#007cba）にも存在し、クラス名が衝突する。
   ここで明示的にcolorを指定し、両方に効かせる（詳細度で確実に上書きするため） */
.score-card .score-header .score-main { font-size: 24px; font-weight: bold; margin-bottom: 10px; color: #fff; }
.score-card .score-header .score-sub { font-size: 16px; color: #fff; }
/* 問題文ボックス（アーティファクト fc17e272 の.qboxを移植。意見文はお題、要約は元の英文パッセージ） */
.score-card .qbox { padding: 10px 0; font-size: 13px; margin: 14px 0; }
.score-card .qbox .h { font-size: 9.5px; font-weight: 800; letter-spacing: .07em; color: #6b6a7a; margin-bottom: 3px; }
/* qbox-top：カルーセル全体の上に1回だけ出す「要約の原文」見出し＋現在位置のドット
   （ドットはスマホの横スクロールカルーセル時のみ意味を持つため420px以下でのみ表示） */
.score-card .qbox-top { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; margin: 14px 0 6px; text-align: center; }
.score-card .qbox-top .h { margin-bottom: 0; }
.score-card .qbox .passage { white-space: pre-line; line-height: 1.8; color: #211f2e; }
/* 背景色は廃止し、段落ごとにテーマ=緑／賛成(メリット)=青／反対(デメリット)=赤の
   枠線で囲む。align-items:flex-startでカルーセル内の枠線を各段落の本文の高さに合わせる
   （flexの初期値stretchだと一番背の高い段落に他の枠も揃ってしまうため） */
.score-card .qbox .qbox-body { align-items: flex-start; }
.score-card .qbox .qbox-para { margin-bottom: 12px; border: 2px solid #d9d0f6; border-radius: 10px; padding: 10px 12px; }
.score-card .qbox .qbox-para:last-child { margin-bottom: 0; }
.score-card .qbox .qbox-para.op { border-color: #15803d; }
.score-card .qbox .qbox-para.rs { border-color: #4a5fa5; }
.score-card .qbox .qbox-para.ct { border-color: #b3243f; }
.score-card .qbox .qbox-para-head { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 3px; }
.score-card .qbox .qbox-para-head .h { margin-bottom: 0; }
.score-card .qbox .qbox-note { font-size: 11.5px; color: #211f2e; font-weight: 800; text-align: center; margin: 3px 0 8px; }
.score-card .qbox .qbox-para-text { line-height: 1.8; color: #211f2e; }
/* 賛成パート1/賛成パート2等、同じ枠(qbox-para)の中に複数入る場合のサブ区画の区切り */
.score-card .qbox .qbox-sub:not(:last-child) { margin-bottom: 10px; }
.score-card .qbox .qbox-sub-divider { padding-top: 10px; border-top: 1px dashed #e6e2f2; }
.score-card .qbox, .score-card .qbox .qbox-body { width: 100%; max-width: 100%; min-width: 0; }
@media (max-width: 420px) {
  /* 作り直し：前回は負のmargin(-13px)で枠の外にビリード＋paddingで戻す手法を使っていたが、
     これ自体が「枠を先に決めず中身側で調整する」やり方で他要素の横幅にも影響し得たため撤去。
     qbox自体のpadding内に完全に収まる形（bleedなし）で、1段落=画面幅ぴったり1枚のカルーセルにする */
  .score-card .qbox-top .dots { display: flex; gap: 6px; }
  .score-card .qbox .qbox-body { display: flex; gap: 5px; width: 100%; max-width: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .score-card .qbox .qbox-body::-webkit-scrollbar { display: none; }
  .score-card .qbox .qbox-body .qbox-para { flex: 0 0 100%; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; scroll-snap-align: start; scroll-snap-stop: always; margin-bottom: 0; }
  .score-card .qbox .qbox-body .qbox-para-text { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
}
.score-card .sec-h { font-size: 12px; font-weight: 800; color: #5f47c4; letter-spacing: .03em; margin: 18px 0 9px; }

.score-card .tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 4px; }
.score-card .tile { background: #fffbe6; border: 1px solid #d9d0f6; border-radius: 10px; padding: 10px 6px; text-align: center; position: relative; cursor: pointer; }
.score-card .tile .k { font-size: 11px; font-weight: 700; color: #5f47c4; display: flex; align-items: center; justify-content: center; gap: 3px; margin-bottom: 4px; }
.score-card .tile .qmark { width: 13px; height: 13px; border-radius: 50%; background: #d9d0f6; color: #5f47c4; font-size: 9px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.score-card .tile .v { font-size: 20px; font-weight: 900; color: #211f2e; }
.score-card .tile .v small { font-size: 11px; font-weight: 700; color: #6b6a7a; }
/* スマホでも4項目を1列(横並び)のまま表示する。2x2にはしない */
@media (max-width: 420px) {
  .score-card .tiles { grid-template-columns: repeat(4, 1fr); gap: 5px; }
  .score-card .tile { padding: 7px 3px; }
  .score-card .tile .k { font-size: 9.5px; }
  .score-card .tile .v { font-size: 16px; }
}

.score-card .checklist { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }
.score-card .checkcard { border: 1px solid #e6e2f2; border-radius: 11px; padding: 12px 13px; background: #fff; }
.score-card .checkcard .cc-h { font-size: 12px; font-weight: 800; color: #211f2e; margin-bottom: 8px; }
.score-card .checkrow { display: flex; align-items: flex-start; gap: 6px; font-size: 11.5px; color: #6b6a7a; margin-bottom: 6px; line-height: 1.55; }
.score-card .checkrow:last-child { margin-bottom: 0; }
.score-card .checkrow .mk { flex: 0 0 auto; font-size: 13px; line-height: 1.3; display: inline-flex; align-items: center; }
.wsr-mark-svg { vertical-align: middle; flex: none; }
.wsr-check-pct { flex: 0 0 auto; margin-left: auto; font-size: 10px; font-weight: 800; color: #5f47c4; background: #fffbe6; border: 1px solid #d9d0f6; border-radius: 999px; padding: 1px 7px; cursor: pointer; white-space: nowrap; }

/* チェックリストの%クリック用ツールチップ（fixed配置。スクロール領域からはみ出さない） */
.wsr-tip { position: fixed; z-index: 100010; background: #fff; color: #211f2e; font-size: 11.5px; font-weight: 600; line-height: 1.55; padding: 10px 13px; border: 1px solid #e6e2f2; border-radius: 12px; box-shadow: 0 10px 30px rgba(20,20,40,.16); text-align: left; max-height: 60vh; overflow-y: auto; white-space: pre-wrap; }
.wsr-tip::after { content: ""; position: absolute; left: var(--ax, 50%); width: 12px; height: 12px; background: #fff; border-right: 1px solid #e6e2f2; border-bottom: 1px solid #e6e2f2; }
.wsr-tip.above::after { top: 100%; margin-top: -6px; transform: translateX(-50%) rotate(45deg); }
.wsr-tip.below::after { bottom: 100%; margin-bottom: -6px; transform: translateX(-50%) rotate(225deg); }
/* あなたの回答プレビュー用：セクションごとのバッジ（.score-cardの外でも使うので独立定義、
   配色はqbox/essayの seg-label と統一：テーマ/意見/結論=緑, 理由/賛成パート=青, 逆接・譲歩/反対パート=赤 */
.wsr-tip .seg-label { display: inline-block; font-size: 9.5px; font-weight: 800; padding: 1px 7px; border-radius: 5px; margin-bottom: 2px; }
.wsr-tip .seg-label.op { color: #15803d; background: #e3f7ea; }
.wsr-tip .seg-label.rs { color: #4a5fa5; background: #e9edf9; }
.wsr-tip .seg-label.ct { color: #b3243f; background: #fde8ea; }
.wsr-tip .seg-label.ds { color: #6b6a7a; background: #f0eef7; }
.wsr-tip br + .seg-label { margin-top: 6px; }
@media (max-width: 420px) { .score-card .checklist { grid-template-columns: 1fr; } }

.score-card .pcards { display: flex; flex-direction: column; gap: 9px; margin-bottom: 4px; }
.score-card .feedback-card { background: #fff; border: 1px solid #e6e2f2; border-radius: 11px; padding: 10px; }
.score-card .feedback-card .tags { display: flex; gap: 5px; margin-bottom: 6px; align-items: center; }
.score-card .feedback-card .tag { font-size: 9.5px; font-weight: 800; padding: 1px 7px; border-radius: 5px; background: #fffbe6; color: #5f47c4; }
.score-card .feedback-card .tag.grm { background: #fde8ea; color: #b3243f; }
.score-card .feedback-card .tag.num { background: #d21f3c; color: #fff; border-radius: 50%; width: 16px; height: 16px; line-height: 16px; text-align: center; padding: 0; }
.score-card .feedback-card .tag.plus { background: #000; color: #e0b84a; font-weight: 800; border: 1px solid #a3790a; }
.score-card .feedback-card .txt { font-size: 12px; line-height: 1.65; margin-bottom: 2px; }
.score-card .feedback-card .fixp { margin-top: 7px; font-family: "Roboto Mono", monospace; font-size: 12.5px; background: #f6f4fb; border: 1px solid #e6e2f2; border-radius: 7px; padding: 5px 7px; }
.score-card .feedback-card .fixp del { color: #d21f3c; }
.score-card .feedback-card .fixp ins { color: #00a94f; text-decoration: none; font-weight: 700; }
.score-card .feedback-card .fixp .fixp-after { display: flex; align-items: center; gap: 4px; margin-top: 3px; }
.score-card .feedback-card .fixp .fixp-arrow { flex: none; color: #00a94f; }
.score-card .feedback-card .fixp.inline { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.score-card .feedback-card.plus { border-color: #a3790a; }
/* 背景・文字色とも他の.fixpと同じ通常配色に戻す（見出しタグ「語彙+α」だけ金色のまま） */
.score-card .feedback-card.plus .fixp .word { font-weight: 800; }
.score-card .feedback-card .cjmk { font-size: 13px; display: inline-flex; align-items: center; }

.score-card .pointmodeseg { display: flex; gap: 6px; margin-bottom: 9px; }
.score-card .pointmodeseg button { flex: 1; min-width: 0; border: 1px solid #d9d0f6; background: #fff; color: #6b6a7a; font: inherit; font-size: 11.5px; font-weight: 800; padding: 7px 4px; border-radius: 8px; cursor: pointer; white-space: normal; overflow-wrap: break-word; }
.score-card .pointmodeseg button.active { background: #7B62DF; color: #fff; border-color: #7B62DF; }
.score-card .pointmodeseg button:disabled { opacity: .4; cursor: default; }

.wsr-ai-note { font-size: 10.5px; color: #6b6a7a; text-align: center; margin-top: 8px; }


/* あなたの回答（本文diffハイライト）＋POINTパネル 2カラム */
.score-card .review { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 300px); gap: 12px; min-width: 0; }
@media (max-width: 640px) { .score-card .review { grid-template-columns: minmax(0, 1fr); } }
.score-card .essay-pane { border: 1px solid #e6e2f2; border-radius: 12px; background: #fffbe6; min-width: 0; max-width: 100%; }
.score-card .essay-scroll { max-height: 420px; overflow: auto; padding: 14px 16px; min-width: 0; max-width: 100%; }
.score-card .wsr-reannotate-wrap { min-height: 380px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 20px; }
.score-card .wsr-reannotate-wrap .wsr-reannotate-retry { white-space: nowrap; }
.score-card .wsr-reannotate-btn { border: 0; border-radius: 999px; background: linear-gradient(90deg, #7B62DF, #9C89F0); color: #fff; font: inherit; font-size: 13.5px; font-weight: 800; padding: 12px 28px; cursor: pointer; box-shadow: 0 6px 16px rgba(123, 98, 223, .35); }
.score-card .wsr-reannotate-btn:hover { transform: translateY(-1px); }
.score-card .wsr-reannotate-note { color: #6b6a7a; font-size: 12.5px; }
.score-card .essay { font-family: "Roboto Mono", ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 2.3; color: #211f2e; overflow-wrap: break-word; min-width: 0; }
.score-card .seg { position: relative; padding: 18px 0 8px; }
.score-card .seg.seg-divider { border-bottom: 1px solid #ece9f6; }
.score-card .seg:last-child { border-bottom: 0; }
.score-card .seg-label { display: inline-block; font-size: 10px; font-weight: 800; line-height: 1.4; padding: 1px 8px; border-radius: 6px; margin-bottom: 4px; }
/* テーマ=緑／賛成(メリット)=青／反対(デメリット)=赤 に統一（qboxの段落枠線と合わせる） */
.score-card .seg-label.op { color: #15803d; background: #e3f7ea; }
.score-card .seg-label.rs { color: #4a5fa5; background: #e9edf9; }
.score-card .seg-label.ds { color: #a86520; background: #f6ecd9; }
.score-card .seg-label.ct { color: #b3243f; background: #fde8ea; }
.seg-content-mark { display: inline-flex; align-items: center; justify-content: center; font-size: 12px; cursor: pointer; margin-left: 5px; vertical-align: middle; position: relative; }
.sent-num { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: #ece9f6; color: #6b6a7a; font-size: 9px; font-weight: 800; margin-right: 5px; vertical-align: 2px; }
.sent { border-radius: 5px; transition: background .2s; }
.hl-flash { background: #ffe08a !important; transition: background .2s; }
.score-card .chg { position: relative; display: inline-block; cursor: pointer; line-height: 1.15; border-radius: 4px; }
.score-card .chg .before { text-decoration: line-through; text-decoration-color: rgba(210,31,60,.85); text-decoration-thickness: 3px; white-space: nowrap; }
.score-card .chg .after { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); color: #00a94f; font-weight: 700; white-space: nowrap; font-size: .82em; margin-bottom: 2px; pointer-events: auto; cursor: pointer; }
.score-card .chg:hover { background: #fff3d6; }
.score-card .chg.accepted { background: #fffbe6; padding: 0 2px; }
.score-card .chg.accepted .before { display: none; }
.score-card .chg.accepted .after { position: static; transform: none; display: inline-flex; margin: 0; font-size: 1em; }
.score-card .chg.rejected { opacity: .75; }
.score-card .chg.rejected .after { display: none; }
.score-card .chg.rejected .before { text-decoration: none; border-bottom: 2px dotted #6b6a7a; }
.score-card .essay.showvocnum .chgnum { display: inline-block; background: #d21f3c; color: #fff; border-radius: 50%; width: 14px; height: 14px; line-height: 14px; text-align: center; font-size: 9px; margin-right: 3px; }

/* 添削の修正/そのまま選択ポップアップ */
.wsr-pop { position: fixed; z-index: 100020; background: #fff; border: 1px solid #e6e2f2; border-radius: 12px; box-shadow: 0 10px 34px rgba(0,0,0,.22); padding: 9px; display: flex; gap: 7px; flex-direction: column; min-width: 172px; max-width: min(360px, calc(100vw - 24px)); }
.wsr-pop .pv { font-family: "Roboto Mono", monospace; font-size: 16px; text-align: center; padding: 4px 0 6px; color: #6b6a7a; white-space: normal; word-break: break-word; }
@media (max-width: 420px) {
  .wsr-pop { width: calc(100vw - 24px); max-width: calc(100vw - 24px); }
}
.wsr-pop .pv .wrong { color: #d21f3c; }
.wsr-pop .pv .arrow { color: #6b6a7a; margin: 0 2px; }
.wsr-pop .pv .right { color: #00a94f; font-weight: 700; }
.wsr-pop .row2 { display: flex; gap: 7px; }
.wsr-pop button { flex: 1; border: 0; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 800; padding: 9px 0; cursor: pointer; }
.wsr-pop .keep { background: #f6f4fb; color: #211f2e; border: 1px solid #e6e2f2; }
.wsr-pop .fix { background: #00a94f; color: #fff; }
.wsr-pop::after { content: ""; position: absolute; left: var(--ax, 50%); bottom: -7px; width: 12px; height: 12px; background: #fff; border-right: 1px solid #e6e2f2; border-bottom: 1px solid #e6e2f2; transform: translateX(-50%) rotate(45deg); }
.wsr-pop.below::after { bottom: auto; top: -7px; transform: translateX(-50%) rotate(225deg); }

/* あなたの回答 見出し＋オリジナルver トグル */
.answer-head { display: flex; align-items: center; gap: 10px; }
.pill-toggle { border: 1px solid #e6e2f2; background: #fff; color: #6b6a7a; font: inherit; font-size: 11px; font-weight: 700; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.pill-toggle.active { border-color: #7B62DF; color: #5f47c4; background: #fffbe6; }
/* オリジナルver／添削verを2つの独立したボタンにして、今どちらを見ているか一目で分かるようにする */
.wsr-view-toggle { display: flex; gap: 6px; }

/* 構成タブ：意見/理由N/結論の大きな単位ごとにまとめ、詳細・具体例はトグルで開閉 */
.tag.tag-struct-num { background: #fff; color: #000; border: 1px solid #e6e2f2; }
.wsr-struct-toggle { display: block; margin-top: 8px; border: 0; background: none; color: #5f47c4; font: inherit; font-size: 11px; font-weight: 800; padding: 0; cursor: pointer; }
.wsr-struct-extra { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #e6e2f2; display: flex; flex-direction: column; gap: 8px; }
/* display:flexがhidden属性のUAデフォルト(display:none)を上書きしてしまい、常に開いた
   状態になっていた。hidden時は明示的にnoneに戻す */
.wsr-struct-extra[hidden] { display: none; }
.wsr-struct-sub { cursor: pointer; }
.wsr-struct-sub .seg-label { position: static; margin-bottom: 4px; }

/* 内容タブ：⭕️/🔺/❌のマーク色 */
.cjmk.good { color: #00a94f; }
.cjmk.warn { color: #a86520; }
.cjmk.bad { color: #d21f3c; }

/* 変更/修正/そのまま/未確認 統計バー＋「採点シミュレーション」ボタン */
.review-stats { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid #e6e2f2; }
.review-stats .stat { font-size: 12px; color: #6b6a7a; font-weight: 700; }
.review-stats .stat b { color: #211f2e; font-size: 13px; margin-right: 2px; }
.review-stats .stat.unconfirmed b { color: #b3243f; }
/* AI採点ボタン(.ai-grade-btn)と同じ配色・キラッとアニメーション */
.apply-btn { background: #dc2626; color: #fff; font: inherit; font-size: 14px; font-weight: 800; padding: 4px 13px; border: none; border-radius: 10px; cursor: pointer; position: relative; overflow: hidden; box-shadow: 0 6px 20px rgba(220,38,38,.5), 0 3px 10px rgba(0,0,0,.3); transition: all .3s ease; }
.score-card .vocabulary-section { display: none; }
@media (max-width: 420px) {
  /* 変更/修正/そのまま/未確認を4スパン1行にし、その下にapply-btnをフル幅で配置 */
  .review-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 4px; align-items: center; }
  .review-stats .stat { order: 0; text-align: center; font-size: 11px; }
  .review-stats .stat b { display: block; font-size: 14px; }
  .review-stats .apply-btn { order: 1; grid-column: 1 / -1; width: 100%; margin-top: 4px; }
}
.apply-btn:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 8px 25px rgba(220,38,38,.6), 0 4px 15px rgba(0,0,0,.4); }
.apply-btn:active { transform: translateY(0) scale(.98); box-shadow: 0 3px 10px rgba(220,38,38,.4), 0 2px 5px rgba(0,0,0,.3); }
.apply-btn::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient(45deg, transparent, rgba(255,255,255,.8), transparent); animation: aicheckSparkle 10s ease-in-out infinite; }
@keyframes aicheckSparkle {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); opacity: 0; }
  45% { opacity: 0; }
  50% { opacity: 1; }
  55% { opacity: 0; }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); opacity: 0; }
}
.apply-btn:disabled { background: #cbd0d6; color: #8a8f98; cursor: default; box-shadow: none; transform: none; }
.apply-btn:disabled::before { display: none; }

/* 採点シミュレーション：スコア更新時のフェード＋キラッと光る演出 */
.score-card .score-main, .score-card .score-sub, .score-card .tile { transition: opacity .22s ease; }
@keyframes wsrSimSparkle {
  0% { box-shadow: 0 0 0 0 rgba(255,196,0,0); }
  35% { box-shadow: 0 0 0 3px rgba(255,196,0,.45), 0 0 16px 4px rgba(255,196,0,.5); }
  100% { box-shadow: 0 0 0 0 rgba(255,196,0,0); }
}
.score-card .wsr-sim-changed { background: #e5484d !important; color: #fff !important; border-radius: 8px; padding-inline: 8px; display: inline-block; }
.score-card .score-header .score-main.wsr-sim-changed, .score-card .score-header .score-sub.wsr-sim-changed { display: block; width: fit-content; margin-inline: auto; }
.score-card .wsr-sim-changed small { color: #fff !important; }
@keyframes wsrSimPop { 0% { transform: scale(1); } 40% { transform: scale(1.25); } 100% { transform: scale(1); } }
.score-card .wsr-sim-pop { animation: wsrSimPop .6s ease; }
.score-card .tile.wsr-sim-sparkle { animation: wsrSimSparkle .9s ease; border-radius: 10px; }
.score-card .score-header.wsr-sim-sparkle { animation: wsrSimSparkle .9s ease; border-radius: 10px; }
.score-card .points-pane { border: 1px solid #e6e2f2; border-radius: 12px; background: #f5f0fb; padding: 12px; display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.score-card .points-sub-h { display: flex; align-items: center; position: relative; font-size: 12px; font-weight: 800; color: #5f47c4; margin: 0 0 8px; }
.score-card .points-sub-h .cnt { margin-left: auto; font-size: 10px; font-weight: 800; color: #5f47c4; background: #fffbe6; border: 1px solid #d9d0f6; border-radius: 999px; padding: 1px 7px; }
.score-card .points-pane .pcards { max-height: 380px; overflow: auto; margin-bottom: 0; }
.score-card .dots { display: none; }
.score-card .dot { width: 6px; height: 6px; border-radius: 50%; background: #d9d0f6; transition: width .2s, border-radius .2s, background .2s; }
.score-card .dot.on { background: #7B62DF; width: 18px; border-radius: 3px; }
@media (max-width: 420px) {
  /* 改善のポイント(.feedback-card)のみ、タブ/POINTヘッダーはそのままで1枚ずつの横スクロールカルーセルに */
  .score-card .points-pane .pcards { display: flex; flex-direction: row; width: 100%; max-width: 100%; max-height: none; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .score-card .points-pane .pcards::-webkit-scrollbar { display: none; }
  .score-card .points-pane .pcards .feedback-card { flex: 0 0 100%; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; scroll-snap-align: start; scroll-snap-stop: always; }
  /* artifact c74d60a5 の.dotsを移植：カルーセルの現在位置インジケーター */
  .score-card .points-sub-h .dots { display: flex; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); gap: 6px; padding: 0; }
}

/* 採点進捗（3段階＋パーセントバー）。モーダル幅からはみ出さないよう明示的に固定する */
.wsr-progress-box { border: 1px solid #e6e2f2; border-radius: 12px; background: #fff; padding: 16px 18px; margin: 12px 0; max-width: 100%; box-sizing: border-box; overflow: hidden; }
.wsr-progress-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.wsr-spin { width: 18px; height: 18px; border-radius: 50%; border: 3px solid #f1eefc; border-top-color: #7B62DF; animation: wsrSpin 1s linear infinite; flex: 0 0 auto; }
@keyframes wsrSpin { to { transform: rotate(360deg); } }
.wsr-progress-title { font-size: 13.5px; font-weight: 800; color: #211f2e; }
.wsr-progress-sub { font-size: 11px; color: #6b6a7a; font-weight: 600; margin-top: 2px; }
.wsr-barwrap { background: #f6f4fb; border: 1px solid #e6e2f2; border-radius: 999px; overflow: hidden; height: 14px; margin-bottom: 6px; }
.wsr-bar { background: linear-gradient(90deg, #7B62DF, #9C89F0); height: 100%; transition: width .35s ease; }
.wsr-pctline { text-align: right; font-size: 11.5px; font-weight: 800; color: #5f47c4; }

/* 採点パラメーターの項目別ステータス（スピーキング1級の採点画面と同じ「待機中/採点中/完了」方式）
   table-layout:fixedが無いと、幅の広い日本語ラベルがwidth:100%を無視してテーブルごと
   親要素（vk_borderBoxの採点結果！枠）の外にはみ出す（auto layoutは内容優先で幅を決めるため） */
.wsr-step-table { width: 100%; table-layout: fixed; border-collapse: collapse; margin-top: 10px; background: #f9f9f9; border-radius: 8px; overflow: hidden; }
.wsr-step-table tr:not(:last-child) td { border-bottom: 1px solid #eee; }
.wsr-step-table td { padding: 7px 12px; font-size: 12.5px; overflow-wrap: anywhere; min-width: 0; background: transparent; border: 0; text-align: left; }
/* table-layout:fixedで列幅を指定しないと2列が均等割りになり、短い方(状態列)に対して
   長いラベル文が収まらずはみ出す。ラベル列を広く・状態列を必要最小限に固定する */
.wsr-step-table td.wsr-step-label { color: #333; width: 70%; }
.wsr-step-table td.wsr-step-status { text-align: right; font-weight: 700; width: 30%; white-space: nowrap; }
.wsr-step-table td.wsr-step-status.waiting { color: #aaa; font-weight: 400; }
.wsr-step-table td.wsr-step-status.scoring { color: #d98a00; }
.wsr-step-table td.wsr-step-status.scoring { animation: wsrStepPulse 1.2s ease-in-out infinite; }
@keyframes wsrStepPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .wsr-step-table td.wsr-step-status.scoring { animation: none; } }
.wsr-step-table td.wsr-step-status.done { color: #00a94f; }

/* 履歴一覧（display_user_scores）の「詳細を見る（新デザイン）」モーダル */
.wsr-history-modal { position: fixed; inset: 0; z-index: 100000; background: rgba(20, 20, 30, .55); display: none; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto; }
.wsr-history-modal.open { display: flex; }
.wsr-history-modal-inner { position: relative; width: 100%; max-width: 960px; background: #fff; border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.4); padding: 18px 16px 24px; margin-top: 20px; box-sizing: border-box; overflow-x: hidden; }
/* アーティファクト fc17e272 の.mc-close（赤丸+白バツのSVG）と同じ見た目にする。
   文字の×はモーダル本体の白背景に紛れて見えにくかったため */
.wsr-history-modal-close { position: fixed; top: 16px; right: 16px; z-index: 2; background: none; border: 0; padding: 0; line-height: 0; cursor: pointer; filter: drop-shadow(0 2px 6px rgba(0,0,0,.5)); }
.wsr-reconvert-btn { margin-left: 6px; border: 1px solid #7B62DF; background: #fff; color: #7B62DF; font: inherit; font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 7px; cursor: pointer; }
.wsr-view-rich-btn { border: 1px solid #7B62DF; background: #fff; color: #7B62DF; font: inherit; font-size: 11px; font-weight: 700; padding: 6px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; }

.score-card .review-stats .wsr-sim-note { flex-basis: 100%; width: 100%; font-size: 12px; color: #b3382c; margin-top: 6px; }
@media (max-width: 420px) { .score-card .review-stats .wsr-sim-note { grid-column: 1 / -1; } }

.wsr-struct-mk { margin: 0; display: inline-flex; align-items: center; gap: 4px; border: 1px solid #f0c987; background: #fff8e8; color: #b3630a; font: inherit; font-size: 11px; font-weight: 800; line-height: 1.4; padding: 2px 9px 2px 6px; border-radius: 999px; cursor: pointer; }
.wsr-struct-mk .wsr-mark-svg { width: 14px; height: 14px; }

.wsr-pop .unc { font-size: 11px; color: #8a7f9f; text-align: center; margin: -2px 0 0; }
.wsr-pop .alt-row { display: flex; }
.wsr-pop .alt-row .alt { background: #fff; color: #5f47c4; border: 1px dashed #b9a9f0; padding: 6px 0; font-size: 12px; }

.wsr-struct-sub .wsr-struct-subhead { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.wsr-struct-sub .wsr-struct-subhead .seg-label { margin-bottom: 0; }
