/*
 * 受験の歴史ノート（/study/）。このファイルだけで見た目が決まる（サイト共通の all.css は読まない）。
 * 前半は highsto-learn の base.css から、使う所（色・ボタン・ダイアログ・人物解説）だけを写したもの。
 * 方向性: 「昔の日本だな」と分かる、親しみやすい雰囲気。陣幕の紺・和紙の生成り・朱・金。
 * フォントは端末にあるものだけ。本文は UD フォントを優先。
 * 読む・書きこむページなので、和紙の明るい地に、文字を大きく。
 * 赤シート: 用語は朱色。オンにすると朱色の帯で隠れ、タッチした所だけ見える。
 */
:root {
  color-scheme: light;
  --navy: #1f2f4a;
  --navy-2: #2d4470;
  --paper: #f3ead6;
  --paper-hi: #fffaf0;
  --ink: #23262b;
  --ink-soft: #5b5a55;
  --accent: #c8452b;
  --accent-deep: #9d3019;
  --gold: #c39a3e;
  --gold-hi: #e9c46a;
  --line: #d9ccb0;
  --mincho:
    'Hiragino Mincho ProN', 'Yu Mincho', 'YuMincho', 'Noto Serif JP', serif;
  --gothic:
    'BIZ UDPGothic', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Yu Gothic',
    'Noto Sans JP', sans-serif;
  --radius: 12px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--navy);
  color: var(--ink);
  font-family: var(--gothic);
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--gold-hi);
  outline-offset: 3px;
}

/* ---------- ボタン ---------- */
.btn-main,
.btn-sub {
  min-height: 52px;
  padding: 10px 22px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 18px;
  letter-spacing: 1px;
}
.btn-main {
  border: 0;
  background: linear-gradient(#d4553a, var(--accent-deep));
  color: var(--paper-hi);
  box-shadow:
    0 4px 0 #6e200f,
    inset 0 1px 0 #ffffff40;
}
.btn-main:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #6e200f;
}
.btn-sub {
  border: 2px solid var(--navy);
  background: var(--paper-hi);
  color: var(--navy);
}

/* ---------- ダイアログ ---------- */
dialog {
  border: 0;
  border-radius: 18px;
  padding: 28px;
  background: var(--paper-hi);
  color: var(--ink);
  box-shadow: 0 24px 60px #0b1424a0;
  max-width: min(520px, 92vw);
  width: 92vw;
  text-align: center;
}
dialog::backdrop {
  background: #0b1424b0;
}
dialog h2 {
  margin: 0 0 8px;
  font: 800 26px var(--mincho);
  color: var(--navy);
}
dialog p {
  font-size: 16px;
  line-height: 1.8;
}
dialog .btn-main,
dialog .btn-sub {
  width: 100%;
  margin-top: 6px;
}
/* ---------- 人物解説 ---------- */
.person h3 {
  margin: 14px 0 4px;
  font-size: 16px;
  color: var(--navy);
}
.person-kana {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
}
.person-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}
.person-meta span {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--paper);
  font-size: 14px;
  font-weight: bold;
}
.person-alias {
  margin: 6px 0 2px;
  font: 800 18px var(--mincho);
  color: var(--accent-deep);
}
.person-text {
  margin: 4px 0;
  font-size: 17px;
  line-height: 1.85;
}
.person-note {
  margin: 4px 0;
  color: var(--ink-soft);
  font-size: 14px;
}
.person-events {
  margin: 0;
  padding: 0;
  list-style: none;
}
.person-events li {
  display: grid;
  grid-template-columns: 4.8em 1fr;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.6;
}
.person-events b {
  color: var(--navy);
}
.person-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.person-tags li {
  padding: 2px 10px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: #fff4d6;
  font-size: 14px;
}
.person-related,
.person-column {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
}

/* ---------- 受験の歴史ノート ---------- */
body.study {
  height: auto;
  min-height: 100%;
  background: var(--paper);
  overscroll-behavior: auto;
  --term: #c8302b;
  --sheet: #e3473f;
  --good: #2f7d4f;
  --partial: #c98a12;
  --again: #c8302b;
}
.study a {
  color: inherit;
}
/* ボタンの形のリンクは、ボタンの文字色にする（上の inherit のほうが強いため） */
.study a.btn-main {
  color: var(--paper-hi);
}
.study a.btn-sub {
  color: var(--navy);
}

/* ---------- 上の帯 ---------- */
.st-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px max(16px, env(safe-area-inset-right)) 10px
    max(16px, env(safe-area-inset-left));
  background: var(--navy);
  color: var(--paper-hi);
  box-shadow: 0 2px 0 var(--gold);
}
.st-brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.2;
  min-width: 0;
}
.st-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.st-site-logo {
  display: block;
  flex-shrink: 0;
  padding-right: 10px;
  border-right: 1px solid #ffffff40;
}
.st-site-logo img {
  display: block;
  width: auto;
  height: 38px;
}
.st-brand-name {
  font: 800 20px var(--mincho);
  white-space: nowrap;
}
.st-level {
  display: flex;
  flex-shrink: 0;
  padding: 3px;
  border-radius: 999px;
  background: #ffffff1f;
}
.st-level button {
  min-height: 36px;
  padding: 4px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--paper-hi);
  font-size: 14px;
  font-weight: bold;
}
.st-level button[aria-pressed='true'] {
  background: var(--paper-hi);
  color: var(--navy);
}

/* ---------- 本文の枠 ---------- */
.st-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}
.st-loading {
  color: var(--ink-soft);
}
.st-h2 {
  margin: 28px 0 10px;
  font: 800 20px var(--mincho);
  color: var(--navy);
}

/* ---------- トップ ---------- */
.st-hero {
  padding: 20px;
  border-radius: var(--radius);
  background: var(--paper-hi);
  border: 1px solid var(--line);
}
.st-hero h1 {
  margin: 0 0 6px;
  font: 800 24px/1.4 var(--mincho);
  color: var(--navy);
}
.st-hero p {
  margin: 0;
  line-height: 1.8;
}
.st-hero-stats {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}
.st-stat {
  flex: 1;
  padding: 8px;
  border-radius: 10px;
  background: var(--paper);
  text-align: center;
}
.st-stat b {
  display: block;
  font-size: 20px;
  color: var(--navy);
}
.st-stat span {
  font-size: 13px;
  color: var(--ink-soft);
}
.st-hero-actions,
.st-qa-modes {
  display: grid;
  gap: 10px;
}
.st-hero-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}
.st-units {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.st-unit {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-hi);
  text-decoration: none;
}
.st-unit:active {
  background: #fff3dc;
}
.st-unit-no {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--paper-hi);
  font-weight: bold;
}
.st-unit-main {
  display: grid;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.st-unit-title {
  font: 800 18px var(--mincho);
  color: var(--navy);
}
.st-unit-period {
  font-size: 13px;
  color: var(--ink-soft);
}
.st-meter {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.st-meter-bar {
  display: flex;
  flex: 1;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}
.st-meter-good {
  background: var(--good);
}
.st-meter-partial {
  background: var(--partial);
}
.st-meter-again {
  background: var(--again);
}
.st-meter-text {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.st-foot {
  margin: 28px 0 0;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-soft);
}

/* ---------- 単元 ---------- */
.study a.st-back {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 18px 6px 14px;
  border: 2px solid var(--navy);
  border-radius: 999px;
  background: var(--paper-hi);
  color: var(--navy);
  font-size: 15px;
  font-weight: bold;
  text-decoration: none;
}
.st-unit-kicker {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--accent-deep);
  font-weight: bold;
}
.st-unit-head h1 {
  margin: 2px 0 4px;
  font: 800 26px/1.3 var(--mincho);
  color: var(--navy);
}
.st-lead {
  margin: 0;
  line-height: 1.7;
  color: var(--ink-soft);
}
.st-tabs {
  position: sticky;
  top: 62px;
  z-index: 5;
  display: flex;
  gap: 4px;
  margin: 14px -16px 0;
  padding: 8px 16px;
  overflow-x: auto;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.st-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: bold;
  font-size: 15px;
  text-decoration: none;
  color: var(--navy);
}
.st-tab[aria-current='page'] {
  background: var(--navy);
  color: var(--paper-hi);
}
.st-tab-body {
  padding-top: 14px;
}
.st-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  font-size: 14px;
}
.st-pager a {
  color: var(--navy);
}
.st-pager-next {
  text-align: right;
}
.st-adv {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--navy-2);
  color: var(--paper-hi);
  font: bold 12px var(--gothic);
  vertical-align: 2px;
}
.st-from {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: var(--ink-soft);
}
.st-empty,
.st-more,
.st-people-note {
  color: var(--ink-soft);
  line-height: 1.7;
}

/* ---------- 赤シート ---------- */
.st-sheet-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.st-sheet-toggle {
  flex-shrink: 0;
  min-height: 40px;
  padding: 6px 14px;
  border: 2px solid var(--sheet);
  border-radius: 999px;
  background: var(--paper-hi);
  color: var(--sheet);
  font-weight: bold;
}
.st-sheet-toggle[aria-pressed='true'] {
  background: var(--sheet);
  color: white;
}
.st-sheet-hint {
  font-size: 13px;
  color: var(--ink-soft);
}
.st-term {
  display: inline;
  padding: 0 1px;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--term);
  font: inherit;
  font-weight: bold;
  cursor: default;
}
.st-term.hidden {
  background: var(--sheet);
  color: transparent;
  cursor: pointer;
  user-select: none;
}

/* ---------- 要点ノート ---------- */
.st-note {
  margin-bottom: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--paper-hi);
  border: 1px solid var(--line);
}
.st-note {
  scroll-margin-top: 120px;
}
.st-note.focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-hi);
}
.st-note h2 {
  margin: 0 0 6px;
  padding-left: 10px;
  border-left: 4px solid var(--accent);
  font: 800 18px var(--mincho);
  color: var(--navy);
}
.st-note-text {
  margin: 0;
  font-size: 17px;
  line-height: 2;
}

/* ---------- 年表 ---------- */
.st-years {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 3px solid var(--gold);
}
.st-years li {
  display: grid;
  grid-template-columns: 7.5em 1fr;
  gap: 8px;
  padding: 10px 0 10px 12px;
  border-bottom: 1px dashed var(--line);
  line-height: 1.6;
}
.st-year {
  justify-self: start;
  text-align: left;
}

/* ---------- 一問一答 ---------- */
.st-qa-start,
.st-qa,
.st-order,
.st-result {
  padding: 18px;
  border-radius: var(--radius);
  background: var(--paper-hi);
  border: 1px solid var(--line);
}
.st-qa-scope {
  margin: 0 0 4px;
  font-weight: bold;
  color: var(--navy);
}
.st-qa-modes {
  margin-top: 16px;
}
.st-qa-how {
  margin: 14px 0 0;
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink-soft);
}
.st-reset {
  margin-top: 10px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 13px;
  text-decoration: underline;
}
.st-qa-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 14px;
}
.st-qa-count {
  font-weight: bold;
  color: var(--navy);
}
.st-prev {
  margin-left: auto;
  font-size: 13px;
  font-weight: bold;
}
.st-prev.good {
  color: var(--good);
}
.st-prev.partial {
  color: var(--partial);
}
.st-prev.again {
  color: var(--again);
}
.st-qa-q {
  margin: 16px 0;
  font-size: 20px;
  font-weight: bold;
  line-height: 1.7;
}
.st-qa-a {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fdeceb;
  color: var(--term);
  font: 800 22px var(--mincho);
}
.st-reveal {
  width: 100%;
}
.st-rates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.st-rate {
  min-height: 56px;
  border: 2px solid;
  border-radius: 12px;
  background: var(--paper-hi);
  font-weight: bold;
  font-size: 16px;
}
.st-rate.good {
  color: var(--good);
}
.st-rate.partial {
  color: var(--partial);
}
.st-rate.again {
  color: var(--again);
}
.st-quit {
  display: block;
  margin: 14px auto 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-size: 14px;
  text-decoration: underline;
}
.st-result h2 {
  margin: 0;
  font: 800 22px var(--mincho);
  color: var(--navy);
  text-align: center;
}
.st-missed {
  margin: 0;
  padding: 0;
  list-style: none;
}
.st-missed li {
  display: grid;
  gap: 2px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.6;
}
.st-missed b {
  color: var(--term);
}

/* 出す問題の選び方。× と △ / △ だけ / × だけ は小さめに横に並べる */
.st-qa-modes-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.st-qa-modes-row .btn-sub {
  min-height: 48px;
  padding: 6px 4px;
  font-size: 15px;
  letter-spacing: 0;
}
.st-qa-modes-row .btn-sub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.3;
}
.st-qa-modes-row .st-mode-count {
  font-size: 13px;
}
.st-qa-modes button:disabled {
  opacity: 0.4;
}

/* 一問一答の解説（要点ノートの段落） */
.st-explain {
  margin-top: 14px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.st-explain summary {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  font-weight: bold;
  color: var(--navy);
}
.st-explain summary::-webkit-details-marker {
  display: none;
}
.st-explain summary::before {
  content: '▸';
  transition: transform 0.15s;
}
.st-explain[open] summary::before {
  transform: rotate(90deg);
}
.st-explain-from {
  margin: 4px 0;
  font-size: 13px;
  color: var(--ink-soft);
}
.st-explain-text {
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.9;
}
.st-ex-term {
  color: var(--term);
}
.st-ex-term.hit {
  background: #ffe9a8;
  color: var(--ink);
  border-radius: 3px;
  padding: 0 2px;
}
.st-explain-link {
  font-size: 14px;
  font-weight: bold;
  color: var(--navy);
}

/* 答え方（思い出す / 4択） */
.st-answer-mode-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 14px;
  font-weight: bold;
  color: var(--navy);
}
.st-answer-mode {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.st-answer-mode button {
  min-height: 36px;
  padding: 4px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--navy);
  font-weight: bold;
}
.st-answer-mode button[aria-pressed='true'] {
  background: var(--navy);
  color: var(--paper-hi);
}
/* 4択の選択肢（ならべかえの選択肢と同じ形） */
.st-option {
  font-size: 17px;
  font-weight: bold;
  white-space: pre-wrap;
}
.st-option:disabled {
  cursor: default;
  opacity: 0.6;
}
.st-option.right {
  border-color: var(--good);
  background: #eaf6ee;
  color: var(--good);
  opacity: 1;
}
.st-option.wrong {
  border-color: var(--again);
  background: #fdeceb;
  color: var(--again);
  opacity: 1;
}
.st-qa .st-judge {
  margin-bottom: 12px;
}

/* ---------- 年代ならべかえ ---------- */
.st-slots {
  display: grid;
  gap: 6px;
  margin: 14px 0;
  padding: 0;
  list-style: none;
}
.st-slots li {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-height: 52px;
}
.st-slot-no {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 32px;
  border-radius: 8px;
  background: var(--navy);
  color: var(--paper-hi);
  font-weight: bold;
}
.st-slot-empty,
.st-slot-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 8px;
  text-align: left;
  line-height: 1.5;
}
.st-slot-empty {
  border: 2px dashed var(--line);
  color: var(--ink-soft);
  font-size: 14px;
}
.st-slot-item {
  border: 2px solid var(--navy);
  background: white;
}
.st-slot-item.done b {
  color: var(--navy);
}
.st-slots li.right .st-slot-item {
  border-color: var(--good);
  background: #eaf6ee;
}
.st-slots li.wrong .st-slot-item {
  border-color: var(--again);
  background: #fdeceb;
}
.st-choices {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}
.st-choice {
  min-height: 48px;
  padding: 8px 12px;
  border: 2px solid var(--gold);
  border-radius: 10px;
  background: #fff8e6;
  text-align: left;
  line-height: 1.5;
}
.st-order > .btn-main {
  width: 100%;
}
.st-judge {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
}
.st-judge.ok {
  color: var(--good);
}
.st-judge.ng {
  color: var(--again);
}

/* ---------- 人物 ---------- */
.st-people {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}
.st-person {
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-hi);
}
.st-person img,
.st-person-noimg {
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 6px;
  object-fit: cover;
}
.st-person-noimg {
  display: grid;
  place-items: center;
  background: var(--navy);
  color: var(--paper-hi);
  font: 800 32px var(--mincho);
}
.st-person-name {
  font-size: 14px;
  font-weight: bold;
}
.st-person-dialog {
  max-height: 88dvh;
  overflow-y: auto;
  text-align: left;
}

@media (max-width: 420px) {
  .st-brand-name {
    font-size: 16px;
  }
  .st-header-brand {
    gap: 8px;
  }
  .st-site-logo {
    padding-right: 8px;
  }
  .st-site-logo img {
    height: 30px;
  }
  .st-level button {
    padding: 4px 10px;
  }
  .st-qa-q {
    font-size: 18px;
  }
  .st-years li {
    grid-template-columns: 6.5em 1fr;
  }
}

/* ---------- トップ: 資料・地図・記述の入口 ---------- */
.st-hero-more {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.st-hero-more a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 6px;
  font-size: 15px;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
}

/* ---------- 写真・絵 ---------- */
.st-figs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.st-fig {
  margin: 0;
}
.st-fig-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #f7f2e6;
}
.st-fig-open img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 220px;
  object-fit: contain;
}
.st-fig figcaption,
.st-pick-exp figcaption {
  display: grid;
  gap: 2px;
  margin-top: 4px;
}
.st-fig-caption {
  font-size: 14px;
  font-weight: bold;
  line-height: 1.5;
}
.st-fig-credit {
  font-size: 11px;
  color: var(--ink-soft);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.st-pick .st-fig-open img {
  max-height: 46vh;
}
.st-image-dialog {
  width: min(960px, 96vw);
  max-width: 96vw;
  max-height: 94dvh;
  padding: 14px;
  overflow-y: auto;
  text-align: left;
}
.st-image-dialog img {
  display: block;
  width: 100%;
  max-height: 72dvh;
  object-fit: contain;
}
.st-image-dialog p {
  margin: 6px 0;
  font-size: 14px;
}

/* ---------- 地図 ---------- */
.st-map-box {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #cfe3ef;
}
.st-map {
  display: block;
  width: 100%;
  height: auto;
  max-height: 60vh;
}
.st-map-sea {
  fill: #cfe3ef;
}
.st-map-other {
  fill: #e6e1d3;
  stroke: #a59c86;
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
}
.st-map-japan {
  fill: #f6ecd2;
  stroke: #7a6a45;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.st-map-borders {
  fill: none;
  stroke: #c4b48d;
  stroke-width: 0.6;
  vector-effect: non-scaling-stroke;
}
.st-map-pin {
  fill: var(--navy);
  stroke: white;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.st-map-mark {
  cursor: pointer;
}
.st-map-mark text {
  fill: white;
  font-weight: bold;
  font-family: var(--gothic);
  pointer-events: none;
}
.st-map-mark.right .st-map-pin {
  fill: var(--good);
}
.st-map-mark.wrong .st-map-pin {
  fill: var(--again);
}
.st-map-ring {
  fill: none;
  stroke: var(--again);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}
.st-map-dot {
  fill: var(--again);
}
.st-choices-labels {
  grid-template-columns: repeat(4, 1fr);
}
.st-option-label {
  text-align: center;
  font-size: 20px;
}

/* ---------- 資料・地図の解説 ---------- */
.st-kind {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 12px;
  font-weight: bold;
}
.st-pick-exp {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 15px;
  line-height: 1.8;
}
.st-pick-exp p {
  margin: 0 0 6px;
}

/* ---------- 記述 ---------- */
.st-essay-limit {
  margin: -8px 0 8px;
  font-size: 14px;
  color: var(--ink-soft);
}
.st-essay-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: white;
  font: 17px/1.7 var(--gothic);
  resize: vertical;
}
.st-essay-input:focus {
  border-color: var(--navy);
  outline: none;
}
.st-essay-bar {
  display: flex;
  justify-content: flex-end;
  margin: 4px 0 10px;
}
.st-essay-count {
  font-size: 13px;
  color: var(--ink-soft);
}
.st-essay-count.over {
  color: var(--again);
  font-weight: bold;
}
.st-essay-result h3 {
  margin: 14px 0 6px;
  font-size: 15px;
  color: var(--navy);
}
.st-essay-keys ul,
.st-essay-points ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.st-essay-keys li {
  display: flex;
  gap: 8px;
  padding: 4px 0;
  font-weight: bold;
}
.st-essay-keys li.ok {
  color: var(--good);
}
.st-essay-keys li.ng {
  color: var(--again);
}
.st-essay-model p {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #eef3fb;
  line-height: 1.8;
}
.st-essay-points li label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 4px 0;
  line-height: 1.6;
}
.st-essay-points input {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  flex-shrink: 0;
}
.st-essay-rate-how {
  margin: 16px 0 6px;
  font-weight: bold;
}

/* ---------- 出典の一覧 ---------- */
.st-credit-item {
  line-height: 1.7;
}
.st-credits {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.st-credits li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper-hi);
  font-size: 13px;
  line-height: 1.6;
}
.st-credits li > div {
  display: grid;
  gap: 2px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.st-credits b {
  font-size: 14px;
}
.st-credit-thumb {
  padding: 0;
  border: 0;
  background: none;
}
.st-credit-thumb img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 6px;
}

/* ---------- 人物の肖像画 ---------- */
.st-person img.portrait {
  object-position: center top;
  background: var(--paper);
}
.st-person-portrait {
  max-width: 220px;
  margin: 0 auto 12px;
}
.st-person-portrait .st-fig img {
  max-height: 260px;
  object-fit: contain;
}
.st-tab-body > .st-h2 + .st-answer-mode-row {
  margin-top: 4px;
}
.st-person-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--navy);
  font: inherit;
  font-weight: bold;
  text-decoration: underline;
  cursor: pointer;
}
.st-person-portrait .st-answer-mode-row {
  justify-content: center;
  margin: 0 0 10px;
}
.st-person-card {
  display: block;
  width: 100%;
  max-width: 200px;
  aspect-ratio: 63 / 88;
  margin: 0 auto;
  border-radius: 8px;
  background: var(--paper);
}
.st-person-back {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--navy);
  font: inherit;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

/* JavaScript が動く前（クローラー向け）の見出し。動くと描き直す */
.st-loading-title {
  margin: 8px 0;
  font: 800 22px/1.4 var(--mincho);
  color: var(--navy);
}

/* ---------- シェア ---------- */
.st-share-wrap {
  margin-top: 12px;
}
/* 「シェアする」: 朱色で目立たせる */
.st-share-toggle {
  min-height: 42px;
  padding: 6px 20px 6px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 15px;
  font-weight: bold;
  box-shadow: 0 3px 0 var(--accent-deep);
}
.st-share-toggle::before {
  content: '↗ ' / '';
}
.st-share-toggle[aria-expanded='true'] {
  background: var(--accent-deep);
}
.st-share {
  margin-top: 10px;
}
.st-share-label {
  margin: 0 0 6px;
  font-weight: bold;
  color: var(--navy);
}
.st-share-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.st-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 14px;
  border: 2px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: bold;
  text-decoration: none;
  line-height: 1.2;
}
.st-share-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.st-share-btn.is-x {
  background: #000;
  color: #fff;
}
.st-share-btn.is-line {
  background: #06c755;
  color: #fff;
}
.st-share-btn.is-copy,
.st-share-btn.is-more {
  border-color: var(--navy);
  background: var(--paper-hi);
  color: var(--navy);
}

/* 結果の画面のシェア */
.st-result-share {
  margin: 14px 0;
  padding: 14px;
  border: 2px dashed var(--gold);
  border-radius: var(--radius);
  background: #fff4d6;
}
.st-result-share .st-share {
  margin-top: 0;
}
.st-result-share .st-card-open {
  margin-top: 12px;
}

/* ---------- 成績カード ---------- */
.st-hero-share {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
}
.st-hero-share .st-share-wrap {
  display: contents;
}
/* 開いたボタンの並びは次の行に（「シェアする」の位置を動かさない） */
.st-hero-share .st-share {
  flex-basis: 100%;
  margin-top: 0;
}
.st-card-open {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 42px;
  padding: 6px 18px;
  border: 2px solid var(--gold);
  border-radius: 12px;
  background: var(--navy);
  color: var(--gold-hi);
  text-align: left;
  line-height: 1.3;
}
.st-card-open-main {
  font: 800 16px var(--mincho);
  color: var(--paper-hi);
}
.st-card-open-sub {
  font-size: 12px;
  font-weight: bold;
}
.st-card-dialog {
  width: min(760px, 96vw);
  max-width: 96vw;
  max-height: 94dvh;
  padding: 18px;
  overflow-y: auto;
  text-align: left;
}
.st-card-head {
  position: relative;
}
.st-card-dialog h2 {
  text-align: center;
}
/* 右上の「?」（ランクの決まり方） */
.st-rank-help {
  position: absolute;
  top: -4px;
  right: 0;
  width: 40px;
  height: 40px;
  border: 2px solid var(--navy);
  border-radius: 50%;
  background: var(--paper-hi);
  color: var(--navy);
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
}
.st-rank-help[aria-expanded='true'] {
  background: var(--navy);
  color: var(--paper-hi);
}
.st-rank-panel {
  margin: 8px 0 12px;
  padding: 12px 14px;
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  background: #fff4d6;
}
.st-rank-panel-lead {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.6;
}
.st-rank-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}
.st-rank-table th,
.st-rank-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.st-rank-table thead th {
  font-size: 12px;
  color: var(--ink-soft);
}
.st-rank-table tbody th {
  font-family: var(--mincho);
  color: var(--navy);
}
.st-rank-table tr.is-current {
  background: var(--accent);
  color: var(--paper-hi);
}
.st-rank-table tr.is-current th {
  color: var(--paper-hi);
}
.st-rank-table td:last-child {
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}
.st-card-lead {
  margin: 0 0 10px;
}
.st-card-label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-weight: bold;
  color: var(--navy);
}
.st-card-name {
  flex: 1 1 200px;
  min-height: 44px;
  padding: 6px 12px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: white;
  font-size: 16px;
}
.st-card-note {
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.st-card-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1200 / 675;
  margin: 10px 0;
  border-radius: 10px;
  background: var(--navy);
}
.st-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.st-card-actions button {
  flex: 1 1 160px;
  width: auto;
  margin-top: 0;
}
.st-card-dialog .st-close {
  margin-top: 14px;
}

/* ---------- ページの下: ハイストの紹介 ---------- */
.st-about {
  margin-top: 24px;
  padding: 28px 16px calc(28px + env(safe-area-inset-bottom));
  background: var(--navy);
  color: var(--paper);
  border-top: 4px solid var(--gold);
}
.st-about-inner {
  max-width: 760px;
  margin: 0 auto;
}
.st-about-logo img {
  display: block;
  width: auto;
  height: 48px;
}
.st-about h2 {
  margin: 14px 0 6px;
  font: 800 19px/1.4 var(--mincho);
  color: var(--gold-hi);
}
.st-about p {
  margin: 0;
  line-height: 1.8;
}
.st-about-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  padding: 0;
  list-style: none;
}
.st-about-links a {
  display: inline-block;
  padding: 8px 14px;
  border: 1px solid #ffffff55;
  border-radius: 999px;
  color: var(--paper-hi);
  font-size: 14px;
  font-weight: bold;
  text-decoration: none;
}
.st-about-links li:first-child a {
  border-color: var(--gold-hi);
  background: var(--gold-hi);
  color: var(--navy);
}
.st-about-copy {
  font-size: 13px;
  color: #f3ead6b0;
}
.st-about-copy a {
  color: inherit;
}

/* ---------- 「基本」と「発展も」の基準 ---------- */
.st-level-note {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-hi);
}
.st-level-note h2 {
  margin: 0 0 10px;
  font: 800 18px var(--mincho);
  color: var(--navy);
}
.st-level-note dl {
  display: grid;
  gap: 8px;
  margin: 0;
}
.st-level-row {
  display: grid;
  grid-template-columns: 4.5em 1fr;
  gap: 10px;
  align-items: baseline;
  padding: 8px 10px;
  border-radius: 10px;
}
.st-level-row.is-current {
  background: #fff4d6;
  outline: 2px solid var(--gold);
}
.st-level-row dt {
  font-weight: bold;
  color: var(--navy);
}
.st-level-row dd {
  margin: 0;
  line-height: 1.7;
}
.st-level-now {
  display: inline-block;
  margin-left: 6px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--paper-hi);
  font-size: 12px;
  font-weight: bold;
}
.st-level-note p {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

/* カードのコラムへの補足（受験で誤解しやすい所） */
.person-column-note {
  margin: 4px 0 0;
  padding: 6px 10px;
  border-left: 3px solid var(--accent);
  background: #fff4d6;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.7;
}
