/* ===================================================
   学年会記録アプリ v1.0.0
   WordPress プラグイン用CSS
   .gakunenkai-wrap 内にスコープ
=================================================== */
.gakunenkai-wrap {
  --gk-bg: #f5f7fb;
  --gk-card: #ffffff;
  --gk-line: #d7dce5;
  --gk-text: #1f2937;
  --gk-muted: #6b7280;
  --gk-accent: #2563eb;
  --gk-accent-soft: #dbeafe;
  --gk-danger: #dc2626;
  --gk-shadow: 0 8px 24px rgba(0,0,0,.08);
  box-sizing: border-box;
  font-family: "BIZ UDPGothic", "Yu Gothic UI", sans-serif;
  font-size: 15px;
  color: var(--gk-text);
  background: var(--gk-bg);
}

.gakunenkai-wrap *, .gakunenkai-wrap *::before, .gakunenkai-wrap *::after {
  box-sizing: border-box;
}

/* 修正: 左側フォームをモーダル化したのに伴い、.appは「ツールバー＋プレビュー」を
   縦に並べるだけのシンプルな構成に変更。左右2ペイン・スプリッターは廃止した。 */
.gakunenkai-wrap .app {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  min-height: 100vh;
}

/* 修正: 旧.panel-header相当。常時表示のツールバー（タイトル・学年変更・入力/設定を開く・印刷など）。
   ボタン数が増えても縦に折り返さず1段に収めるため、flex-wrapはやめてnowrap＋
   横スクロール(overflow-x:auto)にした。狭い画面では左右にスワイプして残りのボタンを表示する */
.gakunenkai-wrap .app-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  overflow-x: auto;
  background: var(--gk-card);
  border: 1px solid var(--gk-line);
  border-radius: 16px;
  box-shadow: var(--gk-shadow);
  padding: 12px 16px;
}

.gakunenkai-wrap .app-toolbar-left,
.gakunenkai-wrap .app-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.gakunenkai-wrap .app-toolbar-right {
  margin-left: auto;
}

/* 修正: 横スクロール(nowrap)にした際、ボタンやラベルが潰れて折り返さないよう
   各要素を縮小させない */
.gakunenkai-wrap .app-toolbar-left > *,
.gakunenkai-wrap .app-toolbar-right > * {
  flex-shrink: 0;
  white-space: nowrap;
}

.gakunenkai-wrap .preview-wrap {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--gk-card);
  border: 1px solid var(--gk-line);
  border-radius: 16px;
  box-shadow: var(--gk-shadow);
}

.gakunenkai-wrap .panel-body {
  padding: 16px;
  display: grid;
  gap: 16px;
}

.gakunenkai-wrap .card {
  border: 1px solid var(--gk-line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.gakunenkai-wrap .card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.gakunenkai-wrap .row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gakunenkai-wrap label {
  display: block;
  font-size: 14px;
  color: var(--gk-muted);
  margin-bottom: 6px;
}

.gakunenkai-wrap input[type="text"],
.gakunenkai-wrap input[type="date"],
.gakunenkai-wrap textarea {
  width: 100%;
  border: 1px solid var(--gk-line);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
  background: #fff;
  color: var(--gk-text);
}

/* 修正: 入力の大半をモーダル内で行うようになったため、編集しやすいようテキストエリアを拡大 */
.gakunenkai-wrap textarea { min-height: 110px; }
.gakunenkai-wrap .small-textarea { min-height: 88px; }

.gakunenkai-wrap #aiInput.parsing {
  border-color: var(--gk-accent);
  background: #f0f7ff;
  transition: border-color 0.2s, background 0.2s;
}

.gakunenkai-wrap .btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  align-self: center;
}
/* 修正: .btns内の全ボタンを高さ統一 */
.gakunenkai-wrap .btns button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: auto !important;
  margin: 0 !important;
  padding: 8px 14px !important;
  line-height: 1.4 !important;
  box-sizing: border-box !important;
  vertical-align: middle !important;
}

.gakunenkai-wrap button {
  border: 1px solid var(--gk-line);
  background: #fff;
  color: var(--gk-text);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
}

.gakunenkai-wrap button {
  border: 1px solid var(--gk-line);
  background: #fff;
  color: var(--gk-text);
  border-radius: 10px;
  padding: 8px 14px !important;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  line-height: 1.4 !important;
  height: auto !important;
  box-sizing: border-box;
}

.gakunenkai-wrap button.soft {
  background: var(--gk-accent-soft);
  border-color: #bfdbfe;
  color: #1d4ed8;
}

.gakunenkai-wrap button.danger {
  color: var(--gk-danger);
  border-color: #fecaca;
  background: #fff5f5;
  /* 修正: 他ボタンと高さ・縦位置を完全に揃える */
  padding: 8px 14px !important;
  margin: 0 !important;
  vertical-align: middle !important;
  line-height: 1.4 !important;
  height: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

.gakunenkai-wrap .hint {
  font-size: 12px;
  color: var(--gk-muted);
  line-height: 1.6;
}

.gakunenkai-wrap .section-box {
  border: 1px dashed var(--gk-line);
  border-radius: 12px;
  padding: 12px;
  background: #fcfdff;
}

.gakunenkai-wrap .subject-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.gakunenkai-wrap .subject-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.gakunenkai-wrap .subject-grid .field {
  border: 1px solid var(--gk-line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.gakunenkai-wrap .subject-grid .field h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.gakunenkai-wrap .preview-body {
  padding: 16px;
  overflow: auto;
  background: #eef2f7;
  flex: 1;
}

/* ========== A4プレビュー ========== */
.gakunenkai-wrap .a4 {
  /* 修正: A4超過時のガイド線(.pv-page-guide)を絶対配置で重ねるためposition:relativeにした */
  position: relative;
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  background: white;
  color: #111;
  box-shadow: 0 10px 35px rgba(0,0,0,.12);
  padding: 10mm 10mm 8mm;
  font-family: "UD デジタル 教科書体 NK-R", "BIZ UDPGothic", sans-serif;
  line-height: 1.35;
  font-size: 12px;
}

.gakunenkai-wrap .print-title {
  text-align: center;
  font-size: 1.35em;
  font-weight: 700;
  margin-bottom: 6px;
}

.gakunenkai-wrap .meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 1em;
  margin-bottom: 6px;
  border-bottom: 1px solid #333;
  padding-bottom: 4px;
}

.gakunenkai-wrap .print-section {
  margin-top: 5px;
  border: 1px solid #444;
}

.gakunenkai-wrap .print-section-title {
  background: #f3f4f6;
  font-weight: 700;
  padding: 4px 8px;
  border-bottom: 1px solid #444;
  font-size: 1em;
}

.gakunenkai-wrap .print-section-content {
  padding: 5px 8px;
  font-size: 1em;
  white-space: pre-wrap;
  min-height: 16px;
}

.gakunenkai-wrap .subjects-print {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 5px;
}

.gakunenkai-wrap .subjects-print-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3px;
  padding: 4px;
}

.gakunenkai-wrap .subject-print-item {
  border: 1px solid #888;
  min-height: 26px;
  padding: 3px 5px;
  font-size: 1em;
  white-space: pre-wrap;
}

.gakunenkai-wrap .subject-print-item b { display: inline-block; margin-bottom: 1px; }

/* ========== 改ページ制御 ========== */
/* セクション間の区切り線＋チェックボックス（画面のみ表示） */
.gakunenkai-wrap .pb-divider {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 5px 0;
  cursor: pointer;
  user-select: none;
}

.gakunenkai-wrap .pb-divider::before,
.gakunenkai-wrap .pb-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #c0c8d8;
}

.gakunenkai-wrap .pb-divider input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  accent-color: var(--gk-accent);
  cursor: pointer;
}

.gakunenkai-wrap .pb-divider span {
  font-size: 10px;
  color: #aab;
  white-space: nowrap;
  transition: color 0.15s;
}

/* チェック済みは強調 */
.gakunenkai-wrap .pb-block.do-page-break > .pb-divider span {
  color: var(--gk-accent);
  font-weight: 700;
}

.gakunenkai-wrap .pb-block.do-page-break > .pb-divider::before,
.gakunenkai-wrap .pb-block.do-page-break > .pb-divider::after {
  background: var(--gk-accent);
}

/* 改ページ適用。修正: 「２枚目に印刷」にチェックが入った箇所を、画面上でも実際に
   2ページ目が始まる位置として分かるようレイアウトする。余白と「２ページ目 ▼」の
   バッジで紙が変わる感じを表現する（印刷時はブラウザの改ページ機能に任せるため打ち消す） */
.gakunenkai-wrap .pb-block.do-page-break {
  break-before: page;
  page-break-before: always;
  position: relative;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 2px dashed var(--gk-accent);
}
.gakunenkai-wrap .pb-block.do-page-break::before {
  content: '２ページ目 ▼';
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gk-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(37,99,235,.35);
}

/* 修正: A4の1ページ分の高さを超える箇所に、うっすらとした補助線を引いて知らせる。
   JS(updatePageHint)が内容の変化に合わせて位置を計算し、.a4直下に挿入する */
.gakunenkai-wrap .pv-page-guide {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px dashed rgba(220, 38, 38, .35);
  pointer-events: none;
}
.gakunenkai-wrap .pv-page-guide span {
  position: absolute;
  right: 0;
  top: -1.6em;
  font-size: 9px;
  color: rgba(220, 38, 38, .6);
  background: rgba(255,255,255,.85);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
}

@media print {
  .pb-divider { display: none !important; }
  .pb-block.do-page-break {
    break-before: page !important;
    page-break-before: always !important;
    /* 修正: 画面用の余白・バッジは印刷結果に影響させない */
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
  }
  .pb-block.do-page-break::before,
  .pv-page-guide {
    display: none !important;
  }
}

/* ========== タブ ========== */
.gakunenkai-wrap .gk-tabs {
  display: flex;
  border-bottom: 2px solid var(--gk-line);
  background: #f8f9fb;
  overflow-x: auto;
  scrollbar-width: none;
}

.gakunenkai-wrap .gk-tabs::-webkit-scrollbar { display: none; }

.gakunenkai-wrap .gk-tab {
  flex: 1;
  padding: 10px 8px !important;
  border: none !important;
  border-bottom: 3px solid transparent !important;
  background: transparent !important;
  color: var(--gk-muted) !important;
  font-size: 13px !important;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border-radius: 0 !important;
  transition: color 0.15s, border-color 0.15s;
  height: auto !important;
  line-height: 1.4 !important;
}

.gakunenkai-wrap .gk-tab:hover {
  color: var(--gk-accent) !important;
  background: #f0f4ff !important;
}

.gakunenkai-wrap .gk-tab.active {
  color: var(--gk-accent) !important;
  border-bottom-color: var(--gk-accent) !important;
  background: #fff !important;
}

.gakunenkai-wrap .gk-tab-content {
  display: none;
}

.gakunenkai-wrap .gk-tab-content.active {
  display: block;
}

/* ========== チェックリスト ========== */
#checklistWrap {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 4px !important;
}

#pv-checklist-submitted-items,
#pv-checklist-pending-items {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 1px 4px;
  font-size: 0.9em;
}

.gakunenkai-wrap .check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 8px;
  background: #f8f9fb;
  border: 1px solid var(--gk-line);
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
  width: 100%;
}

.gakunenkai-wrap .check-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--gk-accent);
}

.gakunenkai-wrap .check-item .check-label {
  flex: 1;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  padding: 0;
  min-width: 0;
}

.gakunenkai-wrap .check-item .check-label:focus {
  outline: none;
  border-bottom: 1px solid var(--gk-accent);
}

.gakunenkai-wrap .check-item .del-btn {
  border: none;
  background: none;
  color: var(--gk-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
}

.gakunenkai-wrap .check-item .del-btn:hover { color: var(--gk-danger); }

.gakunenkai-wrap .tt-week-block {
  border: 1px solid var(--gk-line);
  border-radius: 12px;
  padding: 12px;
  background: #fcfdff;
}

/* ========== 時間割グリッド ========== */
.gakunenkai-wrap .timetable-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 8px;
}

.gakunenkai-wrap .timetable-grid th {
  background: #f0f4ff;
  border: 1px solid var(--gk-line);
  padding: 5px 4px;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}

.gakunenkai-wrap .timetable-grid td {
  border: 1px solid var(--gk-line);
  padding: 2px 3px;
  vertical-align: middle;
}

.gakunenkai-wrap .timetable-grid td.period-label {
  background: #f8f9fb;
  text-align: center;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
  width: 32px;
}

.gakunenkai-wrap .timetable-grid td input[type="text"] {
  border: none;
  border-radius: 0;
  padding: 4px;
  font-size: 14px;
  width: 100%;
  min-width: 0;
  background: transparent;
}

.gakunenkai-wrap .timetable-grid td input[type="text"]:focus {
  background: #f0f7ff;
  outline: 1px solid var(--gk-accent);
}

/* ========== 時間割印刷用 ========== */
.gakunenkai-wrap .timetable-print {
  width: 100%;
  border-collapse: collapse;
  font-size: 1em;
}

.gakunenkai-wrap .timetable-print th {
  background: #f3f4f6;
  border: 1px solid #444;
  padding: 3px 4px;
  text-align: center;
  font-weight: 700;
}

.gakunenkai-wrap .timetable-print td {
  border: 1px solid #888;
  padding: 3px 4px;
  text-align: center;
  min-height: 18px;
  font-size: 1em;
}

.gakunenkai-wrap .timetable-print td.period-label {
  background: #f3f4f6;
  font-weight: 700;
  width: 28px;
}

/* ページ数インジケーター */
.gakunenkai-wrap .page-hint {
  text-align: center;
  font-size: 11px;
  color: var(--gk-muted);
  margin-top: 6px;
}

@media (max-width: 1200px) {
  /* 修正: 左右2ペイン構成の解除に伴い、幅指定のみ簡素化(縦積みは.appで常時適用済み) */
  .gakunenkai-wrap .preview-wrap { min-height: auto; width: 100%; }
  .gakunenkai-wrap .a4 { width: 100%; min-height: auto; }
}

@media (max-width: 780px) {
  .gakunenkai-wrap .app-toolbar { padding: 10px 12px; }
  .gakunenkai-wrap .app-toolbar h1 { font-size: 16px; }
}

/* ===================================================
   プレビューの枠タップ編集（タップで入力・設定モーダルを開く）
=================================================== */
/* 修正: 「A４プレビュー」見出し＋編集ヒント(.gk-edit-hint)は表示自体を廃止したため削除 */

/* 修正: contenteditable直接編集をやめ「枠をタップ→モーダル」方式にしたため、
   スタイルの対象をcontenteditable属性ではなく.pv-editableクラスへ変更。
   カーソルもtext(文字入力)からpointer(タップ可能)に変更した */
.gakunenkai-wrap .a4 .pv-editable {
  cursor: pointer;
  border-radius: 3px;
  outline: 1px dashed transparent;
  transition: outline-color .15s, background-color .15s;
}

.gakunenkai-wrap .a4 .pv-editable:hover {
  outline-color: var(--gk-accent);
  background: rgba(37, 99, 235, .08);
}

.gakunenkai-wrap .a4 .pv-editable:active {
  outline: 2px solid var(--gk-accent);
  background: rgba(37, 99, 235, .14);
}

/* 空欄のときにタップ先が分かるようプレースホルダーを表示 */
.gakunenkai-wrap .a4 [data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: #9aa5b1;
  font-weight: 400;
}

/* 修正: 時間割・チェックリストのプレビュー上での追加/削除ボタンは廃止したため、
   専用の.pv-action-btn/.pv-add-btn/.pv-empty-for-printは不要になり削除した。
   追加・削除は入力・設定モーダル(時間割タブ/チェックタブ)側でのみ行う。 */

@media print {
  * {
    visibility: hidden !important;
  }

  .gakunenkai-wrap .a4,
  .gakunenkai-wrap .a4 * {
    visibility: visible !important;
  }

  .gakunenkai-wrap .a4 {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 210mm !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 10mm 10mm 8mm !important;
    line-height: 1.35 !important;
    background: #fff !important;
    z-index: 99999 !important;
  }

  @page { size: A4 portrait; margin: 0; }
}

/* ===================================================
   学年設定モーダル
=================================================== */
.gakunenkai-wrap .gk-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.gakunenkai-wrap .gk-modal-overlay.active {
  display: flex;
}
.gakunenkai-wrap .gk-modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 32px 28px 24px;
  min-width: 320px;
  box-shadow: 0 16px 48px rgba(0,0,0,.2);
  text-align: center;
}

/* 修正: 入力・設定モーダル（旧・左側フォーム）用。他の3ステップモーダルと違い
   文章量が多いのでtext-align:leftにし、幅を広げてヘッダーとスクロール領域に分けている。
   修正: プレビューが直接編集からタップ→モーダル方式になり、入力作業の大半をこの
   モーダル内で行うようになったため、編集しやすいようさらに大きく拡大した */
.gakunenkai-wrap .gk-form-modal-box {
  width: min(980px, 96vw);
  max-height: min(92vh, 1080px);
  padding: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
  overflow: hidden;
}

/* 修正: 「次回の学年会」入力とJSON保存/読込/クリア/印刷ボタンを、「学年会の内容を
   入力」の見出しと同じ1行に並べる構成に変更。閉じるボタン(✕)は右上に固定配置する
   ため.form-modal-headをposition:relativeにし、右側にその分の余白を確保している */
.gakunenkai-wrap .form-modal-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 16px 56px 16px 22px;
  border-bottom: 1px solid var(--gk-line);
  flex-shrink: 0;
}

.gakunenkai-wrap .form-modal-head-title {
  flex: 0 0 auto;
}

.gakunenkai-wrap .form-modal-next-meeting {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  min-width: 200px;
}
.gakunenkai-wrap .form-modal-next-meeting label {
  margin: 0;
  font-size: 13px;
  white-space: nowrap;
  color: var(--gk-muted);
}
.gakunenkai-wrap .form-modal-next-meeting input {
  flex: 1;
}

.gakunenkai-wrap .form-modal-head .btns {
  flex: 0 0 auto;
}

.gakunenkai-wrap .gk-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 0;
  border-radius: 50%;
  background: #eef1f6;
  color: #33415c;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 !important;
}
.gakunenkai-wrap .gk-modal-close:hover { background: #e1e7f0; }

.gakunenkai-wrap .form-modal-scroll {
  overflow-y: auto;
  flex: 1;
}
.gakunenkai-wrap .gk-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gk-text);
  margin-bottom: 20px;
}
.gakunenkai-wrap .gk-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.gakunenkai-wrap .gk-grade-btn {
  background: var(--gk-accent-soft);
  color: var(--gk-accent);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 14px 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.gakunenkai-wrap .gk-grade-btn:hover {
  background: var(--gk-accent);
  color: #fff;
  transform: scale(1.04);
}
.gakunenkai-wrap .gk-modal-skip {
  background: none;
  border: none;
  color: var(--gk-muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 8px;
}
.gakunenkai-wrap .gk-grade-badge {
  background: var(--gk-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 20px;
  padding: 3px 10px;
  white-space: nowrap;
}
.gakunenkai-wrap .gk-grade-change-btn {
  background: none;
  border: 1px solid var(--gk-line);
  border-radius: 8px;
  font-size: 12px;
  color: var(--gk-muted);
  padding: 3px 8px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.gakunenkai-wrap .gk-grade-change-btn:hover {
  border-color: var(--gk-accent);
  color: var(--gk-accent);
}

/* AI未振り分けエラー表示 */
.gakunenkai-wrap .ai-unmatched {
  margin-top: 8px;
  padding: 8px 10px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  font-size: 12px;
  color: #dc2626;
  white-space: pre-wrap;
  line-height: 1.6;
}
.gakunenkai-wrap .ai-unmatched-title {
  font-weight: 700;
  margin-bottom: 4px;
}

/* ===================================================
   モーダル 3ステップ追加スタイル
=================================================== */
.gakunenkai-wrap .gk-modal-step-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gk-muted);
  letter-spacing: .08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}
.gakunenkai-wrap .gk-modal-back {
  background: none;
  border: 1px solid var(--gk-line);
  border-radius: 8px;
  font-size: 13px;
  color: var(--gk-muted);
  padding: 6px 12px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.gakunenkai-wrap .gk-modal-back:hover {
  border-color: var(--gk-accent);
  color: var(--gk-accent);
}

/* 教科チェックグリッド */
.gakunenkai-wrap .gk-subject-check-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px 2px;
}
.gakunenkai-wrap .gk-subject-check-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--gk-bg);
  border: 2px solid var(--gk-line);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.gakunenkai-wrap .gk-subject-check-item.selected {
  border-color: var(--gk-accent);
  background: var(--gk-accent-soft);
  color: var(--gk-accent);
}
.gakunenkai-wrap .gk-subject-check-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--gk-accent);
  flex-shrink: 0;
}
