/* AI小学校：スマホ対応（キャンバスのインラインスタイルを 767px 以下で上書き） */
span.robot svg { width: 100%; height: 100%; display: block; }
.v-sp { display: none; }
img { max-width: 100%; }

@media (max-width: 767px) {
  .v-pc { display: none; }
  .v-sp { display: block; }

  /* 共通：ヘッダー */
  header > div { padding: 10px 16px !important; gap: 10px !important; }
  header > div > a span[style*="font-size: 26px"] { font-size: 21px !important; }
  header nav { gap: 8px 14px !important; font-size: 13px !important; }
  header nav a[style*="background: #cf4a3a"] { height: 40px !important; padding: 0 16px !important; }

  /* 共通：セクションの余白 */
  section { padding-left: 14px !important; padding-right: 14px !important; }
  section[style*="padding: 48px"], section[style*="padding: 44px"], section[style*="padding: 40px"] { padding-top: 30px !important; padding-bottom: 32px !important; }
  footer > div { padding: 24px 16px !important; }

  /* 黒板の見出し */
  [style*="border: 12px solid #8b5e3c"] { border-width: 8px !important; padding: 18px 16px !important; gap: 12px !important; }
  [style*="border: 10px solid #8b5e3c"] { border-width: 7px !important; padding: 16px !important; }
  h1[style*="font-size: 54px"], h1[style*="font-size: 58px"] { font-size: 36px !important; }
  [style*="border: 12px solid #8b5e3c"] p[style*="font-size: 20px"] { font-size: 16px !important; }
  span.robot[style*="width: 150px"], span.robot[style*="width: 140px"] { width: 92px !important; height: 98px !important; }

  /* 文字サイズ */
  [style*="font-size: 34px"], [style*="font-size: 32px"] { font-size: 23px !important; }
  [style*="font-size: 30px"], [style*="font-size: 28px"] { font-size: 22px !important; }
  [style*="font-size: 21px"], [style*="font-size: 22px"] { font-size: 18px !important; }

  /* グリッド */
  [style*="grid-template-columns: repeat(3"] { grid-template-columns: minmax(0, 1fr) !important; }
  [style*="grid-template-columns: repeat(4"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  /* 2カラム → 1カラム */
  [style*="flex: 1 1 620px"], [style*="flex: 1 1 560px"], [style*="flex: 1 1 380px"], [style*="flex: 1 1 340px"], [style*="flex: 1 1 320px"] { flex-basis: 100% !important; min-width: 0 !important; }
  [style*="height: 460px"], [style*="height: 420px"] { height: 320px !important; }
  input[type="search"] { min-width: 0; width: 100%; }

  /* ボタン */
  a[style*="height: 64px"], a[style*="height: 60px"], a[style*="height: 58px"] { height: 56px !important; padding: 0 28px !important; }

  /* ノート */
  [style*="padding: 22px 28px 22px 56px"], [style*="padding: 20px 26px 20px 52px"] { padding: 16px 16px 16px 44px !important; font-size: 15px !important; }
}
