/*
 * cti.li の頁の見た目(2026-10 の作り直し。Java の頁のひな形 server/src/main/jte が使う)。
 *
 * 地は濃い緑と白、見出しは明朝(Shippori Mincho B1)、本文は端末の日本語のゴシック。
 * 本文の書体は読み込まない(Noto Sans JP を読むと重い。端末の書体で十分読める)。
 * 読み器・PDF変換の画面は static/tool.css(頁の並び)と contents/webtools/html2pdf/styles/reader.css(読み器)が受け持つ。
 */
:root {
	--ground: #0F1A15;
	--ground-ink: #FFFFFF;
	--ground-muted: #D5DED8;
	--ground-faint: #B9C6BE;
	--accent: #167A40;
	--accent-dark: #0F5C2F;
	--accent-light: #8FE0AE;
	--accent-soft: #E7F3EB;
	--ink: #14201A;
	--muted: #4E5B54;
	--line: #DDE4DF;
	--line-strong: #C9D3CC;
	--soft: #F4F7F5;
	--paper: #FBFAF6;
	--paper-ink: #1E1B16;
	--paper-line: #E7E3D8;
	--bg: #FFFFFF;
	--mincho: 'Shippori Mincho B1', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
	--sans: system-ui, -apple-system, 'Hiragino Sans', 'Noto Sans JP', 'Yu Gothic UI', Meiryo, sans-serif;
	--mono: ui-monospace, 'SFMono-Regular', Consolas, monospace;
	--wide: 1160px;
	--narrow: 880px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 16px;
	line-height: 1.85;
}
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
img { max-width: 100%; height: auto; }
code { font-family: var(--mono); font-size: 0.9em; }
:focus-visible { outline: 3px solid var(--accent-light); outline-offset: 2px; }
.sr-only {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------------------------------------------------------- 頭と足 */

.site-head { background: var(--ground); color: var(--ground-ink); }
.site-head-in {
	max-width: var(--wide); margin: 0 auto; padding: 14px 24px;
	display: flex; flex-wrap: wrap; align-items: center; gap: 4px 32px;
}
.wordmark {
	font-family: 'Inter', var(--sans); font-style: italic; font-weight: 800;
	font-size: 28px; letter-spacing: -0.03em; line-height: 1.2;
	color: var(--ground-ink); text-decoration: none;
}
.wordmark:hover { color: var(--ground-ink); }
.site-nav { display: flex; gap: 4px 24px; font-size: 15px; }
.site-nav a {
	color: var(--ground-ink); text-decoration: none; white-space: nowrap;
	padding: 10px 0; border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent-light); }
.site-nav a[aria-current="page"] { color: var(--accent-light); border-bottom-color: var(--accent-light); }

.site-foot { background: var(--ground); color: var(--ground-faint); }
.site-foot-in {
	max-width: var(--wide); margin: 0 auto; padding: 40px 24px;
	display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; font-size: 14px;
}
.site-foot a { color: var(--ground-muted); }
.site-foot .wordmark { font-size: 22px; }
.site-foot .grow { flex-grow: 1; }
.site-foot .version { font-family: var(--mono); font-size: 12px; color: #8C9A92; }

/* ---------------------------------------------------------------- トップの大きな見出し */

/* 扇に重ねた見本の頁が、狭い画面で頁の外へはみ出して横に揺れないよう、帯の外は切る */
.hero { background: var(--ground); color: var(--ground-ink); overflow: hidden; }
.hero-in {
	max-width: var(--wide); margin: 0 auto; padding: 48px 24px 88px;
	display: flex; flex-wrap: wrap; align-items: center; gap: 56px;
}
.hero-text { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.hero .eyebrow { margin: 0; font-size: 14px; letter-spacing: 0.08em; color: var(--accent-light); }
.hero h1 {
	margin: 0; font-family: var(--mincho); font-weight: 800;
	font-size: 52px; line-height: 1.3; letter-spacing: 0.02em;
}
.hero .lead { margin: 0; font-size: 17px; line-height: 1.9; color: var(--ground-muted); max-width: 34em; }
.hero .lead + .lead { margin-top: -8px; }
/* 英語の見出しは語が長く、日本語と同じ大きさでは 4 行に折れる */
html[lang="en"] .hero h1 { font-size: 40px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }

.button {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	border: 0; border-radius: 10px; background: var(--accent); color: #FFFFFF;
	font: inherit; font-weight: 700; font-size: 16px; line-height: 1.4;
	padding: 14px 28px; min-height: 48px; cursor: pointer; text-decoration: none;
}
.button:hover { background: var(--accent-dark); color: #FFFFFF; }
.button.quiet { background: var(--bg); color: var(--accent); border: 1px solid var(--accent); }
.button.quiet:hover { background: var(--accent-soft); color: var(--accent-dark); }

/* 見本の頁(飾り)。Copper で組んだ頁の画像(static/samples/)を 3 枚、扇のように重ねる */
.hero-pages { flex: 0 1 520px; min-width: 0; position: relative; aspect-ratio: 520 / 450; }
.hero-pages img {
	position: absolute; width: 46%; height: auto; border-radius: 3px;
	background: #FFFFFF; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}
.hero-pages .p1 { left: 0; top: 12%; transform: rotate(-7deg); }
.hero-pages .p2 { left: 27%; top: 0; z-index: 1; }
.hero-pages .p3 { right: 0; top: 14%; transform: rotate(6deg); z-index: 2; }

/* ---------------------------------------------------------------- 本文の区切り */

.section { max-width: var(--wide); margin: 0 auto; padding: 80px 24px 24px; }
.section:last-of-type { padding-bottom: 80px; }
.section h2, .page-title {
	margin: 0 0 32px; font-family: var(--mincho); font-weight: 800; font-size: 32px; line-height: 1.45;
}

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.card {
	border: 1px solid var(--line); border-radius: 16px; padding: 28px;
	display: flex; flex-direction: column; gap: 14px;
}
.card svg { width: 32px; height: 32px; stroke: var(--accent); }
.card h3 { margin: 0; font-size: 19px; line-height: 1.5; }
.card p { margin: 0; font-size: 15px; color: var(--muted); flex-grow: 1; }
.card .more { font-weight: 700; font-size: 15px; }
.card .more-links { display: flex; flex-wrap: wrap; gap: 4px 20px; flex-grow: 0; }

/* 節の見出しの下の一言 */
.section-lead { margin: -16px 0 32px; font-size: 16px; color: var(--muted); max-width: 46em; }

/* 組版の見本(トップ)。頁の画像は大きさをそろえた枠に収める(縦組みの本は A4 より縦に長い) */
.specimens { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px; }
.specimen { margin: 0; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.specimen .shot {
	display: flex; align-items: center; justify-content: center; aspect-ratio: 5 / 7;
	background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 14px;
}
.specimen .shot img {
	display: block; max-width: 100%; max-height: 100%; width: auto; height: auto;
	box-shadow: 0 6px 18px rgba(15, 26, 21, 0.18);
}
.specimen h3 { margin: 0 0 4px; font-size: 18px; line-height: 1.5; }
.specimen p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.75; }
.specimen .links { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 18px; font-weight: 700; }

/* 組版でできること(トップ)。名前・一言・CSS の指定 */
.features { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 32px; }
.features > div { padding: 18px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.features dt { font-weight: 700; font-size: 16px; }
.features dd { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.75; }
.features dd.css { font-family: var(--mono); font-size: 12.5px; color: var(--accent-dark); }

.panel {
	background: var(--soft); border-radius: 24px; padding: 48px;
	display: flex; flex-wrap: wrap; gap: 40px;
}
.panel > .intro { flex: 1 1 300px; min-width: 0; }
.panel > .intro h2 { font-size: 28px; margin-bottom: 16px; }
.panel > .intro p { margin: 0; font-size: 15px; color: var(--muted); }
.panel > .items {
	flex: 2 1 520px; min-width: 0;
	display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px;
}
.panel .item { display: flex; flex-direction: column; gap: 8px; }
.panel .item h3 { margin: 0; font-size: 16px; line-height: 1.6; }
.panel .item p { margin: 0; font-size: 14px; color: var(--muted); }
.panel .item code {
	font-size: 13px; background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
	padding: 8px 10px; overflow-wrap: anywhere;
}
.panel .item a { font-size: 14px; font-weight: 700; }

.split { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; }
.split > * { flex: 1 1 300px; min-width: 0; }
.split h2 { font-size: 28px; margin-bottom: 16px; }
.split p { margin: 0 0 12px; font-size: 15px; color: var(--muted); }
.notes { border-top: 1px solid var(--line); flex-basis: 420px; }
.notes h2 { font-family: var(--sans); font-size: 18px; margin: 24px 0 16px; }
.notes ul {
	margin: 0; padding-left: 1.2em; font-size: 14px; color: var(--muted);
	display: flex; flex-direction: column; gap: 8px;
}

/* 広告は横幅の決まった枠(728px など)で来ることがある。狭い画面で頁ごと横に流れないよう、はみ出しは切る */
.ad { max-width: var(--wide); margin: 0 auto; padding: 56px 24px 0; text-align: center; overflow: hidden; }

/* ---------------------------------------------------------------- 読み物の頁(本を作る・AIから使う・開発者向け・ほかのサイトから使う) */

/* 頁の頭。淡い地に題と一言 */
.page-head { background: var(--soft); }
.page-head-in {
	max-width: var(--narrow); margin: 0 auto; padding: 56px 24px 48px;
	display: flex; flex-direction: column; gap: 16px;
}
.page-head h1 {
	margin: 0; font-family: var(--mincho); font-weight: 800; font-size: 40px; line-height: 1.4;
}
.page-head .lead { margin: 0; font-size: 18px; line-height: 2; }
.page-head .sub { margin: 0; font-size: 15px; color: var(--muted); }

/* 本文。幅を狭くして一行を短くする。.large は年配の人が読む頁(本を作る)の大きめの字 */
.doc {
	max-width: var(--narrow); margin: 0 auto; padding: 48px 24px 80px;
	display: flex; flex-direction: column; gap: 56px;
}
.doc.large { font-size: 17px; line-height: 2; }
.doc > section { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.doc h2 { margin: 0; font-size: 24px; line-height: 1.5; }
.doc h3 { margin: 0; font-size: 18px; line-height: 1.6; }
.doc h4 { margin: 0; font-size: 16px; line-height: 1.6; }
.doc p { margin: 0; }
.doc ul { margin: 0; padding-left: 1.2em; }
.doc .muted { color: var(--muted); }
.doc .notes-list { font-size: 15px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; }
.doc .small { font-size: 14px; color: var(--muted); }
/* 本文の中の広告。左右の auto の余白があると縦の flex で広告の幅に広がるので、余白を外して本文の幅に収める */
.doc .ad { padding: 0; margin: 0; }
.doc .cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.doc .cards.two { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.doc .card { padding: 22px; gap: 6px; min-width: 0; }
.doc .card h3 { font-size: 18px; }
.doc .card p { font-size: 16px; line-height: 1.85; flex-grow: 0; }
.doc .card ul { margin: 0; padding-left: 1.1em; font-size: 15px; display: flex; flex-direction: column; gap: 4px; }
.doc .card .muted { font-size: 14px; }

/* 見出しと、その右の切り替え */
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }

/* 切り替え(本を作る: Claude と ChatGPT。開発者向け: 言語) */
.switch {
	display: flex; flex-wrap: wrap; gap: 4px; width: fit-content; max-width: 100%;
	background: #EDF1EE; border-radius: 12px; padding: 4px;
}
.switch > button, .switch > a {
	border: 0; border-radius: 9px; background: transparent; color: var(--muted);
	font: inherit; font-size: 16px; line-height: 1.4; padding: 10px 22px; min-height: 44px;
	display: inline-flex; align-items: center; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.switch > button:hover, .switch > a:hover { color: var(--ink); }
.switch > [aria-pressed="true"], .switch > [aria-selected="true"] {
	background: var(--bg); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(15, 26, 21, 0.15);
}
.switch.compact > button, .switch.compact > a { font-size: 15px; padding: 8px 16px; }

/* 札で切り替える板(開発者向けの言語)。板は display を持つので、hidden を明示して隠す */
.tabs { display: flex; flex-direction: column; gap: 8px; min-width: 0; scroll-margin-top: 16px; }
.tab-panel { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; min-width: 0; }
.tab-panel[hidden] { display: none; }
.tab-panel h3 { font-size: 20px; }
.tab-panel h4 { margin-top: 12px; }

/* 手順。番号札と枠 */
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.step { display: flex; gap: 20px; border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.step[hidden] { display: none; }
.step.main { border: 2px solid var(--accent); background: #F6FBF8; }
.step-no {
	flex: 0 0 44px; height: 44px; border-radius: 999px; background: var(--accent); color: #FFFFFF;
	font-weight: 700; font-size: 20px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.step-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.step-body h3 { font-size: 19px; }
.step-body p { color: #2E3A34; }
.step-body .note { font-size: 15px; color: var(--muted); }
.step-body ul { margin: 0; padding-left: 1.2em; }
kbd {
	font-family: var(--sans); font-size: 0.9em; background: var(--bg); border: 1px solid var(--line-strong);
	border-bottom-width: 2px; border-radius: 6px; padding: 0 6px;
}

/* 写して使う文と、その「コピー」 */
.copy-text {
	margin: 0; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 12px;
	padding: 16px 18px; font-size: 16px; line-height: 1.9; overflow-wrap: anywhere;
}
.copy-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.copy-row .button { min-width: 140px; }

/* 困ったとき(開いて読む問いと答え) */
.faq { display: flex; flex-direction: column; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; }
.faq details > p { margin: 0 0 16px; color: var(--muted); }

/* 頁の終わりの断り書き */
.fine { font-size: 15px; line-height: 1.9; color: var(--muted); border-top: 1px solid var(--line); padding-top: 24px; }

/* コード。字下げを崩さないよう折り返さず、枠の中で横に送る。.wrap は一行の長いもの(折り返してよい) */
.code {
	margin: 0; background: var(--soft); border: 1px solid var(--line); border-radius: 12px;
	padding: 14px 16px; font-family: var(--mono); font-size: 14px; line-height: 1.7; color: var(--ink);
	white-space: pre; overflow-x: auto; max-width: 100%; min-width: 0; tab-size: 4;
}
.code.wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.code code { font-size: inherit; }
:not(pre) > code.inline {
	background: var(--soft); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere;
}

/* 項目と値の並び(接続先・上限・ツール) */
.facts { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 12px 28px; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts.lined { gap: 0; }
.facts.lined > dt, .facts.lined > dd { border-top: 1px solid var(--line); padding: 12px 0; }
.facts.lined > dt { padding-right: 28px; }

/* 見出しと本文の組を、線で区切って並べる(AI に追加する・断られる頼み方・ほかのサイトから使う) */
.blocks { display: flex; flex-direction: column; }
.block { border-top: 1px solid var(--line); padding: 24px 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.block:last-child { padding-bottom: 0; }
.block .then { border-left: 3px solid var(--accent-light); padding-left: 14px; }

/* やりとりの例 */
.chat { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.chat > div { display: flex; flex-direction: column; gap: 2px; max-width: 36em; border-radius: 14px; padding: 12px 16px; }
.chat dt { font-size: 13px; font-weight: 700; color: var(--muted); }
.chat dd { margin: 0; }
.chat .me { background: var(--accent-soft); align-self: flex-end; }
.chat .ai { background: var(--soft); align-self: flex-start; }

/* 大きく見せる URL(MCP サーバー) */
.endpoint {
	display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
	background: var(--soft); border-radius: 16px; padding: 20px 24px;
}
.endpoint code { font-size: 22px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; min-width: 0; }

/* ブックマークバーへドラッグするボタン */
.bookmarklet {
	display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
	border: 2px dashed var(--accent); border-radius: 12px; background: var(--bg); color: var(--accent);
	font-weight: 700; font-size: 17px; padding: 12px 24px; min-height: 52px; text-decoration: none; cursor: grab;
}
.bookmarklet:hover { background: var(--accent-soft); }

/* ---------------------------------------------------------------- 狭い画面 */

@media (max-width: 720px) {
	.site-head-in { padding: 10px 16px 0; }
	.wordmark { font-size: 24px; }
	/* 見出しの並びは横に流す(畳まない。押す回数を増やさない) */
	.site-nav {
		width: 100%; overflow-x: auto; gap: 20px; padding-bottom: 2px;
		scrollbar-width: none;
	}
	.site-nav::-webkit-scrollbar { display: none; }
	.hero-in { padding: 28px 16px 48px; gap: 32px; }
	.hero h1 { font-size: 34px; line-height: 1.35; }
	.hero .lead { font-size: 15px; }
	html[lang="en"] .hero h1 { font-size: 30px; }
	.hero-actions .button { flex: 1 1 auto; }
	.hero-pages { flex-basis: 100%; max-width: 420px; margin: 0 auto; }
	.section-lead { margin: -8px 0 20px; font-size: 15px; }
	.specimens { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
	.specimen .shot { padding: 8px; }
	.specimen h3 { font-size: 16px; }
	.specimen p { font-size: 13px; }
	.section { padding: 48px 16px 16px; }
	.section h2, .page-title { font-size: 26px; margin-bottom: 20px; }
	.cards { gap: 12px; }
	.card { padding: 20px; gap: 10px; }
	.panel { padding: 24px 20px; border-radius: 18px; gap: 24px; }
	.panel > .intro h2, .split h2 { font-size: 22px; }
	.site-foot-in { padding: 28px 16px; }
	.ad { padding: 40px 16px 0; }
	.page-head-in { padding: 32px 16px 28px; gap: 12px; }
	.page-head h1 { font-size: 30px; line-height: 1.4; }
	.page-head .lead { font-size: 16px; line-height: 1.9; }
	.doc { padding: 32px 16px 56px; gap: 44px; }
	.doc.large { font-size: 16px; }
	.doc h2 { font-size: 21px; }
	.doc .ad { padding: 0; margin: 0; }
	.switch > button, .switch > a { padding: 8px 16px; }
	.switch.compact > button, .switch.compact > a { font-size: 14px; padding: 6px 12px; min-height: 40px; }
	.step { gap: 14px; padding: 18px 16px; }
	.step-no { flex-basis: 36px; height: 36px; font-size: 17px; }
	.step-body h3 { font-size: 18px; }
	.copy-text { padding: 14px; font-size: 15px; }
	.copy-row .button { width: 100%; }
	.code { font-size: 13px; padding: 12px; }
	.facts, .facts.lined { grid-template-columns: minmax(0, 1fr); gap: 4px; }
	.facts dd + dt { margin-top: 10px; }
	.facts.lined > dt { padding: 12px 0 0; }
	.facts.lined > dd { border-top: 0; padding: 0 0 12px; }
	.facts.lined dd + dt { margin-top: 0; }
	.endpoint { padding: 16px; }
	.endpoint code { font-size: 18px; }
	.endpoint .button { width: 100%; }
	.chat > div { max-width: 92%; }
}
