/* =====================================================================
   強化学習の強化合宿 特設サイト
   親サイト共通の header / footer（ダーク）はそのまま使い、本文領域を明るい読書面にする。
   クラス名はすべて rl- で始め、親サイトの CSS と衝突させない。
   ===================================================================== */
:root {
	/* 共通ヘッダー（position: fixed）の高さ。rl.js が実寸で上書きする */
	--rl-header-h: 110px;
	--rl-bg: #f3f6fa;
	--rl-surface: #ffffff;
	--rl-surface-2: #eef3f8;
	--rl-line: #d5dee8;
	--rl-text: #1c2b3a;
	--rl-muted: #4a5b6d;
	--rl-navy: #12305a;
	--rl-blue: #1f5fbf;
	--rl-blue-dark: #174a96;
	--rl-blue-soft: #e5eefb;
	--rl-teal: #0a6f73;
	--rl-teal-soft: #e0f2f1;
	--rl-amber: #8a5300;
	--rl-amber-soft: #fff3db;
	--rl-radius: 10px;
	--rl-wide: 1120px;
	--rl-measure: 860px;
	--rl-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "BIZ UDGothic", "Noto Sans Mono CJK JP", monospace;
}

body.rl-body {
	background: var(--rl-bg);
	color: var(--rl-text);
}

.rl-site {
	padding-top: var(--rl-header-h);
	color: var(--rl-text);
	line-height: 1.75;
}

.rl-site *,
.rl-site *::before,
.rl-site *::after {
	box-sizing: border-box;
}

/* 親サイトの header.css は nav 要素すべてを右寄せの flex にし、nav a に余白と下線アニメーションを付けている。
   特設サイト内の nav（パンくず・目次など）では打ち消す。:where() で詳細度を上げず、下の個別指定を優先させる */
:where(.rl-site) nav {
	display: block;
	flex-wrap: nowrap;
	justify-content: normal;
	width: auto;
}

:where(.rl-site) nav a {
	margin-left: 0;
	padding: 0;
	position: static;
	font-size: inherit;
	white-space: normal;
	transition: none;
}

:where(.rl-site) nav a::after {
	content: none;
}

/* 親サイトの a { color: シアン } は白地でコントラストが足りないので上書きする */
.rl-site a,
.rl-site a:visited {
	color: var(--rl-blue);
	text-decoration: underline;
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

.rl-site a:hover {
	color: var(--rl-blue-dark);
	text-decoration-thickness: 2px;
}

.rl-site a:focus-visible,
.rl-site button:focus-visible,
.rl-site summary:focus-visible,
.rl-site [tabindex]:focus-visible {
	outline: 3px solid #f0a400;
	outline-offset: 2px;
	border-radius: 3px;
}

/* 見出しは文節で改行する（対応ブラウザのみ。非対応でも通常の改行になるだけ） */
.rl-site h1,
.rl-site h2,
.rl-site h3,
.rl-lead {
	word-break: auto-phrase;
}

.rl-skip {
	position: absolute;
	left: -9999px;
	top: auto;
}

.rl-skip:focus {
	position: fixed;
	left: 16px;
	top: calc(var(--rl-header-h) + 8px);
	z-index: 2000;
	background: #fff;
	padding: 8px 14px;
	border-radius: 6px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}

.rl-container {
	max-width: var(--rl-wide);
	margin: 0 auto;
	padding: 0 24px;
}

/* ----- サブバー（パンくず・特設サイト内ナビ） ----- */
.rl-subbar {
	background: var(--rl-surface);
	border-bottom: 1px solid var(--rl-line);
	position: sticky;
	top: var(--rl-header-h);
	z-index: 900;
}

.rl-subbar-inner {
	max-width: var(--rl-wide);
	margin: 0 auto;
	padding: 0 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px 24px;
	min-height: 52px;
	flex-wrap: wrap;
}

.rl-breadcrumb ol {
	list-style: none;
	margin: 0;
	padding: 8px 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	font-size: 0.88rem;
	color: var(--rl-muted);
}

.rl-breadcrumb li + li::before {
	content: "›";
	margin: 0 0.6em;
	color: #8796a6;
}

.rl-breadcrumb [aria-current="page"] {
	color: var(--rl-navy);
	font-weight: bold;
}

.rl-localnav {
	display: flex;
	gap: 2px;
	overflow-x: auto;
	scrollbar-width: none;
	margin: 0 -8px;
}

.rl-localnav::-webkit-scrollbar {
	display: none;
}

.rl-site .rl-localnav a,
.rl-site .rl-localnav a:visited {
	flex: 0 0 auto;
	color: var(--rl-navy);
	text-decoration: none;
	padding: 14px 10px 12px 10px;
	font-size: 0.93rem;
	border-bottom: 3px solid transparent;
	white-space: nowrap;
}

.rl-site .rl-localnav a:hover,
.rl-site .rl-localnav a.is-current {
	border-bottom-color: var(--rl-teal);
	color: var(--rl-navy);
}

/* ----- 見出し・区画 ----- */
.rl-section {
	padding: 56px 0 8px 0;
	scroll-margin-top: calc(var(--rl-header-h) + 60px);
}

.rl-section-head {
	margin-bottom: 24px;
}

.rl-h2 {
	margin: 0 0 10px 0;
	font-size: 1.65rem;
	line-height: 1.4;
	color: var(--rl-navy);
	padding-left: 14px;
	border-left: 5px solid var(--rl-teal);
}

.rl-section-lead {
	margin: 0;
	color: var(--rl-muted);
	max-width: 48em;
}

.rl-h3 {
	margin: 0 0 12px 0;
	font-size: 1.2rem;
	color: var(--rl-navy);
	line-height: 1.5;
}

.rl-card {
	background: var(--rl-surface);
	border: 1px solid var(--rl-line);
	border-radius: var(--rl-radius);
	padding: 22px 24px;
}

.rl-grid-3 {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
}

.rl-grid-2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}

/* ----- ヒーロー ----- */
.rl-hero {
	padding: 48px 0 16px 0;
	scroll-margin-top: calc(var(--rl-header-h) + 60px);
}

.rl-hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: 40px;
	align-items: center;
}

.rl-eyebrow {
	margin: 0 0 10px 0;
	color: var(--rl-teal);
	font-size: 0.8rem;
	font-weight: bold;
	letter-spacing: 0.2em;
	text-transform: uppercase;
}

.rl-title {
	margin: 0 0 14px 0;
	font-size: clamp(2rem, 4.6vw, 3rem);
	line-height: 1.25;
	color: var(--rl-navy);
	letter-spacing: 0.02em;
}

.rl-title span {
	background: linear-gradient(transparent 68%, #cfe3f8 68%);
	padding: 0 0.08em;
}

.rl-lead {
	margin: 0 0 16px 0;
	font-size: 1.2rem;
	font-weight: bold;
	color: var(--rl-blue-dark);
	line-height: 1.6;
}

.rl-intro {
	margin: 0 0 24px 0;
	max-width: 40em;
}

.rl-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.rl-site a.rl-btn,
.rl-site a.rl-btn:visited {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 12px 22px;
	border-radius: 8px;
	font-weight: bold;
	text-decoration: none;
	border: 2px solid var(--rl-blue);
	line-height: 1.3;
}

.rl-site a.rl-btn-primary,
.rl-site a.rl-btn-primary:visited {
	background: var(--rl-blue);
	color: #fff;
}

.rl-site a.rl-btn-primary:hover {
	background: var(--rl-blue-dark);
	border-color: var(--rl-blue-dark);
	color: #fff;
}

.rl-site a.rl-btn-secondary,
.rl-site a.rl-btn-secondary:visited {
	background: var(--rl-surface);
	color: var(--rl-blue);
}

.rl-site a.rl-btn-secondary:hover {
	background: var(--rl-blue-soft);
	color: var(--rl-blue-dark);
}

.rl-hero-figure {
	margin: 0;
	background: var(--rl-surface);
	border: 1px solid var(--rl-line);
	border-radius: 16px;
	padding: 18px 18px 14px 18px;
}

.rl-hero-figure svg {
	display: block;
	width: 100%;
	height: auto;
}

.rl-hero-figure figcaption {
	margin-top: 8px;
	font-size: 0.85rem;
	color: var(--rl-muted);
	line-height: 1.6;
}

.rl-math-i {
	font-family: "Times New Roman", "STIX Two Math", serif;
	font-style: italic;
}

/* ----- 特徴・目標 ----- */
.rl-feature {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.rl-feature .rl-icon {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--rl-teal-soft);
	color: var(--rl-teal);
	display: grid;
	place-items: center;
	margin-bottom: 6px;
}

.rl-feature h3 {
	margin: 0;
	font-size: 1.1rem;
	color: var(--rl-navy);
	line-height: 1.5;
}

.rl-feature p {
	margin: 0;
	color: var(--rl-muted);
	font-size: 0.95rem;
}

.rl-goals {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: goal;
}

.rl-goals li {
	position: relative;
	padding: 0 0 0 48px;
	counter-increment: goal;
}

.rl-goals li::before {
	content: counter(goal);
	position: absolute;
	left: 0;
	top: 0;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: var(--rl-navy);
	color: #fff;
	font-weight: bold;
	display: grid;
	place-items: center;
}

.rl-goals strong {
	display: block;
	color: var(--rl-navy);
	font-size: 1.05rem;
}

.rl-goals span {
	color: var(--rl-muted);
	font-size: 0.95rem;
}

.rl-note {
	margin: 14px 0 0 0;
	font-size: 0.88rem;
	color: var(--rl-muted);
}

/* ----- 状態ラベル（色だけに頼らず、文字と記号で区別する） ----- */
.rl-status {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 0.8rem;
	font-weight: bold;
	white-space: nowrap;
	border: 1px solid currentColor;
	line-height: 1.6;
}

.rl-status-public {
	color: var(--rl-teal);
	background: var(--rl-teal-soft);
}

.rl-status-public::before {
	content: "●";
	font-size: 0.7em;
}

.rl-status-preparing {
	color: var(--rl-amber);
	background: var(--rl-amber-soft);
}

.rl-status-preparing::before {
	content: "◐";
	font-size: 0.85em;
}

.rl-status-planned {
	color: var(--rl-muted);
	background: var(--rl-surface-2);
	border-style: dashed;
}

.rl-status-planned::before {
	content: "○";
	font-size: 0.8em;
}

.rl-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 20px;
	margin: 0 0 20px 0;
	padding: 0;
	list-style: none;
	font-size: 0.88rem;
	color: var(--rl-muted);
}

.rl-legend li {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* ----- 教材 ----- */
.rl-empty {
	background: var(--rl-surface);
	border: 1px dashed #a9b8c8;
	border-radius: var(--rl-radius);
	padding: 26px 24px;
	display: flex;
	gap: 18px;
	align-items: flex-start;
}

.rl-empty .rl-icon {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--rl-amber-soft);
	color: var(--rl-amber);
	display: grid;
	place-items: center;
}

.rl-empty p {
	margin: 0 0 6px 0;
}

.rl-empty p:last-child {
	margin-bottom: 0;
}

.rl-empty strong {
	color: var(--rl-navy);
}

.rl-material-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 18px;
}

.rl-material {
	display: flex;
	flex-direction: column;
	gap: 8px;
	height: 100%;
}

.rl-material-num {
	font-size: 0.85rem;
	color: var(--rl-teal);
	font-weight: bold;
	letter-spacing: 0.05em;
}

.rl-material h3 {
	margin: 0;
	font-size: 1.2rem;
	line-height: 1.5;
}

.rl-site .rl-material h3 a,
.rl-site .rl-material h3 a:visited {
	color: var(--rl-navy);
}

.rl-material-sub {
	margin: 0;
	color: var(--rl-muted);
	font-size: 0.93rem;
}

.rl-meta-line {
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	font-size: 0.83rem;
	color: var(--rl-muted);
}

.rl-dl-links {
	list-style: none;
	margin: auto 0 0 0;
	padding: 8px 0 0 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	font-size: 0.9rem;
	border-top: 1px solid var(--rl-line);
}

/* ----- ロードマップ ----- */
.rl-roadmap {
	list-style: none;
	margin: 0 0 32px 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 34px;
	position: relative;
}

.rl-phase-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	height: 100%;
	border-top: 5px solid var(--rl-phase-color, var(--rl-blue));
}

.rl-roadmap li:not(:last-child) .rl-phase-card::after {
	content: "";
	position: absolute;
	right: -27px;
	top: 50%;
	width: 18px;
	height: 18px;
	border-top: 3px solid #8aa0b8;
	border-right: 3px solid #8aa0b8;
	transform: translateY(-50%) rotate(45deg);
}

.rl-phase-card[data-phase="1"] { --rl-phase-color: var(--rl-blue); }
.rl-phase-card[data-phase="2"] { --rl-phase-color: var(--rl-teal); }
.rl-phase-card[data-phase="3"] { --rl-phase-color: var(--rl-navy); }

.rl-phase-no {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--rl-phase-color);
	font-weight: bold;
	font-size: 0.85rem;
	letter-spacing: 0.05em;
}

.rl-phase-no b {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--rl-phase-color);
	color: #fff;
	display: grid;
	place-items: center;
	font-size: 1rem;
}

.rl-phase-card h3 {
	margin: 0;
	font-size: 1.15rem;
	color: var(--rl-navy);
	line-height: 1.45;
}

.rl-phase-card p {
	margin: 0;
	font-size: 0.92rem;
	color: var(--rl-muted);
	flex: 1;
}

.rl-phase-card .rl-phase-link {
	font-size: 0.9rem;
	margin-top: 4px;
}

.rl-phase {
	margin: 0 0 28px 0;
	scroll-margin-top: calc(var(--rl-header-h) + 60px);
}

.rl-phase-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 14px;
	margin: 0 0 10px 0;
}

.rl-phase-head h3 {
	margin: 0;
	font-size: 1.2rem;
	color: var(--rl-navy);
}

.rl-phase-head span {
	color: var(--rl-muted);
	font-size: 0.9rem;
}

.rl-lessons {
	list-style: none;
	margin: 0;
	padding: 0;
	background: var(--rl-surface);
	border: 1px solid var(--rl-line);
	border-radius: var(--rl-radius);
	overflow: hidden;
}

.rl-lesson-row {
	display: grid;
	grid-template-columns: 3.2em minmax(0, 1fr) auto;
	gap: 6px 16px;
	align-items: start;
	padding: 14px 20px;
	border-top: 1px solid var(--rl-line);
	scroll-margin-top: calc(var(--rl-header-h) + 70px);
}

.rl-lesson-row:first-child {
	border-top: none;
}

.rl-lesson-no {
	font-family: var(--rl-mono);
	font-weight: bold;
	font-size: 1.05rem;
	color: var(--rl-navy);
	background: var(--rl-surface-2);
	border-radius: 6px;
	text-align: center;
	padding: 2px 0;
}

.rl-lesson-title {
	margin: 0;
	font-weight: bold;
	color: var(--rl-navy);
	line-height: 1.5;
}

.rl-lesson-topics {
	margin: 2px 0 0 0;
	font-size: 0.9rem;
	color: var(--rl-muted);
	line-height: 1.65;
}

/* ----- 学び方 ----- */
.rl-cycle {
	list-style: none;
	margin: 0 0 12px 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 26px;
	counter-reset: step;
}

.rl-cycle li {
	position: relative;
	background: var(--rl-surface);
	border: 1px solid var(--rl-line);
	border-radius: var(--rl-radius);
	padding: 18px 16px 16px 16px;
	counter-increment: step;
}

.rl-cycle li::before {
	content: counter(step);
	position: absolute;
	top: -13px;
	left: 14px;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--rl-teal);
	color: #fff;
	font-weight: bold;
	font-size: 0.85rem;
	display: grid;
	place-items: center;
}

.rl-cycle li:not(:last-child)::after {
	content: "";
	position: absolute;
	right: -20px;
	top: 50%;
	width: 12px;
	height: 12px;
	border-top: 3px solid #8aa0b8;
	border-right: 3px solid #8aa0b8;
	transform: translateY(-50%) rotate(45deg);
}

.rl-cycle h3 {
	margin: 4px 0 6px 0;
	font-size: 1.05rem;
	color: var(--rl-navy);
}

.rl-cycle p {
	margin: 0;
	font-size: 0.9rem;
	color: var(--rl-muted);
	line-height: 1.65;
}

.rl-cycle-loop {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 30px 0;
	color: var(--rl-teal);
	font-weight: bold;
	font-size: 0.92rem;
}

.rl-cycle-loop::before {
	content: "";
	flex: 1;
	max-width: 80px;
	height: 0;
	border-top: 2px dashed var(--rl-teal);
}

.rl-table-plain {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.93rem;
}

.rl-table-plain th,
.rl-table-plain td {
	text-align: left;
	vertical-align: top;
	padding: 10px 12px;
	border-top: 1px solid var(--rl-line);
}

.rl-table-plain thead th {
	border-top: none;
	color: var(--rl-muted);
	font-size: 0.82rem;
	font-weight: normal;
}

.rl-table-plain tbody th {
	color: var(--rl-navy);
	white-space: nowrap;
}

.rl-steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	counter-reset: s;
}

.rl-steps li {
	counter-increment: s;
	display: flex;
	gap: 10px;
	align-items: baseline;
	font-size: 0.95rem;
}

.rl-steps li::before {
	content: counter(s);
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 2px solid var(--rl-blue);
	color: var(--rl-blue);
	font-size: 0.75rem;
	font-weight: bold;
	display: grid;
	place-items: center;
	transform: translateY(2px);
}

.rl-steps strong {
	color: var(--rl-navy);
}

/* ----- 記録 ----- */
.rl-records {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rl-records li {
	padding: 10px 0;
	border-top: 1px solid var(--rl-line);
	font-size: 0.93rem;
}

.rl-records li:first-child {
	border-top: none;
	padding-top: 0;
}

.rl-records time {
	display: block;
	font-size: 0.82rem;
	color: var(--rl-muted);
	font-variant-numeric: tabular-nums;
}

.rl-records-empty {
	margin: 0;
	color: var(--rl-muted);
	font-size: 0.93rem;
}

/* ----- FAQ ----- */
.rl-faq {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.rl-faq details {
	background: var(--rl-surface);
	border: 1px solid var(--rl-line);
	border-radius: var(--rl-radius);
	padding: 0 20px;
}

.rl-faq summary {
	cursor: pointer;
	padding: 16px 0;
	font-weight: bold;
	color: var(--rl-navy);
	list-style: none;
	display: flex;
	gap: 10px;
}

.rl-faq summary::-webkit-details-marker {
	display: none;
}

.rl-faq summary::before {
	content: "Q.";
	color: var(--rl-teal);
}

.rl-faq summary::after {
	content: "＋";
	margin-left: auto;
	color: var(--rl-muted);
}

.rl-faq details[open] summary::after {
	content: "−";
}

.rl-faq details > div {
	padding: 0 0 18px 1.9em;
	color: var(--rl-text);
}

.rl-faq details > div p {
	margin: 0;
}

/* ----- 末尾 ----- */
.rl-endbar {
	margin-top: 56px;
	background: var(--rl-surface);
	border-top: 1px solid var(--rl-line);
	padding: 28px 0;
	font-size: 0.9rem;
	color: var(--rl-muted);
}

.rl-endbar-inner {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 32px;
	align-items: center;
	justify-content: space-between;
}

.rl-endbar p {
	margin: 0;
}

.rl-endbar-links {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

/* =====================================================================
   教材ページ
   ===================================================================== */
.rl-preview-banner {
	background: #5c2b00;
	color: #fff;
	padding: 10px 24px;
	text-align: center;
	font-size: 0.9rem;
	font-weight: bold;
}

.rl-lesson-head {
	max-width: var(--rl-wide);
	margin: 0 auto;
	padding: 36px 24px 8px 24px;
}

.rl-lesson-kicker {
	margin: 0 0 8px 0;
	color: var(--rl-teal);
	font-weight: bold;
	font-size: 0.9rem;
	letter-spacing: 0.03em;
}

.rl-lesson-h1 {
	margin: 0 0 10px 0;
	font-size: clamp(1.6rem, 3.6vw, 2.3rem);
	line-height: 1.35;
	color: var(--rl-navy);
}

.rl-lesson-subtitle {
	margin: 0 0 16px 0;
	color: var(--rl-blue-dark);
	font-weight: bold;
	font-size: 1.05rem;
}

.rl-lesson-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 20px;
	margin: 0 0 12px 0;
	font-size: 0.88rem;
	color: var(--rl-muted);
}

.rl-lesson-meta div {
	display: flex;
	gap: 0.4em;
}

.rl-lesson-meta dt {
	font-weight: bold;
}

.rl-lesson-meta dd {
	margin: 0;
}

.rl-downloads {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.rl-site .rl-downloads a,
.rl-site .rl-downloads a:visited {
	display: inline-block;
	padding: 4px 12px;
	border: 1px solid var(--rl-line);
	border-radius: 6px;
	background: var(--rl-surface);
	font-size: 0.85rem;
	text-decoration: none;
}

.rl-site .rl-downloads a:hover {
	border-color: var(--rl-blue);
}

.rl-lesson-layout {
	max-width: var(--rl-wide);
	margin: 0 auto;
	padding: 16px 24px 0 24px;
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	gap: 40px;
	align-items: start;
}

.rl-toc-wrap {
	position: sticky;
	top: calc(var(--rl-header-h) + 68px);
	max-height: calc(100vh - var(--rl-header-h) - 88px);
	overflow-y: auto;
	font-size: 0.86rem;
	padding-right: 6px;
	overscroll-behavior: contain;
}

.rl-toc summary {
	font-weight: bold;
	color: var(--rl-navy);
	cursor: pointer;
	padding: 6px 0;
}

.rl-toc ol {
	list-style: none;
	margin: 0;
	padding: 0;
}

.rl-toc li {
	margin: 0;
}

.rl-toc li.rl-toc-h3 {
	padding-left: 1em;
	font-size: 0.95em;
}

.rl-site .rl-toc a,
.rl-site .rl-toc a:visited {
	display: block;
	padding: 4px 8px;
	border-left: 2px solid var(--rl-line);
	color: var(--rl-muted);
	text-decoration: none;
	line-height: 1.5;
}

.rl-site .rl-toc a:hover {
	color: var(--rl-navy);
	border-left-color: var(--rl-blue);
}

.rl-site .rl-toc a.is-current {
	color: var(--rl-navy);
	font-weight: bold;
	border-left-color: var(--rl-teal);
	background: var(--rl-teal-soft);
}

.rl-doc {
	max-width: var(--rl-measure);
	min-width: 0;
	background: var(--rl-surface);
	border: 1px solid var(--rl-line);
	border-radius: var(--rl-radius);
	padding: 36px 44px 44px 44px;
	font-size: 17px;
	line-height: 1.9;
	overflow-wrap: anywhere;
}

/* 固定ヘッダーとサブバーに見出しが隠れないように */
.rl-doc [id] {
	scroll-margin-top: calc(var(--rl-header-h) + 70px);
}

.rl-doc h1,
.rl-doc h2,
.rl-doc h3,
.rl-doc h4,
.rl-doc h5,
.rl-doc h6 {
	color: var(--rl-navy);
	line-height: 1.45;
	position: relative;
}

.rl-doc h1 { font-size: 1.8rem; margin: 0 0 0.8em 0; }
.rl-doc h2 {
	font-size: 1.5rem;
	margin: 2.4em 0 0.8em 0;
	padding-bottom: 0.3em;
	border-bottom: 2px solid var(--rl-line);
}
.rl-doc h3 { font-size: 1.22rem; margin: 2em 0 0.6em 0; }
.rl-doc h4 { font-size: 1.06rem; margin: 1.6em 0 0.5em 0; }
.rl-doc > h2:first-child,
.rl-doc > :first-child { margin-top: 0; }

.rl-site .rl-doc .rl-permalink,
.rl-site .rl-doc .rl-permalink:visited {
	margin-left: 0.4em;
	color: #9aa9b8;
	text-decoration: none;
	font-weight: normal;
	opacity: 0;
	transition: opacity 0.15s;
}

.rl-doc h2:hover .rl-permalink,
.rl-doc h3:hover .rl-permalink,
.rl-doc h4:hover .rl-permalink,
.rl-doc .rl-permalink:focus {
	opacity: 1;
}

.rl-doc p,
.rl-doc ul,
.rl-doc ol,
.rl-doc dl,
.rl-doc blockquote,
.rl-doc figure {
	margin: 0 0 1.1em 0;
}

.rl-doc ul,
.rl-doc ol {
	padding-left: 1.6em;
}

.rl-doc li + li {
	margin-top: 0.25em;
}

.rl-doc blockquote {
	padding: 0.6em 1.1em;
	border-left: 4px solid var(--rl-teal);
	background: var(--rl-teal-soft);
	border-radius: 0 8px 8px 0;
	color: #17323a;
}

.rl-doc blockquote > :last-child {
	margin-bottom: 0;
}

.rl-doc hr {
	border: none;
	border-top: 1px solid var(--rl-line);
	margin: 2.4em 0;
}

.rl-doc img {
	max-width: 100%;
	height: auto;
}

.rl-doc img.rl-fig {
	display: block;
	margin: 0.6em auto;
	border: 1px solid var(--rl-line);
	border-radius: 6px;
	background: #fff;
	cursor: zoom-in;
}

.rl-doc code {
	font-family: var(--rl-mono);
	font-size: 0.88em;
	background: var(--rl-surface-2);
	border-radius: 4px;
	padding: 0.1em 0.35em;
}

.rl-code {
	position: relative;
	margin: 0 0 1.2em 0;
}

.rl-code pre {
	margin: 0;
	padding: 16px 18px;
	background: #f6f8fa;
	border: 1px solid var(--rl-line);
	border-radius: 8px;
	overflow-x: auto;
	font-size: 14.5px;
	line-height: 1.6;
}

.rl-code pre code {
	background: none;
	padding: 0;
	font-size: inherit;
	white-space: pre;
}

.rl-code[data-lang]::before {
	content: attr(data-lang);
	position: absolute;
	top: 0;
	left: 12px;
	transform: translateY(-50%);
	background: var(--rl-surface);
	border: 1px solid var(--rl-line);
	border-radius: 4px;
	padding: 0 6px;
	font-size: 0.72rem;
	line-height: 1.6;
	color: var(--rl-muted);
	font-family: var(--rl-mono);
}

.rl-copy {
	position: absolute;
	top: 8px;
	right: 8px;
	font-size: 0.78rem;
	padding: 3px 10px;
	border: 1px solid var(--rl-line);
	background: var(--rl-surface);
	color: var(--rl-navy);
	border-radius: 5px;
	cursor: pointer;
}

.rl-copy:hover {
	border-color: var(--rl-blue);
}

/* 横に長い表・数式・コードは、その領域だけ横スクロールさせる */
.rl-table-wrap {
	overflow-x: auto;
	margin: 0 0 1.2em 0;
	border: 1px solid var(--rl-line);
	border-radius: 8px;
}

.rl-doc table {
	border-collapse: collapse;
	min-width: 100%;
	font-size: 0.93em;
	line-height: 1.7;
	/* 数値の途中で折り返さない（はみ出す分は .rl-table-wrap が横スクロールする） */
	overflow-wrap: normal;
}

.rl-doc td {
	min-width: 3.5em;
}

.rl-doc th,
.rl-doc td {
	padding: 8px 12px;
	border-bottom: 1px solid var(--rl-line);
	border-right: 1px solid var(--rl-line);
	vertical-align: top;
}

.rl-doc th:last-child,
.rl-doc td:last-child {
	border-right: none;
}

.rl-doc tbody tr:last-child td {
	border-bottom: none;
}

.rl-doc thead th {
	background: var(--rl-surface-2);
	color: var(--rl-navy);
	text-align: left;
}

.rl-doc .math-display {
	display: block;
	margin: 0.8em 0 1.1em 0;
	overflow-x: auto;
	overflow-y: hidden;
	max-width: 100%;
	padding: 2px 0;
}

.rl-doc mjx-container[display="true"] {
	margin: 0 !important;
}

.rl-doc details {
	border: 1px solid var(--rl-line);
	border-radius: 8px;
	padding: 0 16px;
	margin: 0 0 1.1em 0;
	background: #fbfcfd;
}

.rl-doc details[open] {
	padding-bottom: 8px;
}

.rl-doc summary {
	cursor: pointer;
	padding: 10px 0;
	font-weight: bold;
	color: var(--rl-navy);
}

/* 安全化で href を外したリンク・名前だけのアンカーは本文として表示する */
.rl-site .rl-doc a:not([href]) {
	color: inherit;
	text-decoration: none;
}

.rl-unpublished-link {
	border-bottom: 1px dotted var(--rl-muted);
}

.rl-doc .footnotes {
	font-size: 0.9em;
	color: var(--rl-muted);
}

.rl-pager {
	max-width: var(--rl-wide);
	margin: 28px auto 0 auto;
	padding: 0 24px;
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	gap: 12px;
	align-items: stretch;
}

.rl-pager > * {
	min-width: 0;
}

.rl-site .rl-pager a,
.rl-site .rl-pager a:visited {
	display: block;
	background: var(--rl-surface);
	border: 1px solid var(--rl-line);
	border-radius: 8px;
	padding: 12px 16px;
	text-decoration: none;
	height: 100%;
}

.rl-site .rl-pager a:hover {
	border-color: var(--rl-blue);
}

.rl-pager small {
	display: block;
	color: var(--rl-muted);
	font-size: 0.8rem;
}

.rl-pager .rl-pager-next {
	text-align: right;
}

.rl-feedback {
	max-width: var(--rl-wide);
	margin: 20px auto 0 auto;
	padding: 0 24px;
}

.rl-feedback .rl-card {
	font-size: 0.93rem;
}

.rl-feedback h2 {
	margin: 0 0 6px 0;
	font-size: 1.05rem;
	color: var(--rl-navy);
}

.rl-feedback p {
	margin: 0;
	color: var(--rl-muted);
}

/* ----- 図の拡大表示 ----- */
.rl-zoom {
	border: none;
	padding: 0;
	background: transparent;
	max-width: 96vw;
	max-height: 94vh;
}

.rl-zoom::backdrop {
	background: rgba(8, 18, 32, 0.82);
}

.rl-zoom img {
	display: block;
	max-width: 96vw;
	max-height: 86vh;
	background: #fff;
	border-radius: 8px;
}

.rl-zoom p {
	color: #fff;
	margin: 8px 0 0 0;
	font-size: 0.9rem;
	text-align: center;
}

.rl-zoom button {
	position: absolute;
	top: 8px;
	right: 8px;
	background: #fff;
	border: none;
	border-radius: 50%;
	width: 36px;
	height: 36px;
	font-size: 1.2rem;
	cursor: pointer;
}

/* =====================================================================
   レスポンシブ
   ===================================================================== */
@media (max-width: 1020px) {
	.rl-lesson-layout {
		grid-template-columns: minmax(0, 1fr);
		gap: 16px;
	}

	.rl-toc-wrap {
		position: static;
		max-height: none;
		overflow: visible;
		background: var(--rl-surface);
		border: 1px solid var(--rl-line);
		border-radius: var(--rl-radius);
		padding: 4px 16px;
	}

	.rl-toc[open] summary {
		margin-bottom: 4px;
	}

	.rl-toc[open] {
		padding-bottom: 10px;
	}

	.rl-doc {
		max-width: none;
	}

	.rl-cycle {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 26px 18px;
	}

	.rl-cycle li:not(:last-child)::after {
		display: none;
	}
}

@media (max-width: 860px) {
	.rl-hero-grid,
	.rl-grid-3,
	.rl-grid-2,
	.rl-roadmap {
		grid-template-columns: minmax(0, 1fr);
	}

	.rl-roadmap {
		gap: 30px;
	}

	.rl-roadmap li:not(:last-child) .rl-phase-card::after {
		right: 50%;
		top: auto;
		bottom: -24px;
		transform: translateX(50%) rotate(135deg);
	}

	/* スマホではサブバーを固定しない（本文を覆わないように） */
	.rl-subbar {
		position: static;
	}
}

@media (max-width: 600px) {
	.rl-container,
	.rl-subbar-inner,
	.rl-lesson-head,
	.rl-lesson-layout,
	.rl-pager,
	.rl-feedback {
		padding-left: 16px;
		padding-right: 16px;
	}

	.rl-section {
		padding-top: 40px;
	}

	.rl-h2 {
		font-size: 1.35rem;
	}

	.rl-card {
		padding: 18px;
	}

	.rl-cycle {
		grid-template-columns: minmax(0, 1fr);
	}

	.rl-lesson-row {
		grid-template-columns: 2.8em minmax(0, 1fr);
		padding: 12px 14px;
	}

	.rl-lesson-row .rl-status {
		grid-column: 2;
		justify-self: start;
	}

	.rl-doc {
		padding: 22px 16px 28px 16px;
		font-size: 16px;
		line-height: 1.85;
		border-left: none;
		border-right: none;
		border-radius: 0;
		margin: 0 -16px;
	}

	.rl-pager {
		grid-template-columns: 1fr 1fr;
	}

	.rl-pager .rl-pager-index {
		grid-column: 1 / -1;
		order: 3;
		text-align: center;
	}

	.rl-empty {
		flex-direction: column;
	}

	.rl-table-plain tbody th {
		white-space: normal;
	}
}

/* ----- 動きを減らす設定 ----- */
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto !important;
	}
}

/* ----- 印刷 ----- */
@media print {
	header,
	footer,
	#scrollTop,
	.rl-subbar,
	.rl-toc-wrap,
	.rl-pager,
	.rl-feedback,
	.rl-copy,
	.rl-skip,
	.rl-endbar,
	.rl-permalink,
	.rl-preview-banner {
		display: none !important;
	}

	body.rl-body {
		background: #fff;
	}

	.rl-site {
		padding-top: 0;
	}

	.rl-lesson-layout {
		display: block;
		padding: 0;
	}

	.rl-doc {
		border: none;
		padding: 0;
		max-width: none;
		font-size: 11pt;
	}

	.rl-code pre,
	.rl-table-wrap,
	.rl-doc .math-display {
		overflow: visible;
	}

	.rl-code pre code {
		white-space: pre-wrap;
	}

	.rl-doc h2,
	.rl-doc h3 {
		break-after: avoid;
	}

	.rl-doc img,
	.rl-doc figure,
	.rl-doc table,
	.rl-code {
		break-inside: avoid;
	}
}
