/* =========================================================
   style.css — iPad／学校タブレット向けの見た目
   ========================================================= */
:root {
  --navy: #1f4e79;
  --navy-d: #163a5c;
  --bg: #f4f6f9;
  --card: #ffffff;
  --ink: #1d2733;
  --sub: #5b6776;
  --line: #d7dde5;
  --prep: #1d6fe0;
  --answer: #d92d20;
  --listen: #0d8a5f;
  --gold: #f5b82e;
  --radius: 14px;
  --font: 'BIZ UDPGothic', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', Meiryo, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); font-family: var(--font); -webkit-text-size-adjust: 100%; }
body { font-size: 18px; line-height: 1.6; }
button { font-family: inherit; font-size: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
small { font-size: .78em; }
[hidden] { display: none !important; }

.screen { display: none; min-height: 100vh; min-height: 100dvh; }
.screen.active { display: block; }

/* ---------- ヘッダー ---------- */
.apphead { background: var(--navy); color: #fff; padding: 14px 20px; padding-top: max(14px, env(safe-area-inset-top)); display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 5; }
.apphead h1 { font-size: 1.3rem; margin: 0; font-weight: 700; }
.apphead h1 small { font-weight: 400; opacity: .85; margin-left: .4em; }
.apphead .back { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 10px; padding: 8px 14px; }

.homebody { max-width: 980px; margin: 0 auto; padding: 20px 16px 60px; }
.homebody.center { text-align: center; }

/* ---------- ステップ ---------- */
.step { background: var(--card); border-radius: var(--radius); padding: 18px 20px 20px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.step h2 { font-size: 1.2rem; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.num { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 1rem; flex: none; }
.hint { color: var(--sub); margin: 0 0 12px; font-size: .95rem; }

.choice { display: flex; flex-wrap: wrap; gap: 10px; }
.choice button { flex: 1 1 140px; min-height: 64px; border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 12px; line-height: 1.35; font-weight: 700; transition: background .15s, border-color .15s; }
.choice button small { font-weight: 400; color: var(--sub); }
.choice button.sel { border-color: var(--navy); background: #e3eefa; box-shadow: inset 0 0 0 2px var(--navy); }
.choice.big button { min-height: 96px; font-size: 1.25rem; }
.choice.big .ic { display: block; font-size: 1.8rem; }
.choice.small button { min-height: 50px; flex: 1 1 110px; font-size: .95rem; }

.setlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.setlist button { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 14px 12px; text-align: left; min-height: 92px; display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; }
.setlist button b { display: block; font-size: 1.15rem; color: var(--navy); }
.setlist button small { color: var(--sub); line-height: 1.4; display: block; margin-top: 4px; }
.setlist button:active, .partlist button:active { background: #e3eefa; }

details.more { background: var(--card); border-radius: var(--radius); padding: 14px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
details.more summary { font-weight: 700; cursor: pointer; padding: 4px 0; }
.setgrid { display: grid; gap: 12px; margin-top: 12px; }
.setrow { display: grid; grid-template-columns: 200px 1fr; gap: 10px; align-items: center; }
.setrow .lab { font-weight: 700; font-size: .95rem; line-height: 1.4; }
.setrow .lab small { font-weight: 400; color: var(--sub); }
.foot { text-align: center; margin-top: 26px; }
.foot a { color: var(--navy); }

/* ---------- セットメニュー ---------- */
.status-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.chip { background: #e3eefa; color: var(--navy); border-radius: 999px; padding: 4px 12px; font-size: .9rem; font-weight: 700; }
.status-line a { color: var(--navy); font-size: .9rem; margin-left: auto; }
.primary { background: var(--navy); color: #fff; border: 0; border-radius: 12px; padding: 14px 26px; font-weight: 700; font-size: 1.1rem; box-shadow: 0 2px 0 var(--navy-d); }
.primary:active { transform: translateY(1px); box-shadow: none; }
.primary.huge { display: block; width: 100%; font-size: 1.3rem; padding: 20px; line-height: 1.4; }
.primary.huge small { font-weight: 400; opacity: .9; }
.ghost { background: #fff; color: var(--navy); border: 2px solid var(--navy); border-radius: 12px; padding: 12px 22px; font-weight: 700; }
h2.sub { font-size: 1.1rem; margin: 26px 0 10px; color: var(--sub); }
.partlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.partlist button { background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 6px; min-height: 110px; }
.partlist .pt { font-weight: 700; line-height: 1.4; }
.partlist small { color: var(--sub); }
.badge { display: inline-block; background: var(--navy); color: #fff; border-radius: 8px; padding: 2px 10px; font-weight: 700; font-size: .9rem; align-self: flex-start; }
.row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.row.center, .homebody.center .row { justify-content: center; }

/* ---------- マイク ---------- */
.lead { font-size: 1.1rem; }
.meter { height: 12px; background: #e7ebf0; border-radius: 6px; overflow: hidden; }
.meter .lvl { height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, #84cc16 70%, #f59e0b); transition: width .08s linear; }
.meter.big { height: 28px; border-radius: 14px; max-width: 420px; margin: 10px auto; }
.err { color: var(--answer); font-weight: 700; }

/* =========================================================
   テスト画面
   ========================================================= */
#test.active { display: grid; grid-template-rows: auto 1fr auto auto; height: 100vh; height: 100dvh; overflow: hidden; background: #fff; }
.tbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--navy); color: #fff; }
.tpart { display: flex; align-items: center; gap: 10px; font-weight: 700; min-width: 0; flex: 1; }
.tpart #tTitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tbar .badge { background: var(--gold); color: #1d2733; font-size: 1rem; }
.tq { font-weight: 700; font-size: 1.1rem; white-space: nowrap; }
.tbtns { display: flex; gap: 8px; align-items: center; }
.tbtns button { background: rgba(255,255,255,.16); color: #fff; border: 0; border-radius: 10px; padding: 8px 12px; font-size: .95rem; white-space: nowrap; }
.capstate { font-size: .85rem; background: rgba(255,255,255,.12); border-radius: 999px; padding: 4px 10px; white-space: nowrap; cursor: pointer; }
.capstate.on { background: #fff; color: var(--navy); font-weight: 700; }

.tmain { overflow-y: auto; padding: 14px 18px; -webkit-overflow-scrolling: touch; }
.sit { background: #fff8e1; border-left: 6px solid var(--gold); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; font-size: 1.05rem; }

/* 説明画面 */
.intro { max-width: 760px; margin: 2vh auto; text-align: center; }
.intro-badge { display: inline-block; background: var(--gold); border-radius: 10px; padding: 4px 16px; font-weight: 700; font-size: 1.2rem; }
.intro h2 { font-size: 1.6rem; margin: 10px 0; }
.intro-text { font-size: 1.15rem; text-align: left; background: #f4f6f9; border-radius: 12px; padding: 14px 18px; }
.intro-time { font-weight: 700; color: var(--navy); }
.intro-cap { color: var(--sub); }

/* Part A 音読 */
.passage { font-family: 'Helvetica Neue', Arial, var(--font); font-size: clamp(1.35rem, 2.6vw, 1.9rem); line-height: 1.85; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 20px 26px; max-width: 980px; margin: 0 auto; }

/* Part B */
.bwrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.bside { display: flex; flex-direction: column; gap: 12px; }
.partner { display: flex; align-items: center; gap: 12px; background: #f4f6f9; border-radius: var(--radius); padding: 8px 14px; }
.pav { width: 86px; height: 86px; border-radius: 50%; overflow: hidden; background: #e3eefa; flex: none; }
.pav svg { width: 100%; height: 100%; display: block; }
.pname { font-size: 1.3rem; font-weight: 700; line-height: 1.3; }
.pname small { display: block; font-size: .8rem; color: var(--sub); font-weight: 400; }
.bq { background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-height: 120px; }
.bq-num { font-weight: 700; color: var(--navy); margin-bottom: 6px; }
.bq-listen { font-size: 1.05rem; }
.bq-ja { font-size: .95rem; color: var(--sub); background: #f4f6f9; border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; line-height: 1.6; }
.task { font-size: 1.1rem; font-weight: 700; }
.task .topic { font-size: 1.5rem; color: var(--answer); margin-top: 8px; text-align: center; background: #fff1f0; border-radius: 10px; padding: 10px; }

/* 情報カード */
.infocard { background: #fff; border: 2px solid var(--line); border-radius: var(--radius); overflow: hidden; font-family: 'Helvetica Neue', Arial, var(--font); }
.ic-head { color: #fff; font-weight: 700; font-size: 1.25rem; padding: 10px 16px; }
.ic-list, .ic-table { width: 100%; border-collapse: collapse; font-size: 1.1rem; }
.ic-list td, .ic-list th, .ic-table td, .ic-table th { padding: 9px 12px; border-bottom: 1px solid #edf0f4; text-align: left; vertical-align: middle; }
.ic-list th { font-weight: 700; white-space: nowrap; }
.ic-icon { font-size: 1.5rem; width: 1.6em; text-align: center; }
.ic-table thead th { background: #f4f6f9; font-size: .95rem; color: var(--sub); }
.ic-note { padding: 8px 14px; background: #f9fafb; color: var(--sub); font-size: .95rem; }
.ic-floor .fl { display: flex; border-bottom: 1px solid #edf0f4; }
.flno { flex: none; width: 64px; display: grid; place-items: center; background: #f4f6f9; font-weight: 700; font-size: 1.3rem; }
.flitems { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 12px; font-size: 1.05rem; }
.flit { display: inline-flex; align-items: center; gap: 4px; }
.ic-bars { padding: 10px 14px; }
.brow { display: grid; grid-template-columns: 2em 5.5em 1fr 2.2em; align-items: center; gap: 8px; margin: 6px 0; font-size: 1.1rem; }
.btrack { height: 22px; background: #edf0f4; border-radius: 6px; overflow: hidden; }
.bfill { display: block; height: 100%; border-radius: 6px; }
.bval { font-weight: 700; text-align: right; }
.bunit { text-align: right; color: var(--sub); font-size: .9rem; }

/* イラスト */
.pic { position: relative; margin: 0; background: #fff; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.picbody svg, .picbody img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.pnum { position: absolute; top: 6px; left: 6px; z-index: 2; background: var(--navy); color: #fff; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.single { max-width: min(780px, calc((100dvh - 330px) * 4 / 3)); min-width: 280px; margin: 0 auto; }
.single.small { max-width: 420px; }
.panels { display: grid; gap: 12px; margin: 0 auto; }
.panels.n3 { grid-template-columns: repeat(3, 1fr); max-width: 1180px; }
.panels.n4 { grid-template-columns: repeat(2, 1fr); max-width: min(900px, calc((100dvh - 340px) * 4 / 3 + 12px)); min-width: 300px; }
.hint { text-align: center; margin-top: 10px; color: var(--sub); }
.hint b { color: var(--ink); font-family: 'Helvetica Neue', Arial, var(--font); }

/* 意見 */
.opwrap { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.options { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.opt { background: #fff; border: 3px solid var(--line); border-radius: 18px; padding: 16px 24px; text-align: center; min-width: 220px; }
.oic { font-size: 4rem; line-height: 1.1; }
.olab { font-size: 1.35rem; font-weight: 700; font-family: 'Helvetica Neue', Arial, var(--font); }
.oja { color: var(--sub); font-size: .95rem; }
.or { font-size: 1.4rem; font-weight: 700; color: var(--sub); }

/* 字幕 */
.caption { background: #111827; color: #fff; padding: 10px 18px; display: flex; gap: 14px; align-items: baseline; max-height: 34vh; overflow-y: auto; }
.caption .who { flex: none; background: var(--gold); color: #111; border-radius: 8px; padding: 2px 10px; font-weight: 700; font-size: 1rem; }
.caption .ctext { font-family: 'Helvetica Neue', Arial, var(--font); font-size: clamp(1.3rem, 2.4vw, 1.75rem); line-height: 1.6; }
.caption .w { border-radius: 4px; transition: background .1s; }
.caption .w.done { color: #e5e7eb; }
.caption .w.on { background: var(--gold); color: #111; }

/* フッター */
.tfoot { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; grid-template-areas: "phase timer btns" "meter meter meter"; gap: 6px 14px; align-items: center; padding: 10px 14px; padding-bottom: max(10px, env(safe-area-inset-bottom)); background: #f4f6f9; border-top: 1px solid var(--line); }
.phase { grid-area: phase; font-weight: 700; font-size: 1.15rem; border-radius: 10px; padding: 8px 12px; }
.ph-intro { color: var(--sub); }
.ph-listen { background: #e6f6ef; color: var(--listen); }
.ph-prep { background: #e6effc; color: var(--prep); }
.ph-answer { background: #fde8e7; color: var(--answer); }
.recdot { display: inline-block; margin-left: 6px; font-size: .9rem; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.timer { grid-area: timer; display: flex; align-items: center; gap: 10px; }
.timer.off { visibility: hidden; }
.timer .bar { flex: 1; height: 18px; background: #dfe5ec; border-radius: 9px; overflow: hidden; }
.timer .fill { height: 100%; width: 0; background: var(--prep); border-radius: 9px; transition: width .1s linear; }
.timer .secs { font-weight: 700; font-size: 1.6rem; min-width: 3.4em; text-align: right; font-variant-numeric: tabular-nums; }
#test.answering .timer .fill { background: var(--answer); }
#test.answering .tmain { box-shadow: inset 0 0 0 6px var(--answer); }
#test.preparing .tmain { box-shadow: inset 0 0 0 6px rgba(29,111,224,.55); }
.tfoot .meter { grid-area: meter; }
.fbtns { grid-area: btns; display: flex; gap: 8px; }
.fbtns button { background: #fff; border: 2px solid var(--navy); color: var(--navy); border-radius: 10px; padding: 9px 14px; font-weight: 700; white-space: nowrap; }
.fbtns button:disabled { opacity: .4; }

/* 合図のフラッシュ（音が聞こえにくくても切り替わりが分かるように） */
.flash { position: fixed; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.9); padding: 22px 40px; border-radius: 20px; font-size: clamp(1.6rem, 4vw, 2.6rem); font-weight: 700; color: #fff; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; box-shadow: 0 10px 30px rgba(0,0,0,.25); white-space: nowrap; }
.flash.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.flash.go { background: var(--answer); }
.flash.stop { background: #374151; }
.pausecover { position: fixed; inset: 0; background: rgba(17,24,39,.6); display: grid; place-items: center; z-index: 30; }
.pausebox { background: #fff; border-radius: 18px; padding: 28px 40px; font-size: 1.5rem; font-weight: 700; text-align: center; }
.pausebox .primary { margin-top: 16px; }

/* ---------- ふりかえり ---------- */
.rv-head { background: #fff; border-radius: var(--radius); padding: 16px 20px; font-size: 1.2rem; font-weight: 700; margin-bottom: 14px; }
.rv-head small { font-weight: 400; color: var(--sub); }
.rv-part { background: #fff; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.rv-part h2 { font-size: 1.15rem; display: flex; gap: 10px; align-items: center; margin: 4px 0 8px; }
.tips { background: #fff8e1; border-radius: 10px; margin: 0 0 12px; padding: 10px 14px 10px 32px; font-size: .95rem; }
.rv-card { max-width: 560px; margin-bottom: 10px; }
.rv-item { border-top: 1px dashed var(--line); padding: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.rv-h { font-weight: 700; color: var(--navy); }
.rv-q { font-family: 'Helvetica Neue', Arial, var(--font); font-size: 1.05rem; }
.lbl { display: inline-block; background: #eef2f7; border-radius: 6px; padding: 1px 8px; font-size: .85rem; font-weight: 700; color: var(--sub); margin-right: 8px; font-family: var(--font); }
.rv-my { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.rv-my audio { height: 40px; max-width: 100%; }
.rv-my .none { color: var(--sub); }
.rv-tr { background: #f4f6f9; border-radius: 8px; padding: 6px 10px; font-family: 'Helvetica Neue', Arial, var(--font); }
.rv-model { background: #e6f6ef; border-radius: 10px; padding: 8px 12px; font-family: 'Helvetica Neue', Arial, var(--font); font-size: 1.05rem; }
.rv-model .lbl { background: #fff; color: var(--listen); }
.spk { background: #fff; border: 1.5px solid var(--navy); color: var(--navy); border-radius: 8px; padding: 2px 10px; font-size: .9rem; margin-left: 6px; font-family: var(--font); }
.rv-item .panels.n3, .rv-item .panels.n4 { grid-template-columns: repeat(4, 1fr); max-width: 760px; margin: 0; }
.rv-item .pnum { width: 24px; height: 24px; font-size: .85rem; }

/* ---------- 画面幅による調整 ---------- */
@media (max-width: 900px) {
  .bwrap { grid-template-columns: 1fr; }
  .panels.n3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .tfoot { grid-template-columns: 1fr auto; grid-template-areas: "phase btns" "timer timer" "meter meter"; }
  .setrow { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .panels.n3 { grid-template-columns: 1fr 1fr; }
  .panels.n4 { grid-template-columns: 1fr 1fr; }
  .tbar { flex-wrap: wrap; }
  .tbtns button { padding: 6px 8px; }
  .rv-item .panels.n3, .rv-item .panels.n4 { grid-template-columns: repeat(2, 1fr); }
}
@media (orientation: portrait) and (min-width: 641px) {
  .panels.n4 { max-width: 760px; }
  .single { max-width: 760px; }
}

/* =========================================================
   答え方のコツとテンプレ表現
   ========================================================= */
.ghost.wide { display: block; width: 100%; margin-top: 18px; font-size: 1.1rem; padding: 16px; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { border: 2px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; text-align: left; line-height: 1.3; }
.tabs button.sel { border-color: var(--navy); background: #e3eefa; box-shadow: inset 0 0 0 2px var(--navy); }
#studyTabs { position: sticky; top: 60px; z-index: 4; background: var(--bg); padding: 8px 0; }
.st-goal { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px; }
.st-goal .badge { background: var(--gold); color: #1d2733; }
.st-goal h2 { margin: 6px 0 4px; font-size: 1.4rem; }
.st-goal p { margin: 0; font-size: 1.05rem; }
.st-sec { background: #fff; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.st-sec h3 { margin: 2px 0 10px; font-size: 1.15rem; }
.st-sec h3 small { font-weight: 400; color: var(--sub); font-size: .85rem; margin-left: 6px; }
.st-sec h4 { margin: 14px 0 6px; color: var(--navy); font-size: 1rem; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; counter-reset: none; }
.flow li { position: relative; background: #f4f6f9; border-radius: 12px; padding: 12px 12px 12px 50px; display: flex; flex-direction: column; gap: 2px; min-height: 90px; }
.flow li b { font-size: 1.05rem; color: var(--navy); }
.flow li span:last-child { font-size: .95rem; line-height: 1.5; }
.fno { position: absolute; left: 10px; top: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; }
.st-tips { margin: 0; padding-left: 1.3em; }
.st-tips li { margin: 4px 0; }
.phrases { display: flex; flex-direction: column; gap: 8px; }
.phr { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; grid-template-areas: "en ja btn" "my my my"; gap: 4px 12px; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.pen { grid-area: en; font-family: 'Helvetica Neue', Arial, var(--font); font-size: 1.2rem; font-weight: 700; }
.pja { grid-area: ja; color: var(--sub); font-size: .95rem; line-height: 1.45; }
.pbtn { grid-area: btn; display: flex; gap: 6px; }
.pbtn .spk { margin: 0; padding: 6px 10px; font-size: .95rem; }
.mim { background: #fff; border: 1.5px solid var(--answer); color: var(--answer); border-radius: 8px; padding: 6px 10px; font-size: .95rem; font-weight: 700; white-space: nowrap; }
.mim.rec { background: var(--answer); color: #fff; animation: blink 1s infinite; }
.pmy { grid-area: my; display: flex; align-items: center; gap: 6px; }
.pmy:empty { display: none; }
.pmy audio { height: 36px; max-width: 100%; }
.ngs { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.ng { border-radius: 12px; overflow: hidden; border: 1.5px solid var(--line); }
.ng .bad { background: #fde8e7; color: #9b1c13; padding: 8px 12px; }
.ng .good { background: #e6f6ef; color: #0b5e41; padding: 8px 12px; font-weight: 700; }
.st-model { background: #f4f6f9; border-radius: 10px; padding: 8px 12px; margin: 6px 0; font-family: 'Helvetica Neue', Arial, var(--font); font-size: 1.05rem; line-height: 1.7; }
.st-model .q { color: var(--sub); font-size: .95rem; }
mark { background: #ffe58a; color: inherit; border-radius: 4px; padding: 0 2px; }
.sl { color: var(--answer); font-weight: 700; margin: 0 2px; }
.kgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.kgrid .k { background: #e3eefa; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; }
.kgrid .k b { color: var(--navy); }
.mind { margin: 12px 0 0; padding-left: 1.3em; color: var(--ink); }

/* ふりかえり側 */
.study-go { display: block; margin-top: 12px; font-size: 1.05rem; }
.study-link { margin-left: auto; background: #fff; border: 1.5px solid var(--navy); color: var(--navy); border-radius: 8px; padding: 4px 12px; font-size: .9rem; font-weight: 700; }
details.tips summary { cursor: pointer; font-weight: 700; }
details.tips ol { margin: 6px 0 0; padding-left: 1.2em; }
.rv-hint { background: #e3eefa; border-radius: 8px; padding: 6px 10px; font-size: .98rem; }
.rv-hint .lbl { background: #fff; color: var(--navy); }
.rv-chunk { font-family: 'Helvetica Neue', Arial, var(--font); font-size: 1.05rem; line-height: 1.8; background: #fff8e1; border-radius: 8px; padding: 6px 10px; }
.mnote { font-family: var(--font); font-size: .82rem; color: var(--sub); margin-top: 4px; }

@media (max-width: 760px) {
  .phr { grid-template-columns: 1fr auto; grid-template-areas: "en btn" "ja ja" "my my"; }
  #studyTabs { top: 56px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #studyTabs button { flex: none; white-space: nowrap; }
}

.core { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 4px; text-underline-offset: 4px; }
a.ghost { display: inline-block; text-decoration: none; }

/* 受験のしかた（配慮申請） */
.choice.accom { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice.accom button { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.choice.accom button b { font-size: 1.15rem; }
.choice.accom .ad { font-weight: 400; font-size: .88rem; color: var(--sub); line-height: 1.5; }
.choice.accom button.sel .ad { color: var(--ink); }
#accomNote { margin: 10px 0 0; background: #f4f6f9; border-radius: 10px; padding: 8px 12px; color: var(--ink); }
#accomNote:empty { display: none; }
@media (max-width: 760px) { .choice.accom { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* =========================================================
   練習問題のメニュー画面（このページだけの見た目）
   ========================================================= */
#setmenu .partlist button { cursor: pointer; position: relative; box-shadow: 0 3px 0 #c9d3de; transition: background .15s, border-color .15s, transform .12s, box-shadow .12s; }
#setmenu .partlist .pfoot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
#setmenu .partlist .go { background: #e6f8ff; color: #035a80; border: 1.5px solid #00bfff; border-radius: 999px; padding: 2px 12px; font-size: .9rem; font-weight: 700; transition: background .15s, color .15s; }
#setmenu .fullrun { display: flex; align-items: center; gap: 16px; width: 100%; border: 0; border-radius: 16px; padding: 18px 22px; background: #00bfff; color: #06283d; font-weight: 700; font-size: 1.3rem; text-align: left; line-height: 1.35; cursor: pointer; box-shadow: 0 5px 0 #0090c2; transition: background .15s, transform .12s, box-shadow .12s; }
#setmenu .fullrun .fr-ic { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #fff; color: #0090c2; font-size: 1.4rem; box-shadow: 0 2px 4px rgba(0,0,0,.15); transition: transform .15s; }
#setmenu .fullrun .fr-tx small { display: block; font-weight: 400; font-size: .95rem; opacity: .85; }
#setmenu #btnStudy { cursor: pointer; transition: background .15s; }
@media (hover: hover) {
  #setmenu .partlist button:hover { border-color: #00bfff; background: #f0fbff; transform: translateY(-2px); box-shadow: 0 5px 0 #9fdcf2; }
  #setmenu .partlist button:hover .go { background: #00bfff; color: #06283d; }
  #setmenu .fullrun:hover { background: #1ec8ff; transform: translateY(-2px); box-shadow: 0 7px 0 #0090c2; }
  #setmenu .fullrun:hover .fr-ic { transform: scale(1.08); }
  #setmenu #btnStudy:hover { background: #e3eefa; }
}
#setmenu .partlist button:active { transform: translateY(2px); box-shadow: 0 1px 0 #9fdcf2; background: #e6f8ff; }
#setmenu .fullrun:active { transform: translateY(3px); box-shadow: 0 2px 0 #0090c2; background: #00acea; }
#setmenu .partlist button:focus-visible, #setmenu .fullrun:focus-visible { outline: 3px solid #035a80; outline-offset: 3px; }

/* 情報カード：1行ごとに実線の罫線 */
.infocard { border: 2px solid #6b7785; }
.ic-list, .ic-table { border-style: hidden; }
.ic-list td, .ic-list th, .ic-table td, .ic-table th { border: 1.5px solid #6b7785; }
.ic-head { border-bottom: 2px solid #6b7785; }
.ic-note { border-top: 1.5px solid #6b7785; }
.ic-floor .fl { border-bottom: 1.5px solid #6b7785; }
.ic-floor .fl:last-child { border-bottom: 0; }
.flno { border-right: 1.5px solid #6b7785; }
.ic-bars .brow { border-bottom: 1.5px solid #6b7785; padding-bottom: 6px; }
.ic-bars .brow:last-of-type { border-bottom: 0; }

/* =========================================================
   ホーム画面（受験のしかた・学年・練習問題を選ぶ）
   メニュー画面と同じ「押せるボタン」の見た目
   ========================================================= */
#home .choice button, #home .setlist button { cursor: pointer; position: relative; box-shadow: 0 3px 0 #c9d3de; transition: background .15s, border-color .15s, transform .12s, box-shadow .12s; }
#home .choice button.sel { border-color: #00bfff; background: #e6f8ff; box-shadow: inset 0 0 0 2px #00bfff, 0 3px 0 #0090c2; }
#home .choice button.sel::after { content: '✓'; position: absolute; top: -9px; right: -9px; width: 26px; height: 26px; border-radius: 50%; background: #00bfff; color: #06283d; font-size: 15px; font-weight: 700; line-height: 26px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
#home .choice.small button.sel::after { width: 20px; height: 20px; line-height: 20px; font-size: 12px; top: -7px; right: -7px; }
#home .choice.accom button.sel .ad { color: #06283d; }
#home .setlist button { display: flex; flex-direction: column; align-items: flex-start; }
#home .setlist .go { margin-top: auto; align-self: flex-end; background: #e6f8ff; color: #035a80; border: 1.5px solid #00bfff; border-radius: 999px; padding: 2px 12px; font-size: .9rem; font-weight: 700; transition: background .15s; }
#home .setlist button small { margin-bottom: 8px; }
#home details.more summary { transition: color .15s; }
@media (hover: hover) {
  #home .choice button:hover, #home .setlist button:hover { border-color: #00bfff; background: #f0fbff; transform: translateY(-2px); box-shadow: 0 5px 0 #9fdcf2; }
  #home .choice button.sel:hover { background: #d9f4ff; box-shadow: inset 0 0 0 2px #00bfff, 0 5px 0 #0090c2; }
  #home .setlist button:hover .go { background: #00bfff; color: #06283d; }
  #home details.more summary:hover { color: #0090c2; }
}
#home .choice button:active, #home .setlist button:active { transform: translateY(2px); box-shadow: 0 1px 0 #9fdcf2; background: #e6f8ff; }
#home .choice button:focus-visible, #home .setlist button:focus-visible { outline: 3px solid #035a80; outline-offset: 3px; }

/* =========================================================
   画像ファイルのイラスト・コマ割りの絵（data に img / strip / cardImg / boardImg を書いたとき）
   ========================================================= */
.pic.raw .picbody img { aspect-ratio: auto; object-fit: contain; width: 100%; height: auto; background: #fff; }
.storywrap { display: flex; gap: 18px; align-items: flex-start; justify-content: center; flex-wrap: wrap; }
.strip { flex: none; }
.strip .pic { width: min(420px, calc((100dvh - 330px) * 0.9)); min-width: 240px; }
.rv-item .strip .pic { width: 300px; }
.startbox { background: #fff8e1; border: 2px solid var(--gold); border-radius: 12px; padding: 12px 16px; max-width: 420px; margin: 10px auto 0; text-align: center; }
.startbox span { display: block; font-size: .95rem; color: var(--sub); }
.startbox b { display: block; font-family: 'Helvetica Neue', Arial, var(--font); font-size: 1.5rem; margin-top: 4px; }
.storywrap .startbox { margin: 0; align-self: center; }
.board .pic { width: min(440px, calc((100dvh - 320px) * 0.9)); min-width: 260px; margin: 0 auto; }
.bwrap.nocard .bcard { display: flex; justify-content: center; }
.bigpartner { width: min(300px, 80%); border: 2px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; }
.bigpartner img, .bigpartner svg { display: block; width: 100%; height: auto; }
.pav img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.pic.cardimg { max-width: 460px; }
.bq-note { background: #f4f6f9; border-radius: 8px; padding: 6px 10px; margin-bottom: 8px; font-size: .95rem; color: var(--sub); }
.mtext, .st-model, .keybox { white-space: pre-line; }
