/* ==========================================================
   SJ式 - スタイル
   スマホ優先。パソコンでは中央に寄せて読みやすくします。
   ========================================================== */

:root {
  /* ---- メインカラー：ミントグリーン ----
     淡いミントは白文字が読めなくなるため、
     面と文字には少し濃いミント、背景には淡いミントを使い分けます */
  --mint: #0a8264;        /* 主役。上部バー・ボタン・進捗バー */
  --mint-deep: #076b52;   /* 淡い面に乗せる文字色 */
  --mint-soft: #2bb891;   /* グラデーションの相方 */
  --mint-pale: #e4f6f0;   /* 背景の色づけ */

  /* ---- 差し色 ---- */
  --amber: #efa31d;       /* 達成・継続・バッジ（がんばりを示す色） */
  --amber-deep: #8a5c05;
  --amber-pale: #fff6e4;
  --coral: #e2564d;       /* 不正解・注意・赤シート */
  --coral-deep: #b23a33;  /* 淡い面に乗せる文字色 */
  --coral-pale: #fdeceb;
  --indigo: #4a63d0;      /* 例文などの参考情報 */
  --indigo-pale: #eef1fd;

  /* ---- 無彩色（わずかに緑を含ませて全体をなじませる） ---- */
  --ink: #23302c;
  --ink-sub: #5e6e68;
  --line: #dfe8e4;
  --bg: #f2f8f6;
  --card: #ffffff;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(16, 90, 70, .08);
}

* { box-sizing: border-box; }

/* hidden 属性を付けた要素は必ず隠す
   （.btn などに display を指定しているため、これが無いと消えない） */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

button, input, textarea { font-family: inherit; font-size: inherit; }

/* ---------- 上部バー ---------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 54px;
  padding: 0 12px;
  /* 切り欠きのある端末で、上端に食いこまないようにします（2026-08-21） */
  padding-top: env(safe-area-inset-top, 0px);
  box-sizing: content-box;
  background: var(--mint);
  color: #fff;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .12);
}
.appbar__title {
  flex: 1;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.appbar__back {
  /*
   * ★ 指で押す所は44px以上にします（2026-08-23）。
   *   丸の見た目は34pxのままにしたいので、
   *   透明の余白で当たり判定だけを広げています。
   */
  width: 34px;
  height: 34px;
  min-width: 44px;
  min-height: 44px;
  background-clip: content-box;
  padding: 5px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.appbar__mypage {
  border: 0;
  border-radius: 999px;
  /*
   * ★ 指で押す所は44px以上にします（2026-08-23）。
   *   34pxしかなく、スマートフォンで押しづらい状態でした。
   *   見た目の帯は変えたくないので、上下の余白だけを広げています。
   */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

/* ---------- 画面共通 ---------- */
#main {
  max-width: 560px;
  margin: 0 auto;
  /*
   * 下の余白（2026-08-21 調整）。
   * viewport-fit=cover を指定しているため、指定しないと画面の下端まで
   * 中身が入りこみ、iPhoneのホームバーやSafariの下のバーに隠れます。
   * ノートパソコンでも、最後のボタンが見切れて気づかれないことがあったため、
   * 余白そのものも 60px から広げています。
   */
  padding: 16px 16px calc(96px + env(safe-area-inset-bottom, 0px));
  padding-left: calc(16px + env(safe-area-inset-left, 0px));
  padding-right: calc(16px + env(safe-area-inset-right, 0px));
}
.screen[hidden] { display: none; }

.section-title {
  margin: 22px 4px 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-sub);
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.card__title { margin: 0 0 10px; font-size: 15px; }

.note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-sub);
}

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform .06s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn--primary { background: var(--mint); color: #fff; }
.btn--primary:hover { filter: brightness(1.07); }
.btn--ghost { background: #fff; color: var(--mint); border: 1.5px solid var(--line); }
.btn--danger { background: var(--coral-pale); color: var(--coral-deep); }

.text-link {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-sub);
  font-size: 13px;
  cursor: pointer;
}

/* ---------- ホーム ---------- */
/* ホームの見出し部分は「ミントらしさ」を出したいので淡いミントにし、
   その代わり文字は濃い色にして読みやすさを確保します */
.hero {
  background: linear-gradient(135deg, #7fe0c2, #3fcba4);
  border-radius: 18px;
  padding: 18px;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.hero__hello { margin: 0 0 14px; font-size: 15px; font-weight: 700; }
.hero__stats { display: flex; }
.stat {
  flex: 1;
  text-align: center;
  border-right: 1px solid rgba(7, 107, 82, .22);
}
.stat:last-child { border-right: 0; }
.stat__num { display: block; font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat__label { font-size: 11px; font-weight: 700; color: var(--ink); opacity: .78; }

.review-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}
.review-cta__icon { font-size: 24px; }
.review-cta__body { flex: 1; }
.review-cta__title { display: block; font-size: 15px; font-weight: 700; }
.review-cta__sub { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-sub); }
.review-cta__arrow { color: var(--ink-sub); font-size: 22px; }
.resume-cta { background: var(--mint-pale); }
.resume-cta .review-cta__sub { color: var(--mint-deep); font-weight: 700; }
/* 補助のリンクも、指で押せる高さを確保します（2026-08-23） */
.text-link--slim {
  margin-top: 8px; padding: 8px; font-size: 12px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.review-cta.is-active { background: var(--amber-pale); }
.review-cta.is-active .review-cta__sub { color: var(--amber-deep); font-weight: 700; }

.subject-list { display: grid; gap: 10px; }
.subject-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}
.subject-card__icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--mint-pale);
  font-size: 22px;
}
.subject-card__body { flex: 1; }
.subject-card__name { display: block; font-size: 16px; font-weight: 700; }
.subject-card__meta { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-sub); }
.subject-card__arrow { color: var(--ink-sub); font-size: 22px; }

/* ---------- セット一覧 ---------- */
.level-block { margin-bottom: 18px; }
.level-block__name {
  margin: 0 4px 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-sub);
}
.set-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.set-card {
  position: relative;
  padding: 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}
.set-card__name { display: block; font-size: 15px; font-weight: 700; }
.set-card__meta { display: block; margin: 4px 0 8px; font-size: 11px; color: var(--ink-sub); }
.set-card__bar {
  /* span のままだと高さが効かず、大きな四角になってしまうため block にします */
  display: block;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.set-card__bar > i {
  display: block;
  height: 100%;
  background: var(--mint);
}
.set-card__done {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 14px;
}

/* ---------- モード選択 ---------- */
.mode-list { display: grid; gap: 12px; }
.mode-card {
  display: grid;
  grid-template-columns: 46px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  padding: 18px;
  border: 0;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  cursor: pointer;
}
.mode-card__icon { grid-row: 1 / 3; align-self: center; font-size: 28px; }
.mode-card__title { font-size: 16px; font-weight: 700; }
.mode-card__sub { font-size: 12px; color: var(--ink-sub); }

/* ---------- 進捗バー・カウンタ ---------- */
.progress {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  width: 0;
  background: var(--mint);
  transition: width .25s;
}
.counter { margin: 8px 0 0; font-size: 12px; color: var(--ink-sub); }

.quiz-head { display: flex; align-items: center; justify-content: space-between; }
.timer {
  margin: 8px 0 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--mint);
  font-variant-numeric: tabular-nums;
}
.timer.is-hurry { color: var(--coral); animation: pulse .6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- フラッシュカード ---------- */
.flashcard {
  perspective: 1000px;
  margin: 18px 0;
  cursor: pointer;
}
.flashcard__inner {
  position: relative;
  width: 100%;
  min-height: 240px;
  transition: transform .45s;
  transform-style: preserve-3d;
}
.flashcard.is-flipped .flashcard__inner { transform: rotateY(180deg); }
.flashcard__face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 22px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flashcard__face--back { transform: rotateY(180deg); background: var(--mint-pale); }
.flashcard__text { margin: 0; font-size: 30px; font-weight: 800; text-align: center; line-height: 1.35; }
.flashcard__text--back { font-size: 24px; color: var(--mint-deep); }
.flashcard__hint { margin: 0; font-size: 12px; color: var(--ink-sub); }
.flashcard__note {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-sub);
  text-align: center;
}

.play-actions { display: flex; gap: 10px; }
.play-actions .btn { flex: 1; }

/* ---------- 4択 ---------- */
.question {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
  margin: 16px 0;
  padding: 20px 16px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.question__text {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  line-height: 1.35;
  word-break: break-word;
}
.speak-btn {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--mint-pale);
  font-size: 19px;
  cursor: pointer;
}
.speak-btn:active { transform: scale(.92); }

.choices { display: grid; gap: 10px; }
.choice {
  min-height: 54px;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background .12s;
}
.choice:hover:not(:disabled) { background: var(--mint-pale); }
.choice.is-correct { background: var(--mint-pale); border-color: var(--mint); color: var(--mint-deep); }
.choice.is-wrong { background: var(--coral-pale); border-color: var(--coral); color: #a52d2d; }
.choice:disabled { cursor: default; }

/* ---------- ディクテーション（書き取り） ---------- */
.dict-play {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 16px 0 14px;
}
.dict-play__btn {
  width: 76px;
  height: 76px;
  border: 0;
  border-radius: 50%;
  background: var(--mint);
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.dict-play__btn:active { transform: scale(.94); }
.dict-play__note { margin: 0; font-size: 12px; color: var(--ink-sub); }

.dict-sentence {
  padding: 18px 16px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 18px;
  line-height: 2.4;
  word-break: break-word;
}
.dict-sentence--whole { line-height: 1.8; }
.dict-text { white-space: pre-wrap; }

.dict-blank {
  min-width: 5ch;
  padding: 4px 8px;
  border: 0;
  border-bottom: 2px solid var(--mint);
  border-radius: 6px 6px 0 0;
  background: var(--mint-pale);
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}
.dict-blank:focus { outline: 2px solid var(--mint); outline-offset: 1px; }
.dict-blank--wide { width: 100%; text-align: left; }
.dict-blank.is-ok { background: var(--mint-pale); border-bottom-color: var(--mint); color: var(--mint-deep); }
.dict-blank.is-ng { background: var(--coral-pale); border-bottom-color: var(--coral); color: var(--coral-deep); }
.dict-blank:disabled { opacity: 1; }

.dict-correct {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--mint);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}
.dict-hint { margin: 10px 0 12px; font-size: 12px; color: var(--ink-sub); text-align: center; }
#dictCheck { width: 100%; }

/* ---------- タイピング ---------- */
.type-question {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
  margin: 16px 0;
  padding: 20px 16px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.type-question__meaning {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  line-height: 1.35;
}
.type-question__hint {
  margin: 0;
  font-size: 13px;
  color: var(--ink-sub);
  letter-spacing: .12em;
}

.type-echo {
  min-height: 40px;
  margin-bottom: 10px;
  padding: 6px 4px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .06em;
  text-align: center;
  font-family: "SF Mono", "Consolas", monospace;
}
.type-echo .ok { color: var(--mint); }
.type-echo .ng { color: var(--coral); text-decoration: underline wavy var(--coral); }
.type-echo .rest { color: var(--line); }

.type-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 20px;
  letter-spacing: .04em;
  text-align: center;
}
.type-input:focus { outline: none; border-color: var(--mint); }
.type-input:disabled { background: #f2f4f7; color: var(--ink-sub); }

.feedback {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.feedback__mark { margin: 0 0 6px; font-size: 17px; font-weight: 800; }
.feedback__mark.ok { color: var(--mint); }
.feedback__mark.ng { color: var(--coral); }
.feedback__answer { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.feedback__exp { margin: 0; font-size: 13px; line-height: 1.8; color: var(--ink-sub); }
.auto-pause {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  border: 1.5px solid var(--amber);
  border-radius: 999px;
  background: var(--amber-pale);
  color: var(--amber-deep);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.auto-pause[hidden] { display: none !important; }

.feedback__actions { display: flex; gap: 10px; margin-top: 14px; }
.feedback__actions .btn { flex: 1; }

/* ---------- 結果 ---------- */
.result {
  margin-top: 30px;
  padding: 28px 20px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}
.result__emoji { margin: 0; font-size: 52px; }
.result__score { margin: 10px 0 6px; font-size: 22px; font-weight: 800; }
.result__note { margin: 0 0 20px; font-size: 13px; line-height: 1.8; color: var(--ink-sub); }
.result__actions { display: grid; gap: 10px; }

/* ---------- マイページ ---------- */
.field { display: block; margin-bottom: 12px; }
.field__label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--ink-sub); }
/*
 * 入力欄は幅いっぱいに広げます。
 * textarea と select は既定の幅のままだと、隣の入力欄より
 * ずっと狭く出て、そろって見えません（2026-08-14 修正）。
 */
.field input, .field textarea, .field select, #csvInput {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
#csvInput { line-height: 1.7; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, #csvInput:focus { outline: 2px solid var(--mint); outline-offset: 1px; }

.mypage-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mypage-table th, .mypage-table td {
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.mypage-table th { color: var(--ink-sub); font-weight: 600; }
.mypage-table td:last-child, .mypage-table th:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- トースト ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(12px);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(34, 39, 47, .92);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 50;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- ストリーク・今日の目標 ---------- */
.hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}
.hero__hello { margin: 0; font-size: 15px; font-weight: 700; }
.streak {
  margin: 0;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .65);
  color: var(--mint-deep);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.streak.is-off { opacity: .6; }

.goal {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.goal__head { display: flex; align-items: baseline; justify-content: space-between; }
.goal__title { font-size: 14px; font-weight: 700; }
.goal__count { font-size: 13px; color: var(--ink-sub); }
.goal__count b { font-size: 18px; color: var(--ink); }
.goal__bar {
  height: 10px;
  margin: 10px 0 8px;
  border-radius: 5px;
  background: var(--line);
  overflow: hidden;
}
.goal__bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 5px;
  /* 目標の達成度は「がんばり」の色（アンバー）で、進捗バーと区別します */
  background: linear-gradient(90deg, var(--amber), #ffc555);
  transition: width .4s;
}
.goal__msg { margin: 0; font-size: 12px; color: var(--ink-sub); }
.goal__msg.is-done { color: var(--amber-deep); font-weight: 700; }

/* ---------- ホーム下部のリンク ---------- */
.quick-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
.quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px;
  border: 0;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 22px;
  cursor: pointer;
}
.quick-link span { font-size: 12px; font-weight: 700; color: var(--ink); }

/* ---------- 出題の向き・音声速度などの切り替え ---------- */
.segmented {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.segmented__label { font-size: 13px; font-weight: 700; color: var(--ink-sub); }
/*
 * ★ 折り返すようにしました（2026-08-23）。
 *   ごほうびスタンプの色は7個あり、スマートフォンでは
 *   1行に収まらず、画面が横に120pxはみ出していました。
 */
.segmented__btns {
  display: flex; flex-wrap: wrap; gap: 2px;
  border-radius: 18px; background: var(--bg); padding: 3px;
}
.segmented__btns button {
  border: 0;
  border-radius: 999px;
  /* 指で押す所として44pxを確保します（2026-08-23） */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  background: transparent;
  color: var(--ink-sub);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.segmented__btns button.is-on { background: var(--mint); color: #fff; }

/*
 * チェックの行。押す所はラベル全体ですが、
 * 高さが26pxしかなく、指では押しづらい状態でした（2026-08-23）。
 */
.switch {
  display: flex; align-items: center; gap: 10px;
  min-height: 44px;
  font-size: 13px; cursor: pointer;
}
.switch input { width: 20px; height: 20px; accent-color: var(--mint); }

/* ---------- 赤シート ---------- */
.masked { position: relative; display: inline-block; }
.masked__sheet {
  position: absolute;
  inset: -6px -10px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--coral);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.masked__sheet[hidden] { display: none !important; }

/* ---------- 例文 ---------- */
.example {
  margin: 10px 0 0;
  padding: 10px 12px;
  /* 参考情報なので、ミントとは別系統の色でそっと差をつけます */
  border-left: 3px solid var(--indigo);
  border-radius: 0 8px 8px 0;
  background: var(--indigo-pale);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink);
}
.example[hidden] { display: none !important; }

/* ---------- カードの仕分け ---------- */
.swipe-actions { display: flex; gap: 10px; margin-top: 10px; }
.swipe-actions .btn { flex: 1; }
.btn--know-yes { background: var(--mint-pale); color: var(--mint-deep); }
.btn--know-no { background: var(--coral-pale); color: var(--coral-deep); }
.swipe-hint { margin: 10px 0 0; font-size: 11px; text-align: center; color: var(--ink-sub); }
.flashcard.is-dragging .flashcard__inner { transition: none; }

/* ---------- スキップ ---------- */
.quiz-head__right { display: flex; align-items: center; gap: 12px; }
/* 漢字の書き順 */
.stroke-view {
  position: relative;
  width: 100%;
  max-width: 260px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
/* 十字の下じき（字のバランスを見やすくするため） */
.stroke-view__grid {
  position: absolute; inset: 0;
  background:
    linear-gradient(var(--line), var(--line)) center / 100% 1px no-repeat,
    linear-gradient(var(--line), var(--line)) center / 1px 100% no-repeat;
  opacity: .7;
}
.stroke-view__svg { position: absolute; inset: 6%; }
.stroke-view__svg svg { width: 100%; height: 100%; }
.stroke-view__svg path { stroke: var(--ink); stroke-width: 4; }
.stroke-count {
  margin: 12px 0 0; text-align: center;
  font-size: 15px; font-weight: 700; color: var(--ink-sub);
}
#screen-stroke .io-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
#screen-stroke .io-actions .btn { flex: 1; min-width: 110px; }
#strokeInput { font-size: 22px; text-align: center; }

/* 出題範囲を「第○問〜第○問」で指定する行 */
.range-row {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--card);
}
.range-row__label { display: block; font-size: 12px; color: var(--ink-sub); }
.range-row__line {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: 8px 0 10px; font-size: 14px;
}
.range-row__num {
  width: 5em; padding: 6px 8px;
  border: 1.5px solid var(--line); border-radius: 8px;
  font-size: 15px; text-align: right;
}
.range-row__go { width: 100%; min-height: 42px; font-size: 14px; }

/* 一時停止ボタンと、止めている間の覆い */
.pause-btn {
  margin-top: 8px; margin-left: 8px;
  padding: 6px 12px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: #fff; color: var(--ink-sub);
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.pause-btn:hover { border-color: var(--mint); color: var(--mint); }
.pause-veil {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  /* 止めている間に問題を読み進められないよう、透けないようにします */
  background: var(--mint);
}
.pause-veil__box { text-align: center; color: #fff; }
.pause-veil__title { margin: 0 0 6px; font-size: 26px; font-weight: 700; color: #fff; }
.pause-veil__note { margin: 0 0 18px; font-size: 14px; color: #fff; opacity: .9; }
.pause-veil .btn--primary {
  min-width: 200px;
  background: #fff;
  color: var(--mint);
  border-color: #fff;
}

/* 前の問題の見返し（記録は変わりません） */
.review-pane {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(15, 40, 33, .45);
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
}
.review-pane__box {
  width: 100%; max-width: 520px; max-height: 82vh; overflow-y: auto;
  padding: 18px; border-radius: 16px; background: #fff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .22);
}
.review-pane__head { display: flex; align-items: center; margin-bottom: 8px; }
.review-pane__pos { margin: 0; font-size: 13px; color: var(--ink-sub); }
.review-pane__close {
  margin-left: auto; width: 32px; height: 32px;
  border: none; border-radius: 50%; background: var(--bg);
  font-size: 16px; color: var(--ink-sub); cursor: pointer;
}
.review-pane__mark { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.review-pane__mark.ok { color: var(--mint); }
.review-pane__mark.ng { color: var(--coral-deep); }
.review-pane .btn:disabled { opacity: .4; cursor: default; }
.review-pane #reviewBack { width: 100%; margin-top: 12px; }

/* 解説を表示しておく秒数（正答・誤答・時間切れ・わからない） */
.waits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; }
.waits__item {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink-sub);
}
.waits__item input {
  width: 4.5em; margin-left: auto; padding: 6px 8px;
  border: 1.5px solid var(--line); border-radius: 8px;
  font-size: 15px; text-align: right;
}
@media (max-width: 380px) { .waits { grid-template-columns: 1fr; } }

/* 「わからない」ボタン … 押すと答えと解説がすぐ出ます */
.dontknow {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-sub);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.dontknow:hover { border-color: var(--mint); color: var(--mint); }

.skip-btn {
  margin-top: 8px;
  padding: 6px 12px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-sub);
  font-size: 12px;
  cursor: pointer;
}

/* ---------- 結果の追加表示 ---------- */
.result__time { margin: 0 0 8px; font-size: 13px; color: var(--ink-sub); }
.badge-earned {
  margin: 0 0 18px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--amber-pale);
  font-size: 13px;
  font-weight: 700;
  color: var(--amber-deep);
}

/* ---------- 学習グラフ ---------- */
.graph {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 130px;
  padding-top: 8px;
}
.graph__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.graph__bar {
  width: 100%;
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--mint);
}
.graph__bar.is-zero { background: var(--line); }
.graph__bar.is-goal { background: var(--amber); }
.graph__day { font-size: 9px; color: var(--ink-sub); }
.graph__val { font-size: 9px; color: var(--ink-sub); }

/* ---------- バッジ ---------- */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.badge {
  padding: 12px 6px;
  border-radius: 12px;
  background: var(--bg);
  text-align: center;
}
.badge.is-got { background: var(--amber-pale); }
.badge__icon { display: block; font-size: 24px; filter: grayscale(1); opacity: .35; }
.badge.is-got .badge__icon { filter: none; opacity: 1; }
.badge__name { display: block; margin-top: 4px; font-size: 10px; font-weight: 700; line-height: 1.4; }
.badge__cond { display: block; font-size: 9px; color: var(--ink-sub); }

/* ---------- 苦手リスト・検索結果 ---------- */
.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.item-row:last-child { border-bottom: 0; }
.item-row__body { flex: 1; min-width: 0; }
.item-row__front { display: block; font-size: 15px; font-weight: 700; }
.item-row__back { display: block; font-size: 12px; color: var(--ink-sub); }
.item-row__meta { display: block; margin-top: 2px; font-size: 11px; color: var(--coral); font-weight: 700; }
.item-row__ex { display: block; margin-top: 4px; font-size: 11px; color: var(--ink-sub); }
.item-row .speak-btn { width: 36px; height: 36px; font-size: 16px; }
#weakStart { width: 100%; margin-top: 14px; }

.search-input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
}
.search-input:focus { outline: none; border-color: var(--mint); }

/* ---------- ごほうびスタンプの通算（スタンプカードより先に出します） ---------- */
.reward-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.reward-total {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.reward-total__icon { display: block; font-size: 18px; line-height: 1; }
.reward-total__name { display: block; font-size: 13px; color: var(--ink-sub); }
.reward-total__num {
  display: block;
  font-size: 17px;
  font-weight: 700;
  color: var(--mint-deep);
}

/* ---------- 出席スタンプカード ---------- */
.stamp-cta .review-cta__title b { color: var(--mint-deep); }
.stamp-cta.is-active { background: var(--mint-pale); }
.stamp-cta.is-active .review-cta__sub { color: var(--mint-deep); font-weight: 700; }

.stamp-head { display: flex; align-items: baseline; justify-content: space-between; }
.stamp-no { font-size: 12px; font-weight: 400; color: var(--ink-sub); }
.stamp-count { font-size: 13px; font-weight: 700; color: var(--mint-deep); }

.stamp-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 12px 0;
}
.stamp-cell {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 24px;
  line-height: 1;
}
.stamp-cell.is-filled {
  border-style: solid;
  border-color: var(--mint);
  background: var(--mint-pale);
  animation: pop .3s;
}
@keyframes pop { from { transform: scale(.6); } to { transform: scale(1); } }

.stamp-today {
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: var(--ink-sub);
}
.stamp-today.is-in { background: var(--mint-pale); color: var(--mint-deep); }
.stamp-today.is-done { background: var(--amber-pale); color: var(--amber-deep); }
.stamp-mins { font-size: 13px; font-weight: 700; color: var(--mint-deep); white-space: nowrap; }

/* ---------- カメラ ---------- */
.scan-area { margin-top: 14px; }
.scan-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 340px;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}
.scan-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-guide {
  position: absolute;
  inset: 18%;
  border: 3px solid rgba(255, 255, 255, .85);
  border-radius: 12px;
}
.scan-area .btn { width: 100%; margin-top: 10px; }

.scan-result {
  margin-top: 14px;
  padding: 14px;
  border-radius: var(--radius);
  text-align: center;
}
.scan-result.is-ok { background: var(--mint-pale); }
.scan-result.is-ng { background: var(--coral-pale); }
.scan-result__title { margin: 0 0 4px; font-size: 16px; font-weight: 800; }
.scan-result.is-ok .scan-result__title { color: var(--mint-deep); }
.scan-result.is-ng .scan-result__title { color: var(--coral-deep); }
.scan-result__body { margin: 0; font-size: 13px; line-height: 1.7; }

/*
 * 「ごほうびのQRも、このボタンで読める」というご案内（2026-08-22 追加）。
 * ボタンの文言が「（入室）」なので、ごほうび用は別の場所にあると
 * 思われてしまいました。ボタンのすぐ下に、目に入る形で置いています。
 */
.scan-note {
  margin-top: 8px;
  text-align: center;
}

/* ---------- 拠点用QRコード ---------- */
.venue-sheet {
  padding: 24px 18px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}
.venue-sheet__title { margin: 0 0 16px; font-size: 18px; }
.venue-qr { max-width: 260px; margin: 0 auto; }
.venue-qr svg { display: block; width: 100%; height: auto; }
.venue-sheet__note { margin: 16px 0 4px; font-size: 15px; font-weight: 700; }
.venue-sheet__code { margin: 0; font-size: 11px; color: var(--ink-sub); word-break: break-all; }

/* ---------- 記録の持ち運び ---------- */
.io-actions { display: flex; gap: 10px; }
.io-actions .btn { flex: 1; }

/* ---------- 問題の管理 ---------- */
.manage-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.manage-head .card__title { margin: 0; }
.mini-btn {
  flex-shrink: 0;
  /* 指で押す所として44pxを確保します（2026-08-23） */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-sub);
  font-size: 12px;
  cursor: pointer;
}
.mini-btn--danger { color: var(--coral-deep); border-color: var(--coral-pale); background: var(--coral-pale); }

/* ---------- 選択肢の番号（キーボード操作用） ---------- */
.choice__no {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 10px;
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink-sub);
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}
.choice.is-correct .choice__no { background: var(--mint); color: #fff; }
.choice.is-wrong .choice__no { background: var(--coral); color: #fff; }

.io-actions--col { flex-direction: column; }
.quick-link--wide { grid-column: 1 / -1; flex-direction: row; gap: 10px; }

/* ---------- 今日のまとめ ---------- */
.sum { padding: 22px 18px; }
.sum__title { margin: 0 0 4px; font-size: 22px; }
.sum__meta { margin: 0 0 18px; font-size: 13px; color: var(--ink-sub); }
.sum__h {
  margin: 20px 0 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--mint-pale);
  font-size: 14px;
  color: var(--mint-deep);
}
.sum__big { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.8; }
.sum__sub { margin: 8px 0 0; font-size: 13px; color: var(--ink-sub); }
.sum__sub b { color: var(--ink); font-size: 15px; }
.sum__none { margin: 0; font-size: 13px; color: var(--ink-sub); }
.sum__warn { color: var(--coral-deep); }
.sum__grid { display: flex; gap: 10px; text-align: center; }
.sum__grid > div {
  flex: 1;
  padding: 12px 6px;
  border-radius: 12px;
  background: var(--mint-pale);
}
.sum__num { display: block; font-size: 24px; font-weight: 800; color: var(--mint-deep); }
.sum__label { font-size: 11px; color: var(--ink-sub); }
.sum__list { margin: 0; padding-left: 22px; font-size: 14px; line-height: 2; }
.sum__muted { color: var(--ink-sub); font-size: 12px; }
.sum__foot {
  margin: 22px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 11px;
  color: var(--ink-sub);
}

/* ---------- 紙のテスト ---------- */
select {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.sheet { background: #fff; border-radius: var(--radius); }
.sheet:empty { display: none; }
.sheet__head { padding: 18px 18px 0; }
.sheet__head h1 { margin: 0 0 8px; font-size: 20px; }
.sheet__head p { margin: 0 0 12px; font-size: 13px; }
.sheet__blank { display: inline-block; width: 140px; border-bottom: 1px solid var(--ink); }
.sheet__blank--s { width: 60px; }
.sheet__list { margin: 0; padding: 0 18px 18px 34px; }
.sheet__list > li { margin-bottom: 14px; page-break-inside: avoid; }
.sheet__q { margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.sheet__choices { margin: 0; padding-left: 20px; list-style: upper-alpha; }
.sheet__choices li { font-size: 13px; line-height: 1.9; }
.sheet__line { margin: 0; height: 26px; border-bottom: 1px solid var(--line); }
.sheet__answers { padding: 0 18px 18px; border-top: 1px dashed var(--line); }
.sheet__answers h2 { font-size: 15px; }
.sheet__answers ol { padding-left: 24px; font-size: 13px; line-height: 1.9; }
/* 解答欄に出す選択肢の記号（A〜D） */
.sheet__mark {
  display: inline-block; min-width: 1.4em; margin-right: 6px;
  text-align: center; border: 1px solid var(--line); border-radius: 3px;
}

/* ---------- 印刷 ---------- */
@media print {
  .appbar, .no-print, .quick-links, .text-link { display: none !important; }
  #main { max-width: none; padding: 0; }
  body { background: #fff; }
  .card, .sheet, .venue-sheet { box-shadow: none; border-radius: 0; }
  .sheet__list > li { break-inside: avoid; }
  .venue-qr { max-width: 380px; }
}

/* ---------- パソコン向け ---------- */
@media (min-width: 700px) {
  #main { padding-top: 24px; }
  .set-grid { grid-template-columns: repeat(3, 1fr); }
  .flashcard__inner { min-height: 280px; }
}

/* ---------- 速く答えると高得点（結果画面の点数） ---------- */
.result-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 10px;
}
.result-score__num {
  display: block;
  font-size: 34px;
  font-weight: 700;
  color: var(--mint-deep);
  line-height: 1.1;
}
.result-score__unit { display: block; font-size: 15px; color: var(--ink-sub); }
.result-score__best {
  display: block;
  margin-left: 6px;
  font-size: 13px;
  color: var(--ink-sub);
}
.result-score__best.is-new {
  color: var(--amber-deep, #b26a00);
  font-weight: 700;
}

/* ---------- 外部部品のクレジット（マイページ最下部） ---------- */
.credits {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-sub);
}
.credits dt {
  margin-top: 10px;
  font-weight: 700;
  color: var(--ink);
}
.credits dt:first-child { margin-top: 0; }
.credits dd { margin: 2px 0 0 1em; }
.credits a { color: var(--mint-deep); }

/* ---------- 問題に付ける画像（2026-08-10 追加） ---------- */
.q-image {
  display: block;
  width: 100%;
  max-width: 420px;
  max-height: 40vh;          /* 画像で画面が埋まって、問題文や選択肢が隠れないように */
  margin: 0 auto 12px;
  object-fit: contain;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line, #dfe8e4);
}
/* カードの表面は縦が狭いので、少し小さめに収める */
.q-image--card { max-width: 260px; max-height: 30vh; margin-bottom: 10px; }

/* 紙のテストに刷る図 */
.sheet__img {
  display: block;
  max-width: 70mm;
  max-height: 50mm;
  margin: 4px 0 6px;
  object-fit: contain;
}

/* ---------- 役割の切り替え（第2段階の作りこみ中） ---------- */
/* 作りこみ中であることが一目で分かるよう、他のカードと色を変えています */
.card--wip {
  background: var(--amber-pale, #fff6e4);
  border-color: var(--amber-deep, #b26a00);
}
.role-now {
  margin: 4px 0 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--mint-deep);
}
.role-picker { display: grid; gap: 8px; margin-top: 4px; }
.role-btn {
  display: block;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  background: #fff;
  border: 2px solid var(--line, #dfe8e4);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.role-btn:hover { border-color: var(--mint); }
.role-btn.is-on {
  border-color: var(--mint);
  background: #e4f6f0;
}
.role-btn__name { display: block; font-weight: 700; font-size: 16px; }
.role-btn__desc {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink-sub);
}
.perm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.perm-table td { padding: 7px 6px; border-bottom: 1px solid var(--line, #dfe8e4); }
.perm-table td:last-child { width: 3em; text-align: center; font-weight: 700; }
.perm--yes { color: var(--mint-deep); }
.perm--no { color: #b23a33; }

/* ---------- 生徒の名簿（第2段階の作りこみ中） ---------- */
.roster-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.roster-count {
  flex: 1 1 auto;
  min-width: 72px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f4f7f6;
  font-size: 12px;
  color: var(--ink-sub);
  text-align: center;
}
.roster-count b {
  display: block;
  font-size: 20px;
  color: var(--ink);
  line-height: 1.2;
}
.roster-count.is-active b { color: var(--mint-deep); }
.roster-count.is-paused b { color: var(--amber-deep, #8a5c05); }
.roster-count.is-left b { color: #8a8a8a; }

.roster-row {
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid var(--line, #dfe8e4);
  border-left: 4px solid var(--mint);
  border-radius: 10px;
}
/* 状態が一目で分かるように、左の色を変えています */
.roster-row--paused { border-left-color: var(--amber-deep, #8a5c05); }
.roster-row--left { border-left-color: #b9c4c0; background: #fafbfb; }

.roster-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.roster-row__name { font-weight: 700; font-size: 15px; }
/* 先生には伏せている名前。本名でないことが分かるようにします */
.roster-row__name.is-hidden { color: var(--ink-sub); font-weight: 500; }
.roster-row__venue {
  flex: none;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef3f1;
  font-size: 11px;
  color: var(--ink-sub);
}
.roster-row__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-sub);
}
.roster-row__stats b { color: var(--ink); font-size: 13px; }
.roster-row__note {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--ink-sub);
}
.roster-row__enroll { margin-top: 8px; }

.enroll-tag {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.enroll-tag--active { background: #e4f6f0; color: var(--mint-deep); }
.enroll-tag--paused { background: var(--amber-pale, #fff6e4); color: var(--amber-deep, #8a5c05); }
.enroll-tag--left { background: #eef0ef; color: #6b6b6b; }

/* ---------- アカウントの発行（運営者だけ） ---------- */
/* 一度しか見られない情報なので、他と明確に見た目を変えます */
.card--issued {
  background: #e4f6f0;
  border-color: var(--mint);
  border-width: 2px;
}
.issued {
  margin: 10px 0;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line, #dfe8e4);
  border-radius: 10px;
  /* IDとパスワードは1文字ずつ読むので、等幅で出します */
  font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.9;
  white-space: pre-wrap;
  word-break: break-all;
  /* 紙に書き写せるよう、選択してコピーできるままにします */
  user-select: text;
}
.io-actions--col { display: grid; gap: 6px; margin-top: 8px; }

/* ---------- 送信できていないことの表示（2026-08-12 追加） ---------- */
/*
 * 学習の記録がサーバーへ送れていないときだけ出ます。
 * 生徒が操作するものではないので、押せる見た目にはしません。
 * 学習の邪魔にならないよう、上部に細く出すだけにしています。
 */
.sync-bar {
  /*
   * ★ 画面の流れから外して、ヘッダーの下に重ねます（2026-09-04）。
   *   もとは header と main のあいだに普通の要素として置いていたため、
   *   バナーが消えた瞬間に下の内容が 31px 跳ね上がっていました。
   *   選択肢を押そうとした指の下でボタンが入れ替わり、
   *   別の選択肢を押してしまう不具合になっていました（実測値は 検証/t_shift_0904.js）。
   *   重ねる位置は進捗バーのあたりで、選択肢には掛かりません。
   */
  position: fixed;
  top: calc(54px + env(safe-area-inset-top, 0px));   /* .appbar の高さに合わせます */
  left: 0;
  right: 0;
  z-index: 19;                                        /* .appbar は 20。その下に置きます */
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--amber-pale, #fff6e4);
  border-bottom: 1px solid var(--amber-deep, #8a5c05);
  font-size: 12px;
  line-height: 1.5;
  color: var(--amber-deep, #8a5c05);
}
.sync-bar__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber-deep, #8a5c05);
  /* ゆっくり点滅させて、止まっている表示ではないことを示します */
  animation: sync-blink 1.6s ease-in-out infinite;
}
@keyframes sync-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }
/* 動きを減らす設定にしている端末では点滅させません */
@media (prefers-reduced-motion: reduce) {
  .sync-bar__dot { animation: none; }
}
.sync-bar__text { flex: 1 1 auto; }

/* ---------- 名簿の追加項目（2026-08-12） ---------- */
/* 学年は一目で分かるよう、丸い札にします */
.roster-row__grade {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eef3f1;
  font-weight: 700;
  color: var(--ink);
}
/* アプリを使えない生徒は、行全体を薄くして見分けられるようにします */
.roster-row--noaccess { opacity: 0.72; }
.roster-row__access { margin-top: 6px; }

/* ============================================================
   お知らせ・コラム（2026-08-14 追加）
   ============================================================ */
.post-row {
  display: block;
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 8px;
  background: #fff;
  border: 1px solid var(--line, #dfe8e4);
  border-left: 4px solid var(--line, #dfe8e4);
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
}
/* 固定した記事と下書きは、左の色で見分けられるようにします */
.post-row--pinned { border-left-color: var(--amber-deep, #8a5c05); }
.post-row--draft { border-left-color: #b9c4c0; background: #fafbfb; }

.post-row__head { display: flex; align-items: center; gap: 6px; }
.post-row__title { font-weight: 700; font-size: 15px; color: var(--ink); }
.post-row__pin { font-size: 13px; }
/* まだ読んでいない印。色だけに頼らず文字でも示します */
.post-row__new {
  flex: none;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--coral, #e05c4b);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.post-row__meta { margin-top: 5px; font-size: 12px; color: var(--ink-sub); }

/* 本文。行間を広めにして読みやすくします */
.post-body p { margin: 0 0 0.9em; line-height: 1.9; }
.post-body p:empty { margin-bottom: 0.5em; }
.post-body p:last-child { margin-bottom: 0; }

.cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line, #dfe8e4);
}
.cat-row__name { flex: 1 1 auto; min-width: 5em; font-weight: 700; }
/*
 * この行の中のボタンは、幅いっぱいに広がる既定のままだと
 * 分類名を押しつぶして縦書きのようになってしまいます。
 * 中身の幅だけを取らせ、折り返さないようにします。
 */
.cat-row .text-link {
  flex: 0 0 auto;
  width: auto;
  margin-top: 0;
  padding: 6px 12px;
  white-space: nowrap;
}

/* チェックつきの選択肢。1つずつ行を分けます */
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 14px;
  line-height: 1.5;
  cursor: pointer;
}
.check input { flex: none; width: 18px; height: 18px; }

/* エラーの案内。色だけでなく、枠と背景でも分かるようにします */
.note--error {
  padding: 10px 12px;
  border: 1px solid #e3b7b1;
  border-left: 4px solid var(--coral, #e05c4b);
  border-radius: 8px;
  background: #fdecea;
  color: #8f2f24;
  font-weight: 700;
}

/* パスワード再設定の宛先。名前・入力欄・保存を1行に並べます */
.cat-row__mail {
  flex: 1 1 14em;
  min-width: 0;
  padding: 6px 10px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

/* ---------- ログイン画面のロゴ（2026-08-21 追加） ---------- */
.login-logo {
  margin: 4px 0 14px;
  text-align: center;
}
.login-logo img {
  width: 100%;
  max-width: 220px;
  height: auto;          /* 縦横の比を保ちます。引きのばしません */
}
/* 画面の高さが足りないときは、小さくして入力欄を優先します */
@media (max-height: 620px) {
  .login-logo img { max-width: 140px; }
}

/* ---------- ホーム画面のロゴ（2026-08-21 追加） ---------- */
.home-logo {
  margin: 2px 0 12px;
  text-align: center;
}
.home-logo img {
  width: 100%;
  max-width: 128px;      /* 邪魔にならない大きさに留めます */
  height: auto;          /* 縦横の比を保ちます */
}
@media (min-width: 700px) {
  .home-logo img { max-width: 150px; }
}

/* ---------- 気をつけていただきたい説明（2026-08-21 追加） ---------- */
.note--caution {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e6d4a8;
  border-left: 4px solid #c99a1e;
  border-radius: 8px;
  background: #fff8e8;
  color: #6b5411;
}
.note--caution b { color: #4d3c0c; }

/* ---------- 開発用：見え方の切り替え（2026-08-21 追加） ---------- */
.role-switch {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.role-switch button {
  flex: 1;
  min-height: 40px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-sub);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.role-switch button.is-on {
  border-color: var(--mint);
  background: var(--mint);
  color: #fff;
}

/* ---------- 読み込み中の案内（2026-09-04 追加） ---------- */
/*
 * 問題ファイルを読み込んでいるあいだに出します。
 * これが無いと、問題が入っていない科目のように見えてしまいます。
 */
.loading-note {
  padding: 28px 14px;
  text-align: center;
  color: var(--ink-soft, #5b6b64);
}
.loading-note::before {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 8px;
  vertical-align: -2px;
  border: 2px solid var(--green, #1f6f5c);
  border-right-color: transparent;
  border-radius: 50%;
  animation: loading-spin 0.8s linear infinite;
}
@keyframes loading-spin { to { transform: rotate(360deg); } }
/* 動きを減らす設定にしている端末では回しません */
@media (prefers-reduced-motion: reduce) {
  .loading-note::before { animation: none; }
}
