* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  color: #1f2a33;
  background: #f4f6f3;
}
button { font: inherit; cursor: pointer; }
a { color: #1d5fa8; }

.top-bar {
  position: sticky; top: 0; z-index: 10;
  background: #2f6b4f; color: #fff;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  padding: 6px 12px; gap: 4px;
}
.title-btn { background: none; border: 0; color: #fff; font-weight: bold; font-size: 16px; padding: 4px 0; }
.nav { display: flex; gap: 4px; }
.nav button {
  background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 6px;
  padding: 4px 10px; font-size: 14px;
}
.nav button.on { background: #fff; color: #2f6b4f; }

main { max-width: 760px; margin: 0 auto; padding: 12px; }
.card { background: #fff; border-radius: 10px; padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
h2 { font-size: 19px; margin: 0 0 8px; }
h3 { font-size: 17px; margin: 14px 0 6px; }
.muted { color: #5c6b75; font-size: 14px; }
.small { font-size: 13px; }

/* ホーム */
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.summary div { background: #eef4ef; border-radius: 8px; padding: 8px 4px; }
.summary b { display: block; font-size: 24px; color: #2f6b4f; line-height: 1.3; }
.summary span { font-size: 13px; }
.btns { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.btn {
  display: block; width: 100%; padding: 12px; border-radius: 8px; border: 1px solid #2f6b4f;
  background: #fff; color: #2f6b4f; font-weight: bold; text-align: center;
}
.btn.main { background: #2f6b4f; color: #fff; font-size: 18px; }
.btn:disabled { opacity: .45; cursor: default; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.row-btns .btn { flex: 1 1 140px; }

.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head button { border: 1px solid #c8d3cc; background: #fff; border-radius: 6px; padding: 2px 10px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-top: 6px; }
.cal .wd { text-align: center; font-size: 12px; color: #5c6b75; }
.cal .d {
  min-height: 52px; border-radius: 6px; background: #f6f8f6; text-align: center;
  font-size: 12px; padding-top: 2px; line-height: 1.3;
}
.cal .d.empty { background: transparent; }
.cal .d.today { outline: 2px solid #e0a32e; }
.cal .d .mk { display: block; font-size: 20px; color: #2f6b4f; line-height: 1.2; }
.cal .d .cnt { display: block; font-size: 10px; color: #5c6b75; }
.legend { font-size: 13px; color: #5c6b75; margin-top: 6px; }

/* 出題 */
.qmeta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.tag { font-size: 12px; background: #e6eef6; color: #23466b; border-radius: 4px; padding: 1px 7px; }
.tag.part { background: #2f6b4f; color: #fff; }
.tag.warn { background: #fff1d6; color: #7a4b00; }
.progress { font-size: 14px; color: #5c6b75; margin-bottom: 6px; }
.case { background: #f7f5ee; border-left: 4px solid #c9b77a; padding: 8px 12px; margin-bottom: 10px; white-space: pre-wrap; }
.qtext { white-space: pre-wrap; margin-bottom: 10px; }
.qfn { font-size: 14px; margin-top: 8px; white-space: pre-wrap; }
rt { font-size: 60%; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex; gap: 10px; text-align: left; width: 100%;
  border: 1px solid #c8d3cc; background: #fff; border-radius: 8px; padding: 10px 12px; color: inherit;
}
.choice .num { flex: 0 0 auto; font-weight: bold; width: 1.4em; }
.choice .txt { white-space: pre-wrap; }
.choice.correct { border-color: #2f8a4f; background: #e7f6eb; }
.choice.wrong { border-color: #c0392b; background: #fbeaea; }
.choice:disabled { cursor: default; color: inherit; }
.judge { font-size: 22px; font-weight: bold; margin: 10px 0 4px; }
.judge.ok { color: #2f8a4f; }
.judge.ng { color: #c0392b; }
.expl { white-space: pre-wrap; }
.toggle { display: inline-flex; border: 1px solid #2f6b4f; border-radius: 8px; overflow: hidden; margin: 8px 0; }
.toggle button { border: 0; background: #fff; color: #2f6b4f; padding: 4px 12px; font-size: 14px; }
.toggle button.on { background: #2f6b4f; color: #fff; }
.ai-note { font-size: 13px; background: #f2f2f2; border-radius: 6px; padding: 6px 10px; margin-top: 10px; color: #4a4a4a; }
.links { font-size: 14px; margin-top: 8px; }

/* 成績 */
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
table.t th, table.t td { border-bottom: 1px solid #e3e8e4; padding: 5px 4px; text-align: left; vertical-align: top; }
table.t td.n { text-align: right; white-space: nowrap; }
.bar { height: 10px; background: #e3e8e4; border-radius: 5px; overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: #2f6b4f; }
.chart { display: flex; align-items: flex-end; gap: 3px; height: 150px; border-bottom: 1px solid #c8d3cc; padding-top: 18px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; position: relative; }
.chart .col .b { width: 100%; max-width: 26px; background: #9cc5ae; border-radius: 3px 3px 0 0; position: relative; }
.chart .col .b .okp { position: absolute; bottom: 0; left: 0; right: 0; background: #2f6b4f; border-radius: 3px 3px 0 0; }
.chart .col .v { font-size: 10px; color: #5c6b75; }
.chart-x { display: flex; gap: 3px; }
.chart-x span { flex: 1; text-align: center; font-size: 10px; color: #5c6b75; }

select, input[type=checkbox] { font: inherit; }
select { padding: 6px; border-radius: 6px; border: 1px solid #c8d3cc; width: 100%; background: #fff; }
label.f { display: block; margin: 8px 0 2px; font-weight: bold; font-size: 15px; }

.foot { max-width: 760px; margin: 0 auto 30px; padding: 0 12px; font-size: 12px; color: #5c6b75; }

@media (max-width: 480px) {
  body { font-size: 16px; }
  .nav button { padding: 3px 7px; font-size: 13px; }
  .cal .d { min-height: 44px; }
  .summary b { font-size: 20px; }
}
