/* books.toolnoki.site 共通スタイル
   ツールノキ本体（toolnoki.site）の配色・文字・角丸・ボタンの決まりに合わせる。
   外部フォント・外部画像は使わない。ダークモードは本体にそろえて対応しない。 */
:root {
  --ink: #203a32;
  --muted: #4c5e57;
  --green: #245e46;
  --green-dark: #1a4836;
  --paper: #f6f5ee;
  --white: #fff;
  --line: #d9ded5;
  --line-strong: #b4c0b5;
  --tint: #edf1e8;
  --accent: #e8b763;
  --cream: #fff8e8;
  --warn-ink: #6a4b12;
  --number: #4e7149;
  --focus: #b56a14;
  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 2px 12px rgba(32, 58, 50, .07);
  --font: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic Medium", "Yu Gothic", YuGothic, Meiryo, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.8;
}
a { color: var(--green); text-underline-offset: 4px; }
a:hover { text-decoration-thickness: 2px; }
button { font: inherit; color: inherit; }
a, button { touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { color: var(--ink); font-weight: 700; }
p { margin: 0 0 12px; }
.skip { position: absolute; left: 8px; top: -80px; background: var(--white); padding: 10px 14px; z-index: 10; border-radius: 8px; }
.skip:focus { top: 8px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 28px; }
.content { max-width: 760px; margin: 0 auto; }
.small { font-size: 14px; }
.muted { color: var(--muted); }

/* ---------- ヘッダー ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 80px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--green); }
.brand svg { width: 32px; height: 37px; flex: none; }
.brand-name { display: block; font-size: 22px; font-weight: 800; letter-spacing: .08em; line-height: 1.2; }
.brand-sub { display: block; font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--ink); line-height: 1.4; margin-top: 2px; }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  font-size: 15px; color: var(--ink); text-decoration: none; border-bottom: 3px solid transparent;
}
.site-nav a:hover { color: var(--green); }
.site-nav a { white-space: nowrap; }
.nav-short { display: none; }
.site-nav a[aria-current="page"] { font-weight: 700; color: var(--green); border-bottom-color: var(--green); }

/* ---------- 本文 ---------- */
main { padding: 36px 0 64px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .16em; color: var(--green); margin: 0 0 6px; }
h1 { font-size: 34px; line-height: 1.45; letter-spacing: .03em; margin: 0 0 14px; }
h2 { font-size: 22px; line-height: 1.5; margin: 40px 0 12px; }
.lead { font-size: 18px; line-height: 1.8; margin: 0 0 14px; }
.bar-heading { display: flex; align-items: center; gap: 10px; }
.bar-heading::before { content: ""; flex: none; width: 5px; height: 1.1em; background: var(--green); border-radius: 3px; }
.breadcrumbs { font-size: 14px; color: var(--muted); margin: 0 0 14px; }
.breadcrumbs a { color: var(--muted); }

/* ---------- ボタン ---------- */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 22px 0 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 50px; padding: 10px 24px; border-radius: var(--radius-s);
  font-size: 16px; font-weight: 700; line-height: 1.4; text-decoration: none; cursor: pointer;
  border: 1.5px solid transparent;
}
.btn-primary { background: var(--green); color: var(--white); }
.btn-primary:hover { background: var(--green-dark); }
.btn-secondary { background: var(--white); color: var(--green); border-color: var(--green); }
.btn-secondary:hover { background: var(--tint); }
.link-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
  background: none; border: 0; color: var(--green); font-size: 15px; font-weight: 700;
  text-decoration: underline; text-underline-offset: 4px; cursor: pointer;
}
.link-btn:hover { text-decoration-thickness: 2px; }

/* ---------- トップ（開始画面） ---------- */
.hero { padding: 8px 0 4px; }
.hero h1 { font-size: 38px; }
.steps { list-style: none; padding: 0; margin: 26px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps li { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.steps .num { font-family: Georgia, "Times New Roman", serif; font-size: 26px; line-height: 1; color: var(--number); display: block; margin-bottom: 6px; }
.steps strong { display: block; font-size: 16px; }
.steps span { display: block; font-size: 14px; color: var(--muted); line-height: 1.6; }
.note-line { font-size: 14px; color: var(--muted); margin: 18px 0 0; }

/* ---------- 診断 ---------- */
.progress { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; font-size: 14px; font-weight: 700; color: var(--green); }
.progress-bar { display: flex; gap: 6px; flex: 1; max-width: 180px; }
.progress-bar span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.progress-bar span.on { background: var(--green); }
.quiz-question { font-size: 26px; margin: 4px 0 18px; }
.options { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.option {
  position: relative; width: 100%; min-height: 68px; text-align: left; cursor: pointer;
  background: var(--white); border: 1.5px solid var(--line-strong); border-radius: 12px;
  padding: 12px 48px 12px 18px; display: block; box-shadow: var(--shadow);
}
.option::after { content: "›"; position: absolute; right: 18px; top: 50%; transform: translateY(-52%); font-size: 26px; color: var(--green); line-height: 1; }
.option:hover { border-color: var(--green); background: #f8fbf5; }
.option strong { display: block; font-size: 17px; line-height: 1.5; }
.option span { display: block; font-size: 14px; color: var(--muted); line-height: 1.6; margin-top: 2px; }

/* ---------- 結果 ---------- */
.answer-chips { list-style: none; padding: 0; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.answer-chips li { font-size: 13px; font-weight: 700; background: var(--tint); color: var(--ink); border-radius: 999px; padding: 3px 12px; }
.result-title { font-size: 28px; margin: 6px 0 8px; }
.result-note { font-size: 15px; color: var(--muted); margin: 0 0 16px; }

.book { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 26px; margin: 0 0 16px; }
.book-label { display: inline-block; font-size: 13px; font-weight: 700; color: var(--green); background: var(--tint); border-radius: 999px; padding: 2px 12px; margin: 0 0 10px; }
.relation { font-size: 15px; margin: 0 0 8px; }
.book-title { font-size: 26px; line-height: 1.45; margin: 0; letter-spacing: .02em; }
.book-subtitle { font-size: 15px; color: var(--muted); margin: 2px 0 0; line-height: 1.6; }
.book-author { font-size: 15px; color: var(--muted); margin: 6px 0 12px; }
.badges { list-style: none; padding: 0; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 6px; }
.badge { font-size: 13px; font-weight: 700; line-height: 1.5; background: var(--tint); color: var(--ink); border-radius: 999px; padding: 3px 12px; }
.badge.warn { background: var(--cream); color: var(--warn-ink); box-shadow: inset 0 0 0 1px var(--accent); }

.book-section { margin-top: 20px; }
.book-section h2, .book-section h3, .book-section h4 { font-size: 17px; line-height: 1.5; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.book-section h2::before, .book-section h3::before, .book-section h4::before { content: ""; flex: none; width: 5px; height: 1.1em; border-radius: 3px; background: var(--green); }
.book-section.unsuitable h2::before, .book-section.unsuitable h3::before, .book-section.unsuitable h4::before { background: var(--accent); }
.book-section p { margin: 0; }
.fit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.caution { background: var(--cream); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; padding: 12px 16px; }
.caution p { margin: 0; }

.book details { margin-top: 18px; border-top: 1px solid var(--line); }
.book details + details { margin-top: 0; }
summary { cursor: pointer; font-weight: 700; color: var(--green); font-size: 15px; padding: 12px 0; min-height: 44px; }
details[open] > summary { padding-bottom: 6px; }
.details-body { padding: 0 0 10px; font-size: 15px; }
.score-table, .biblio { border-collapse: collapse; width: 100%; font-size: 15px; margin: 6px 0 10px; }
.score-table th, .score-table td, .biblio th, .biblio td { border-bottom: 1px solid var(--line); padding: 8px 10px 8px 0; text-align: left; vertical-align: top; font-weight: 400; }
.score-table th, .biblio th { color: var(--muted); width: 8em; }
.score-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.score-table tr.total th, .score-table tr.total td { font-weight: 700; color: var(--ink); border-bottom: 0; }
.purchase-note { font-size: 14px; color: var(--muted); margin: 14px 0 0; }
.no-match { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.no-match p { margin: 0; font-size: 17px; }

/* ---------- 一覧 ---------- */
.book-list { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 12px; }
.book-item {
  display: block; text-decoration: none; color: var(--ink); background: var(--white);
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 48px 16px 20px; position: relative; box-shadow: var(--shadow);
}
.book-item::after { content: "›"; position: absolute; right: 18px; top: 50%; transform: translateY(-52%); font-size: 26px; color: var(--green); line-height: 1; }
.book-item:hover { border-color: var(--green); }
.book-item .t { display: block; font-size: 18px; font-weight: 700; line-height: 1.5; color: var(--green); }
.book-item .d { display: block; font-size: 15px; line-height: 1.75; margin: 4px 0 6px; }
.book-item .m { display: block; font-size: 13px; color: var(--muted); line-height: 1.6; }
.book-item .badges { margin: 8px 0 0; }
.book-item .badge { font-size: 12px; padding: 2px 10px; }
.book-item .only { display: block; font-size: 13px; color: var(--warn-ink); margin-top: 6px; font-weight: 700; }

/* ---------- 紹介ページ ---------- */
.book-page .book { padding: 26px 28px; }
.book-page h1.book-title { font-size: 30px; }
.page-note { font-size: 14px; color: var(--muted); margin: 10px 0 0; }
.sources { margin: 6px 0 0; padding-left: 1.2em; font-size: 15px; }

/* ---------- このサイトについて ---------- */
.prose h2 { font-size: 22px; margin: 40px 0 12px; }
.prose h3 { font-size: 18px; margin: 24px 0 6px; }
.prose ul { padding-left: 1.3em; margin: 0 0 12px; }
.prose li { margin: 4px 0; }

/* ---------- 相談先 ---------- */
.support { background: var(--white); border: 1px solid var(--line); border-left: 5px solid var(--green); border-radius: 0 var(--radius) var(--radius) 0; padding: 16px 20px; margin: 32px 0 0; }
.support h2 { font-size: 17px; margin: 0 0 6px; }
.support p { font-size: 15px; margin: 0 0 6px; }
.support p:last-child { margin: 0; }
.support a { font-weight: 700; }

/* ---------- フッター ---------- */
.site-footer { background: var(--white); border-top: 1px solid var(--line); }
.footer-inner { padding: 26px 28px 30px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 30px; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 22px; font-size: 14px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 36px; }
.footer-meta { font-size: 13px; color: var(--muted); }
.footer-meta p { margin: 0; }

[hidden] { display: none !important; }

@media (max-width: 760px) {
  .wrap, .footer-inner { padding-left: 18px; padding-right: 18px; }
  .topbar { flex-direction: column; align-items: stretch; gap: 0; min-height: 0; padding-top: 12px; }
  .brand svg { width: 28px; height: 32px; }
  .brand-name { font-size: 20px; }
  .brand-sub { font-size: 11px; }
  .site-nav { margin: 8px -18px 0; padding: 0 8px; border-top: 1px solid var(--line); justify-content: space-between; }
  .site-nav a { flex: 1; justify-content: center; padding: 0 4px; font-size: 14px; }
  .nav-long { display: none; }
  .nav-short { display: inline; }
  main { padding: 24px 0 48px; }
  h1, .hero h1 { font-size: 28px; }
  h2, .prose h2 { font-size: 20px; margin-top: 32px; }
  .lead { font-size: 17px; }
  .steps { grid-template-columns: 1fr; gap: 8px; }
  .steps li { display: grid; grid-template-columns: 34px 1fr; column-gap: 8px; align-items: baseline; padding: 12px 14px; }
  .steps .num { grid-row: span 2; font-size: 24px; margin: 0; }
  .quiz-question { font-size: 22px; }
  .result-title { font-size: 24px; }
  .book, .book-page .book { padding: 20px 18px; border-radius: 14px; }
  .book-title { font-size: 23px; }
  .book-page h1.book-title { font-size: 25px; }
  .fit-grid { grid-template-columns: 1fr; }
  .actions .btn { flex: 1 1 100%; }
  .actions .link-btn { flex: 0 0 auto; }
}
@media print {
  .site-header, .site-nav, .actions, .site-footer, .skip { display: none; }
  body { background: #fff; }
}
