/* FamilyBoard 使い方（/familyboard/help/）。LP（familyboard.css）と同じ紙の地色・ミント・インディゴを使い、図の輪だけを強く出す */
.fbh { --fbh-tint: var(--tp-mint); --fbh-ink: var(--tp-mint-ink); --fbh-ring: var(--tp-spark); background: var(--tp-paper); color: var(--tp-ink); }
.fbh [hidden] { display: none !important; }
.fbh .fbh-g-more { --fbh-tint: var(--tp-yellow-2); --fbh-ink: var(--tp-yellow-ink); }
.fbh .fbh-g-family { --fbh-tint: var(--tp-lavender-3); --fbh-ink: var(--tp-indigo-deep); }
.fbh-shell { padding-block: 28px 72px; }
.fbh-crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .78rem; color: var(--tp-muted); }
.fbh-crumbs a { color: inherit; text-underline-offset: 4px; }
.fbh-crumbs a:hover { color: var(--tp-indigo); }
.fbh h1 { margin: 20px 0 0; font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.4; letter-spacing: -.04em; font-weight: 900; text-wrap: balance; }
.fbh h2 { font-size: clamp(1.25rem, 2vw, 1.6rem); line-height: 1.5; letter-spacing: -.02em; font-weight: 800; margin: 0; }
.fbh-summary { margin: 14px 0 0; max-width: 42rem; line-height: 1.9; color: var(--tp-ink-soft); }
.fbh-note { margin: 18px 0 0; font-size: .78rem; line-height: 1.9; color: var(--tp-muted); }

/* 一覧 */
.fbh-index-head { padding-bottom: 36px; }
.fbh-search { margin-top: 28px; max-width: 34rem; }
.fbh-search label { display: block; margin-bottom: 8px; font-size: .8rem; font-weight: 700; }
.fbh-search input { width: 100%; min-height: 54px; padding: 12px 20px; border: 1.5px solid var(--tp-ink); border-radius: var(--tp-radius-pill); background: var(--tp-white); font: inherit; font-size: 1rem; color: var(--tp-ink); }
.fbh-search input:focus-visible { outline: 3px solid var(--tp-indigo); outline-offset: 2px; }
.fbh-empty { padding: 24px 0; line-height: 1.9; }
.fbh-group-block { padding-block: 28px 20px; }
.fbh-group-block h2 { margin-bottom: 18px; }
.fbh-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 14px; }
.fbh-card { display: flex; flex-direction: column; gap: 6px; padding: 22px 22px 24px; border-radius: var(--tp-radius-card); background: var(--fbh-tint); color: var(--tp-ink); text-decoration: none; transition: transform .2s, box-shadow .2s; }
.fbh-card:hover { transform: translateY(-3px); box-shadow: var(--tp-shadow-flat-sm); }
.fbh-card:focus-visible { outline: 3px solid var(--tp-indigo); outline-offset: 3px; }
.fbh-card-title { font-size: 1.05rem; font-weight: 800; line-height: 1.5; }
.fbh-card-summary { font-size: .85rem; line-height: 1.8; color: var(--tp-ink-soft); }

/* トピック */
.fbh-topic-head { padding-bottom: 12px; }
.fbh-group { margin: 28px 0 0; display: inline-block; padding: 4px 14px; border-radius: var(--tp-radius-pill); background: var(--fbh-tint); color: var(--fbh-ink); font-size: .78rem; font-weight: 800; }
.fbh-topic-head h1 { margin-top: 14px; }
.fbh-figure { margin-top: 36px; padding: 28px; border-radius: var(--tp-radius-panel); background: var(--fbh-tint); }
.fbh-figure-title { margin: 0 0 20px; font-size: 1.05rem; font-weight: 800; line-height: 1.6; }
.fbh-figure-body { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.fbh-stage { position: relative; width: 100%; border-radius: 22px; background: var(--tp-white); box-shadow: var(--tp-shadow-flat-sm); }
.fbh-stage picture { display: block; }
.fbh-stage img { display: block; width: 100%; height: auto; border-radius: 22px; }
/* 輪と番号。図のうえに重ね、見えたとき番号順に1つずつ出る */
.fbh-ring { position: absolute; border: 2px solid var(--fbh-ring); border-radius: 10px; box-sizing: content-box; margin: -5px 0 0 -5px; padding: 3px; pointer-events: none; }
.fbh-ring b { position: absolute; left: -9px; top: -11px; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--fbh-ring); color: #fff; font: 700 .75rem/1 var(--tp-font-display); }
.fbh-js .fbh-ring { opacity: 0; }
.fbh-js .is-seen .fbh-ring { animation: fbh-ring .45s cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: calc(.15s + var(--i) * .17s); }
@keyframes fbh-ring { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
.fbh-notes { margin: 0; padding: 0; list-style: none; counter-reset: note; display: grid; gap: 16px; }
.fbh-notes li { counter-increment: note; display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; font-size: .95rem; line-height: 1.8; }
.fbh-notes li::before { content: counter(note); display: grid; place-items: center; width: 24px; height: 24px; margin-top: 3px; border-radius: 50%; background: var(--fbh-ring); color: #fff; font: 700 .75rem/1 var(--tp-font-display); }
.fbh-sections { display: grid; margin-top: 40px; max-width: 60rem; }
.fbh-section { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: 12px 40px; padding-block: 28px; border-top: 1px solid var(--tp-line); }
.fbh-section h2 { font-size: 1.1rem; }
.fbh-section ul { margin: 0; padding-left: 1.2em; display: grid; gap: 10px; line-height: 1.95; color: var(--tp-ink-soft); }
.fbh-related { margin: 12px 0 0; padding: 18px 22px; max-width: 46rem; border-radius: var(--tp-radius-card); background: var(--fbh-tint); font-size: .9rem; line-height: 1.8; }

/* よくある質問 */
.fbh-faq { margin-top: 44px; max-width: 46rem; }
.fbh-faq-all { margin-top: 36px; }
.fbh-faq h2 { margin-bottom: 14px; }
.fbh-faq-item { border-top: 1px solid var(--tp-line); }
.fbh-faq-item:last-of-type { border-bottom: 1px solid var(--tp-line); }
.fbh-faq-item summary { cursor: pointer; padding: 18px 28px 18px 0; font-weight: 700; line-height: 1.7; list-style: none; position: relative; }
.fbh-faq-item summary::-webkit-details-marker { display: none; }
.fbh-faq-item summary::after { content: '+'; position: absolute; right: 4px; top: 16px; font: 400 1.4rem/1.2 var(--tp-font-display); color: var(--tp-muted); }
.fbh-faq-item[open] summary::after { content: '−'; }
.fbh-faq-item summary:focus-visible { outline: 3px solid var(--tp-indigo); outline-offset: 2px; }
.fbh-faq-item p { margin: 0 0 20px; line-height: 1.95; color: var(--tp-ink-soft); }
.fbh-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.fbh-pager a { display: flex; flex-direction: column; gap: 4px; padding: 18px 22px; border: 1px solid var(--tp-line); border-radius: var(--tp-radius-card); background: var(--tp-white); color: var(--tp-ink); font-weight: 800; text-decoration: none; }
.fbh-pager a:hover { border-color: var(--tp-ink); }
.fbh-pager small { font-size: .72rem; font-weight: 700; color: var(--tp-muted); }
.fbh-next { text-align: right; grid-column: 2; }

/* 解決しないとき */
.fbh-contact { border-top: 1px solid var(--tp-line); background: var(--tp-white); }
.fbh-contact .fbh-shell { padding-block: 56px 72px; }
.fbh-contact p { margin: 14px 0 24px; max-width: 40rem; line-height: 1.95; color: var(--tp-ink-soft); }
.fbh-legal { display: flex; gap: 24px; margin-top: 28px; font-size: .85rem; }
.fbh-legal a { color: var(--tp-ink); text-underline-offset: 4px; }

@media (max-width: 800px) {
    .fbh-section { grid-template-columns: minmax(0, 1fr); }
    .fbh-figure { padding: 18px; }
    .fbh-figure-body { grid-template-columns: minmax(0, 1fr); }
    .fbh-stage { max-width: 440px; }
}
@media (max-width: 480px) {
    .fbh-pager { grid-template-columns: 1fr; }
    .fbh-next { grid-column: auto; }
}

/* アプリ内の WebView（?app=1）。サイトの見出し・フッターは出さず、アプリの画面の延長に見せる */
.fbh-app .site-header,
.fbh-app .site-footer { display: none; }
.fbh-app .fbh-shell { padding-block-start: 12px; }
.fbh-app .fbh-contact .fbh-shell { padding-block: 32px 48px; }

/* アプリ内の WebView（?app=1）で、アプリがダークモードのとき。通常のサイトはライトのみ */
@media (prefers-color-scheme: dark) {
    body.fbh-app { background: #15131c; }
    .fbh-app .fbh {
        color-scheme: dark;
        --tp-paper: #15131c;
        --tp-white: #211e2c;
        --tp-ink: #ece9f5;
        --tp-ink-soft: #cbc6da;
        --tp-muted: #a8a2bb;
        --tp-line: #383444;
        --tp-indigo: #9d90f0;
        --tp-shadow-flat-sm: none;
        --fbh-tint: #183228;
        --fbh-ink: #84d8b2;
    }
    .fbh-app .fbh .fbh-g-more { --fbh-tint: #33280f; --fbh-ink: #f0cb6a; }
    .fbh-app .fbh .fbh-g-family { --fbh-tint: #26223f; --fbh-ink: #b6a9f6; }
    .fbh-app .fbh-card:hover { box-shadow: none; }
    .fbh-app .fbh-stage { box-shadow: none; }
    .fbh-app .fbh-search input { border-color: var(--tp-line); }
    .fbh-app .fbh .tp-button { --btn-dot: #5b4bd0; }
}
