:root {
  --tohan-accent: #2f6f4e;
}

body { font-size: .95rem; }

.navbar-brand { font-weight: 600; letter-spacing: .02em; }

.card-header { font-size: .95rem; }

.stmt-dim { opacity: .55; }
.stmt-dim:hover { opacity: 1; }

.preview-box,
.md-body {
  background: #fbfbfa;
  border: 1px solid #e3e3e0;
  border-radius: .375rem;
  padding: .75rem 1rem;
  line-height: 1.75;
}
.preview-box p, .md-body p { margin-bottom: .5rem; }
.preview-box ul, .md-body ul { margin-bottom: .5rem; padding-left: 1.25rem; }
.preview-box h3, .md-body h3 { font-size: 1.05rem; font-weight: 700; margin-top: .9rem; }
.preview-box h4, .md-body h4 { font-size: 1rem;    font-weight: 700; margin-top: .8rem; }
.preview-box h5, .md-body h5 { font-size: .95rem;  font-weight: 700; margin-top: .7rem; }
.preview-box code, .md-body code {
  background: #eef0ee; padding: .05em .35em; border-radius: .2rem;
}
.preview-box pre, .md-body pre {
  background: #f2f3f2; padding: .6rem .8rem; border-radius: .3rem; overflow-x: auto;
}

.sticky-bottom {
  position: sticky;
  bottom: 0;
  z-index: 5;
  box-shadow: 0 -2px 8px rgba(0,0,0,.06);
  padding-left: .75rem;
  padding-right: .75rem;
}

.table td, .table th { vertical-align: middle; }

textarea.font-monospace { font-size: .85rem; line-height: 1.6; }

/* ---------- 演習画面 ---------- */
.practice-wrap { max-width: 900px; margin: 0 auto; }

.q-stem { font-size: 1.05rem; line-height: 1.85; }

.stmt-label {
  width: 1.9rem; flex: 0 0 1.9rem;
  font-weight: 700; color: #6c757d;
}
.q-statements { line-height: 1.8; }
.q-statements > div { padding-bottom: .4rem; border-bottom: 1px dashed #e3e3e0; }
.q-statements > div:last-child { border-bottom: none; }

.choice-item {
  display: flex; align-items: center; gap: .5rem;
  width: 100%; padding: .6rem .75rem; margin-bottom: .5rem;
  border: 1px solid #dee2e6; border-radius: .375rem;
  background: #fff; cursor: pointer;
}
label.choice-item:hover { background: #f3f6f4; border-color: var(--tohan-accent); }
.choice-item:has(input:checked) {
  border-color: var(--tohan-accent);
  box-shadow: 0 0 0 .15rem rgba(47,111,78,.18);
}
.choice-no {
  flex: 0 0 1.6rem; width: 1.6rem; height: 1.6rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #eceeec; font-weight: 700; font-size: .85rem;
}
.choice-body { flex: 1 1 auto; }
.choice-correct { border-color: #198754; background: #eaf5ee; }
.choice-wrong   { border-color: #dc3545; background: #fbeced; }

.js-conf.active { background: var(--tohan-accent); border-color: var(--tohan-accent); color: #fff; }

/* ---------- 記述ドリル ---------- */
.drill-context {
  font-size: .9rem; color: #6c757d;
  padding: .5rem .75rem; border-left: 3px solid #d8dcd9; background: #f7f8f7;
  border-radius: 0 .25rem .25rem 0;
}
.drill-body { font-size: 1.15rem; line-height: 2; }

.btn-tf { padding: 1.1rem .5rem; font-size: 1.15rem; }
.btn-tf .tf-mark { font-size: 1.6rem; line-height: 1; vertical-align: middle; margin-right: .4rem; }
.btn-tf .tf-text { vertical-align: middle; }

kbd {
  background: #33383d; color: #fff; border-radius: .2rem;
  padding: .1em .4em; font-size: .8em;
}

/* ---------- 模試 ---------- */
.mock-wrap { max-width: 940px; margin: 0 auto; }

.mock-bar {
  position: sticky; top: 0; z-index: 10;
  background: #fff; border: 1px solid #dee2e6; border-radius: .375rem;
  padding: .6rem .9rem;
}
.mock-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 1.1rem;
}
.mock-timer.warn   { color: #b8860b; }
.mock-timer.danger { color: #dc3545; }

.nav-grid { display: flex; flex-wrap: wrap; gap: .3rem; }
.nav-cell {
  width: 2.1rem; height: 2.1rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #ced4da; border-radius: .25rem;
  font-size: .78rem; text-decoration: none; color: #495057; background: #fff;
  position: relative;
}
.nav-cell:hover { border-color: var(--tohan-accent); }
.nav-cell.done { background: #d9ece0; border-color: #9ccdb2; color: #16603a; }
.nav-cell.none { background: #fff; color: #adb5bd; }
.nav-cell.flag::after {
  content: ''; position: absolute; top: -2px; right: -2px;
  width: .5rem; height: .5rem; border-radius: 50%; background: #ffc107;
}
.nav-cell.current { outline: 2px solid var(--tohan-accent); outline-offset: 1px; font-weight: 700; }

.legend {
  display: inline-block; width: .8rem; height: .8rem;
  border: 1px solid #ced4da; border-radius: .15rem; vertical-align: -1px;
}
.legend-done { background: #d9ece0; border-color: #9ccdb2; }
.legend-flag { background: #ffc107; border-color: #d9a406; }
.legend-none { background: #fff; }

.cutoff-line {
  position: absolute; top: -2px; bottom: -2px; width: 2px;
  background: #212529; opacity: .55;
}

/* ---------- 統計 ---------- */
.daily-chart {
  display: flex; align-items: flex-end; gap: 2px;
  height: 90px; border-bottom: 1px solid #dee2e6;
}
.daily-col { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; }
.daily-bar {
  width: 100%; background: var(--tohan-accent); border-radius: 2px 2px 0 0;
  min-height: 0;
}
.daily-col:hover .daily-bar { background: #1f4d36; }

/* ---------- 継続支援 ---------- */
.progress-wrap { max-width: 1000px; margin: 0 auto; }

.streak-num {
  font-size: 3.2rem; font-weight: 700; line-height: 1;
  color: var(--tohan-accent);
}

.quest-item { padding-left: .25rem; }
.quest-item.done { opacity: .7; }
.quest-check {
  display: inline-block; width: 1.25rem; font-weight: 700; color: #198754;
}
.quest-item.done .fw-bold { text-decoration: line-through; }

.cal-grid {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  gap: 3px;
  justify-content: start;
}
.cal-cell {
  width: 13px; height: 13px; border-radius: 2px;
  background: #ebedec; border: 1px solid rgba(0,0,0,.04);
}
.cal-cell.lv1 { background: #cfe3d7; }
.cal-cell.lv2 { background: #9ccdb2; }
.cal-cell.lv3 { background: #5da881; }
.cal-cell.lv4 { background: var(--tohan-accent); }
.cal-cell.today  { outline: 2px solid #212529; outline-offset: 1px; }
.cal-cell.future { background: #f6f7f6; border-style: dashed; }

.ach-item {
  display: flex; gap: .5rem; align-items: flex-start;
  border: 1px solid #e3e3e0; border-radius: .375rem;
  padding: .5rem .6rem; height: 100%; background: #fafbfa;
}
.ach-item.got { background: #fff; border-color: #9ccdb2; }
.ach-icon { font-size: 1.3rem; line-height: 1.2; color: #ced4da; }
.ach-icon.unlocked { color: #e0a800; }
.ach-desc { font-size: .75rem; color: #6c757d; line-height: 1.4; }
.ach-date { font-size: .7rem; color: #adb5bd; }
