/* =============================================
   study-tools.css — ツールバー + サイドバー + アノテーション
   ============================================= */

/* ツールバー */
.study-toolbar {
  position: sticky;
  top: 40px; /* site-headerの高さ分下 */
  z-index: 90;
  background: #3a3028;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 1.5px solid transparent;
  border-radius: 5px;
  color: #bbb;
  font-size: 12px;
  font-family: inherit;
  padding: 4px 9px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  white-space: nowrap;
}
.tool-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.tool-btn.active { background: rgba(255,255,255,0.15); border-color: #6a9fd8; color: #fff; }
.tool-btn svg { width: 14px; height: 14px; fill: currentColor; flex-shrink: 0; }

.tool-sep { width: 1px; background: #555; height: 20px; margin: 0 4px; }

/* 色選択 */
.color-picker-wrap { display: flex; align-items: center; gap: 3px; margin-left: 4px; }
.color-dot {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.1s, transform 0.1s;
}
.color-dot:hover { transform: scale(1.2); }
.color-dot.selected { border-color: #fff; }

.toolbar-right { margin-left: auto; }
.site-header .header-auth { margin-left: auto; flex-shrink: 0; }

/* =============================================
   サイドバー
   ============================================= */
.study-sidebar {
  position: fixed;
  top: 0;
  left: -260px;
  width: 260px;
  height: 100vh;
  background: #2c2416;
  z-index: 200;
  transition: left 0.25s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 3px 0 16px rgba(0,0,0,0.4);
}
.study-sidebar.open { left: 0; }

/* サイドバーを開くタブ */
.sidebar-tab {
  position: fixed;
  top: 120px;
  left: 0;
  z-index: 201;
  background: #3a3028;
  border: none;
  border-radius: 0 6px 6px 0;
  color: #aaa;
  cursor: pointer;
  padding: 18px 4px;
  font-size: 11px;
  writing-mode: vertical-rl;
  letter-spacing: 1px;
  transition: background 0.15s, color 0.15s, left 0.25s ease;
  box-shadow: 2px 0 6px rgba(0,0,0,0.3);
}
.sidebar-tab:hover { background: #4a3a28; color: #fff; }
.sidebar-tab.shifted { left: 260px; }

.sidebar-header {
  padding: 14px 14px 10px;
  border-bottom: 1px solid #333;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-header .title { color: #eee; font-size: 13px; font-weight: 700; }
.sidebar-close {
  background: none; border: none; color: #888; cursor: pointer; font-size: 18px; line-height: 1;
}
.sidebar-close:hover { color: #fff; }

.sidebar-nav { overflow-y: auto; flex: 1; padding: 8px 0; }

/* 科目アコーディオン */
.subject-item { }
.subject-toggle {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none;
  color: #ccc; font-size: 12px; font-family: inherit; font-weight: 700;
  padding: 8px 14px; cursor: pointer; text-align: left;
  transition: background 0.1s;
}
.subject-toggle:hover { background: rgba(255,255,255,0.05); color: #fff; }
.subject-toggle .arrow { font-size: 10px; transition: transform 0.2s; color: #666; }
.subject-toggle.expanded .arrow { transform: rotate(90deg); }

.chapter-list-nav { display: none; padding: 0 0 4px 0; }
.chapter-list-nav.open { display: block; }
.chapter-link {
  display: block; text-decoration: none;
  color: #999; font-size: 11.5px;
  padding: 5px 14px 5px 26px;
  transition: background 0.1s, color 0.1s;
  border-left: 2px solid transparent;
  margin-left: 12px;
}
.chapter-link:hover { color: #fff; background: rgba(255,255,255,0.04); }
.chapter-link.current { color: #6a9fd8; border-left-color: #6a9fd8; background: rgba(106,159,216,0.08); }
.chapter-link.disabled { color: #555; pointer-events: none; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 199;
  background: rgba(0,0,0,0.4);
}
.sidebar-overlay.show { display: block; }

/* =============================================
   アノテーション共通
   ============================================= */

/* ハイライト */
.st-highlight {
  border-radius: 2px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.st-highlight:hover { opacity: 0.7; }
.st-highlight[data-color="yellow"] { background: rgba(255,230,0,0.45); }
.st-highlight[data-color="red"]    { background: rgba(255,100,100,0.35); }
.st-highlight[data-color="blue"]   { background: rgba(100,160,255,0.35); }
.st-highlight[data-color="green"]  { background: rgba(80,200,120,0.35); }

/* 付箋コンテナ（ノート上に重ねる絶対配置レイヤー） */
#sticky-layer {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* 付箋 */
.st-sticky {
  position: absolute;
  width: 160px;
  min-height: 60px;
  border-radius: 3px;
  padding: 6px 8px;
  font-size: 11px;
  font-family: inherit;
  line-height: 1.5;
  box-shadow: 2px 3px 8px rgba(0,0,0,0.25);
  cursor: move;
  pointer-events: all;
  resize: none;
  border: none;
  outline: none;
}
.st-sticky[data-color="yellow"] { background: #fff9a3; }
.st-sticky[data-color="red"]    { background: #ffd5d5; }
.st-sticky[data-color="blue"]   { background: #d5eaff; }
.st-sticky[data-color="green"]  { background: #d5f5e3; }

.sticky-delete {
  position: absolute;
  top: 2px; right: 3px;
  background: none; border: none;
  color: #999; font-size: 13px;
  cursor: pointer; line-height: 1;
  pointer-events: all;
}
.sticky-delete:hover { color: #c0392b; }

/* 手書きキャンバス */
#drawing-canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9;
  touch-action: none;
}
#drawing-canvas.active { pointer-events: all; cursor: crosshair; }
#drawing-canvas.eraser-active { pointer-events: all; cursor: cell; }

/* 消しゴム範囲選択ボックス */
#erase-rect {
  position: absolute;
  border: 1.5px dashed #c0392b;
  background: rgba(192,57,43,0.08);
  pointer-events: none;
  z-index: 12;
  display: none;
}

/* ノートのラッパーを relative に */
.notebook-wrap {
  position: relative;
}

/* ツール非アクティブ時はノート本文が選択可能 */
body.tool-highlight .nb-inner { cursor: text; user-select: text; }
body.tool-sticky    .nb-inner { cursor: cell; }
body.tool-draw      .nb-inner { cursor: crosshair; user-select: none; }
body.tool-eraser    .nb-inner { cursor: cell; }

/* 消しゴムモード中のハイライト */
body.tool-eraser .st-highlight { outline: 1.5px dashed #c0392b; }
body.tool-eraser .st-sticky    { outline: 1.5px dashed #c0392b; }

/* =============================================
   スマホ対応
   ============================================= */
@media (max-width: 640px) {
  /* ツールバー: ボタンテキストを非表示にしてアイコンのみ */
  .study-toolbar { padding: 4px 6px; gap: 2px; top: 40px; flex-wrap: nowrap; overflow-x: auto; }
  .tool-btn { padding: 5px 6px; font-size: 0; gap: 0; }
  .tool-btn svg { width: 16px; height: 16px; }
  .tool-sep { margin: 0 2px; }
  .color-dot { width: 14px; height: 14px; }
  #tool-clear-draw { font-size: 0; }

  /* ツールバー右側 */
  .toolbar-right { margin-left: auto; }

  /* サイドバー */
  .study-sidebar { width: 270px; left: -270px; }
  .study-sidebar.open { left: 0; }
  .sidebar-tab.shifted { left: 270px; }

  /* ページ本体 */
  .page { margin: 12px auto 32px; padding: 0 10px; }
  .nb-inner { padding: 16px 14px 24px; }

  /* サイドバータブ */
  .sidebar-tab { font-size: 11px; padding: 6px 8px; }

  /* ヘッダーパンくず1行化 */
  .site-header { flex-wrap: nowrap; overflow: hidden; height: auto; min-height: 40px; }
  .site-header a, .site-header .sep, .site-header .header-current { font-size: 10px; white-space: nowrap; }
  .header-left { overflow: hidden; min-width: 0; flex-shrink: 1; }
  .header-auth { flex-shrink: 0; }
}

/* =============================================
   ツールチップポップ（タップ時表示）
   ============================================= */
#tool-tip-pop {
  position: fixed;
  top: 86px;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: rgba(44,36,22,0.95);
  color: #e8d5b0;
  font-size: 12px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid #5a4e40;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 500;
  max-width: 90vw;
  white-space: normal;
  text-align: center;
}
#tool-tip-pop.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =============================================
   フォントサイズ変更ボタン＋ツアーボタン 右下グループ
   ============================================= */
#bottom-ctrl-wrap {
  position: fixed;
  bottom: 20px;
  right: 16px;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
#bottom-ctrl-wrap .tour-btn {
  position: relative;
  bottom: auto;
  right: auto;
}
#bottom-ctrl-wrap #font-size-ctrl {
  position: relative;
  bottom: auto;
  right: auto;
  z-index: auto;
}

#font-size-ctrl {
  position: fixed;
  bottom: 20px;
  right: 16px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(44,36,22,0.7);
  border: 1px solid rgba(90,78,64,0.6);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
}
#font-size-ctrl button {
  background: rgba(255,255,255,0.08);
  border: 1px solid #5a4e40;
  color: #e8d5b0;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: background 0.1s;
  font-family: inherit;
  line-height: 1;
}
#font-size-ctrl button:hover { background: rgba(255,255,255,0.18); }
#font-size-ctrl button:disabled { opacity: 0.3; cursor: default; }
#fs-label {
  font-size: 10px;
  color: #a89880;
  text-align: center;
  white-space: nowrap;
}

@media (max-width: 640px) {
  #bottom-ctrl-wrap {
    bottom: 12px;
    right: 10px;
    gap: 6px;
  }
  #font-size-ctrl {
    bottom: 12px;
    right: 10px;
    padding: 5px 7px;
    gap: 2px;
    border-radius: 10px;
  }
  #font-size-ctrl button {
    width: 28px;
    height: 28px;
    font-size: 14px;
    border-radius: 6px;
  }
  #fs-label { font-size: 9px; }

  /* タイトル行・テーブルはみ出し修正 */
  .page-title-row { flex-wrap: wrap; gap: 4px; }
  .page-title-row h1 { width: 100%; }
  .nb-inner { max-width: 100%; box-sizing: border-box; overflow-x: clip; }
  .chart { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { font-size: 11px; }
}

/* =============================================
   赤シートボタン
   ============================================= */
#red-sheet-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: rgba(44,36,22,0.7);
  border: 1px solid rgba(90,78,64,0.6);
  border-radius: 12px;
  padding: 8px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  cursor: pointer;
  color: #e8d5b0;
  font-family: inherit;
  transition: background 0.15s;
}
#red-sheet-btn:hover { background: rgba(60,20,20,0.8); }
#red-sheet-btn.active { background: rgba(150,20,20,0.85); border-color: rgba(192,57,43,0.8); }
#red-sheet-btn .rs-icon {
  width: 28px; height: 20px;
  background: #c0392b;
  border-radius: 3px;
  opacity: 0.85;
  transition: opacity 0.15s;
}
#red-sheet-btn.active .rs-icon { opacity: 1; }
#red-sheet-btn .rs-label { font-size: 10px; color: #a89880; white-space: nowrap; }
#red-sheet-btn.active .rs-label { color: #ffb0a0; }

/* 赤シートモード: .red テキストを隠す */
.red-sheet-mode .red {
  background: #c0392b !important;
  color: transparent !important;
  border-radius: 2px;
  cursor: pointer;
  user-select: none;
  transition: none;
}
.red-sheet-mode .red.rs-revealed {
  color: #c0392b !important;
  background: rgba(192,57,43,0.12) !important;
}

/* =============================================
   覚えたボタン（h2 横のチップ）
   ============================================= */
.check-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: #fff;
  border: 1.5px solid #bbb;
  color: #bbb;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 8px;
  line-height: 1.5;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  top: -1px;
  margin-left: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  white-space: nowrap;
  vertical-align: middle;
}
.check-btn:hover { border-color: #d97706; color: #d97706; }
.check-btn.checked {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
  box-shadow: 0 1px 4px rgba(217,119,6,0.3);
}
.check-btn .ck-icon { font-size: 11px; line-height: 1; }

/* 科目indexページの進捗マス */
.ch-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
}
.ch-progress-label {
  font-size: 10px;
  color: #7a6e60;
  margin-right: 2px;
  flex-shrink: 0;
}
.ch-sq {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1.5px solid #aaa9a0;
  border-radius: 2px;
  background: transparent;
  flex-shrink: 0;
}
.ch-sq.done {
  background: #d97706;
  border-color: #d97706;
}

/* サイドバー内の進捗マス */
.sidebar-progress {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-left: 4px;
  vertical-align: middle;
}
.sidebar-progress .ch-sq {
  width: 7px;
  height: 7px;
  border-width: 1px;
}

/* サイドバー科目名リンク */
.subject-index-link {
  color: inherit;
  text-decoration: none;
}
.subject-index-link:hover {
  text-decoration: underline;
}

@media print {
  #tool-tip-pop, #font-size-ctrl { display: none; }
}

/* =============================================
   プロダクトツアー
   ============================================= */

/* 「？」ボタン */
.tour-btn {
  position: fixed;
  bottom: 70px;
  right: 16px;
  z-index: 500;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(44,36,22,0.75);
  border: 1.5px solid rgba(90,78,64,0.7);
  color: #e8d5b0;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  backdrop-filter: blur(4px);
  transition: background 0.15s, transform 0.15s;
  font-family: inherit;
  line-height: 1;
}
.tour-btn:hover {
  background: rgba(217,119,6,0.85);
  transform: scale(1.08);
}

/* オーバーレイ */
.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.55);
  pointer-events: all;
}

/* ハイライト対象要素 */
.tour-highlight {
  position: relative;
  z-index: 10001 !important;
  border-radius: 6px;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55), 0 0 0 3px #d97706 !important;
  transition: box-shadow 0.3s;
  pointer-events: none;
}

/* ツールチップ */
.tour-tooltip {
  position: fixed;
  z-index: 10002;
  background: #2c2416;
  color: #faf8f4;
  border: 1px solid #d97706;
  border-radius: 10px;
  padding: 16px 18px 14px;
  max-width: 300px;
  min-width: 220px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.5);
  pointer-events: all;
}
.tour-tooltip-title {
  font-size: 14px;
  font-weight: 700;
  color: #a8d8c8;
  margin-bottom: 8px;
}
.tour-tooltip-text {
  font-size: 12.5px;
  line-height: 1.7;
  color: #e8d5b0;
  margin-bottom: 14px;
}
.tour-tooltip-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.tour-step-num {
  font-size: 11px;
  color: #7a6e60;
  white-space: nowrap;
}
.tour-tooltip-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tour-nav-btn {
  background: rgba(217,119,6,0.25);
  border: 1px solid #d97706;
  color: #a8d8c8;
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
  white-space: nowrap;
}
.tour-nav-btn:hover { background: rgba(217,119,6,0.5); }
.tour-nav-next, .tour-nav-done {
  background: #d97706;
  color: #fff;
}
.tour-nav-next:hover, .tour-nav-done:hover { background: #3a6c5f; }
.tour-close-btn {
  background: none;
  border: none;
  color: #7a6e60;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.12s;
}
.tour-close-btn:hover { color: #faf8f4; }

@media (max-width: 640px) {
  .tour-btn { bottom: 60px; right: 10px; width: 36px; height: 36px; font-size: 16px; }
  .tour-tooltip { max-width: 85vw; min-width: 0; padding: 14px 14px 12px; }
}

/* =============================================
   科目indexページ 印刷ボタン（画面表示用）
   ============================================= */
.title-row-with-print {
  position: relative !important;
  padding-right: 110px !important;
}
.index-print-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  margin: 0;
  padding: 5px 12px;
  background: rgba(217,119,6,0.08);
  border: 1.5px solid var(--accent, #d97706);
  border-radius: 6px;
  color: var(--accent, #d97706);
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.index-print-btn:hover {
  background: var(--accent, #d97706);
  color: #fff;
}
.index-print-btn svg { fill: currentColor; flex-shrink: 0; }

/* =============================================
   過去問ボタン（h2内）
   ============================================= */
.nq-btn {
  display: inline-flex;
  align-items: stretch;
  background: #fff;
  border: 1.5px solid var(--accent, #d97706);
  color: var(--accent, #d97706);
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  margin-left: 12px;
  vertical-align: middle;
  overflow: hidden;
  white-space: nowrap;
  transition: all 0.15s ease;
  font-family: inherit;
  line-height: 1.5;
  box-shadow: 0 1px 3px rgba(217,119,6,0.15);
  position: relative;
  top: -1px;
}
.nq-btn .nq-label {
  padding: 1px 4px 1px 11px;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
}
.nq-btn .nq-count {
  background: var(--accent, #d97706);
  color: #fff;
  padding: 1px 11px;
  font-weight: 800;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  letter-spacing: 0;
}
.nq-btn:hover {
  box-shadow: 0 3px 8px rgba(217,119,6,0.3);
  transform: translateY(-1px);
}
.nq-btn:hover .nq-count {
  background: #3a6a5e;
}

/* ポップアップオーバーレイ */
#nq-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.nq-modal {
  background: #fff;
  border-radius: 10px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  overflow: hidden;
}
.nq-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}
.nq-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a1a1a;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nq-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #888;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
}
.nq-close:hover { background: #eee; }
.nq-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.nq-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nq-list li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 18px;
  border-bottom: 1px solid #f5f5f5;
  font-size: 13px;
}
.nq-list li:last-child { border-bottom: none; }
.nq-qno {
  font-weight: 600;
  color: #1a5fa8;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 12px;
}
.nq-qtext {
  color: #555;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nq-foot {
  padding: 12px 18px;
  border-top: 1px solid #eee;
  background: #fafafa;
  text-align: center;
}
.nq-quiz-btn {
  display: inline-block;
  background: #2563eb;
  color: #fff;
  border-radius: 6px;
  padding: 9px 24px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.12s;
}
.nq-quiz-btn:hover { background: #1d4ed8; }

@media print {
  .nq-btn, #nq-overlay { display: none !important; }
}

/* =============================================
   印刷スタイル
   ============================================= */
@media print {
  /* UI要素を非表示 */
  .study-toolbar,
  .site-header,
  #study-sidebar,
  .study-sidebar,
  .sidebar-overlay,
  .sidebar-tab,
  .tour-btn,
  .tour-overlay,
  .tour-tooltip,
  .index-print-btn,
  .nav-row,
  .quiz-btn,
  .blur-overlay,
  .blur-modal,
  #tool-tip-pop,
  #font-size-ctrl,
  .st-sb,
  .st-sb-overlay,
  .st-menu-btn,
  .st-bottom-nav { display: none !important; }

  /* body余白リセット */
  body { margin: 0 !important; padding: 0 !important; background: #fff !important; }

  /* ノート本文をA4幅に合わせる */
  .notebook-wrap, .notebook, .note-page, .container { max-width: 100% !important; margin: 0 !important; padding: 0 !important; }
  .note-content { padding: 16px 24px !important; }

  /* 表・テキストを印刷向けに調整 */
  table { page-break-inside: avoid; }
  h2, h3 { page-break-after: avoid; }
  .sec { page-break-inside: avoid; }

  /* 印刷フッター */
  body::after {
    content: "STカコモン  |  st-toolbox.com/kakomon/study/";
    display: block;
    text-align: center;
    font-size: 10px;
    color: #999;
    border-top: 1px solid #ddd;
    padding-top: 6px;
    margin-top: 24px;
  }
}


/* =============================================
   ST国試ノート 本文タイポグラフィ底上げ
   各ページのインライン<style>(body/h2/h3...) を .notebook スコープの
   高い特異度で上書きして可読性を上げる。
   - .notebook(0,1,0) は body(0,0,1) より近い祖先のため継承で本文が15pxになる
   - .notebook h2(0,1,1) は インライン h2(0,0,1) に勝つ
   - .notebook .point 等(0,2,0) は インライン .point(0,1,0) に勝つ
   - .meta は インライン .page-title-row .meta(0,2,0) と同特異度のため
     .notebook .page-title-row .meta(0,3,0) で確実に勝たせる
   study-tools.css 1ファイルで全ノート(index/各章/bunseki)に一括適用。
   ============================================= */
.notebook { font-size: 15px; }
.notebook h2 { font-size: 16px; }
.notebook h3 { font-size: 14.5px; }
.notebook h4 { font-size: 13.5px; }
.notebook .intro { font-size: 14px; }
.notebook .point,
.notebook .warn,
.notebook .rx { font-size: 14px; }
.notebook table { font-size: 12.5px; }

/* 低コントラスト&極小の補助テキスト対策（WCAG AA: 11px/#7a6e60→12px/#6a5d4d） */
.notebook .meta,
.notebook .page-title-row .meta,
.notebook .author-note { font-size: 12px; color: #6a5d4d; }

/* 型スケール漏れ補正（インライン定義より高特異度で確実に勝つ。色・weightは据置きサイズのみ） */
.notebook .box-title { font-size: 14px; }
.notebook .ch-meta { font-size: 12px; }
.notebook .page-title-row .sub { font-size: 12.5px; }
.notebook .source { font-size: 12.5px; }

