/* 過去問ライブラリ（学習ページ）。ひな形の common.css の上に重ねる。クラスは st- で始める */
/* 色はすべて common.css 冒頭の :root（--capital-color 系）から作る。ここに色の値を直接書かない */
:root { --st-rgb: var(--capital-color-r), var(--capital-color-g), var(--capital-color-b); --st-tint1: rgba(var(--st-rgb), .08); --st-tint2: rgba(var(--st-rgb), .3); }
.st-main { box-sizing: border-box; width: 100%; max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; line-height: 1.8; text-align: left; min-width: 0; }
.container.st-wide .st-main { max-width: 1200px; }
.st-hero { padding: 24px 0 8px; }
.st-hero-title { font-size: 2rem; margin: 0 0 8px; }
.st-hero-lead { margin: 0; }
.st-h1 { font-size: 1.6rem; margin: 8px 0 12px; line-height: 1.4; }
.st-h2 { font-size: 1.25rem; margin: 0 0 12px; padding-left: 10px; border-left: 5px solid var(--capital-color); }
.st-h3 { font-size: 1.05rem; margin: 0 0 8px; }
.st-section { margin: 32px 0; }
.st-lead { margin: 0 0 8px; }
.st-note { font-size: .85rem; color: #555; margin: 8px 0; }
.st-facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; padding: 0; }
.st-facts span { background: #f3f3f3; border-radius: 999px; padding: 2px 12px; font-size: .85rem; }
.st-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.st-btn { display: inline-block; padding: 10px 18px; border: 1px solid #bbb; border-radius: 8px; background: #fff; color: #222; text-decoration: none; cursor: pointer; font-size: .95rem; line-height: 1.4; }
.st-btn:hover { background: #f5f5f5; }
.st-btn-main { background: var(--capital-color); border-color: var(--capital-border-color); color: var(--capital-text-color); font-weight: bold; }
.st-btn-main:hover { background: var(--capital-color-dark1); }
.st-btn[disabled] { opacity: .5; cursor: default; }
.st-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.st-card { display: block; padding: 16px; border: 1px solid #ddd; border-radius: 12px; background: #fff; color: inherit; text-decoration: none; }
.st-card:hover { border-color: var(--capital-border-color); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.st-card-name { display: block; font-weight: bold; font-size: 1.1rem; }
.st-card-desc { display: block; font-size: .85rem; color: #555; margin: 6px 0; }
.st-card-meta { display: block; font-size: .8rem; color: #777; }
.st-points { padding-left: 1.2em; }
.st-box { border: 1px solid #ddd; border-radius: 12px; padding: 12px 16px; margin: 16px 0; background: #fafafa; }
.st-big { font-size: 1.6rem; font-weight: bold; margin: 4px 0; }
.st-big small { font-size: .8rem; font-weight: normal; color: #555; }
.st-rank { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.st-rank li { counter-increment: rank; display: grid; grid-template-columns: 1.6em 1fr; gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid #eee; align-items: center; }
.st-rank li::before { content: counter(rank); grid-row: 1 / span 2; font-weight: bold; text-align: center; }
.st-rank-name { font-weight: bold; text-align: left; }
.st-bar { display: block; height: 8px; background: #eee; border-radius: 4px; overflow: hidden; }
.st-bar-fill { display: block; height: 100%; background: var(--capital-color-dark2); }
.st-rank-num { grid-column: 2; font-size: .8rem; color: #666; text-align: left; }
.st-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0; }
.st-plist { list-style: none; padding: 0; margin: 0; }
.st-plist li { display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid #eee; }
.st-plist-n { color: #777; font-size: .85rem; margin-left: auto; }
.st-plist-go { font-size: .85rem; border: 1px solid #bbb; border-radius: 6px; padding: 2px 10px; text-decoration: none; color: inherit; }
.st-qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 16px 0; }
.st-qcell { display: block; border: 1px solid #ddd; border-radius: 8px; padding: 8px 10px; background: #fff; color: inherit; text-decoration: none; }
.st-qcell:hover { border-color: var(--capital-color); }
.st-qno { display: block; font-weight: bold; }
.st-qcat { display: block; font-size: .75rem; color: #666; line-height: 1.4; }
/* 表 */
.st-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.st-table { border-collapse: collapse; font-size: .85rem; width: 100%; }
.st-table th, .st-table td { border: 1px solid #e3e3e3; padding: 4px 8px; text-align: center; white-space: nowrap; }
.st-table thead th { background: #f6f6f6; }
.st-matrix { width: auto; }
.st-matrix td { min-width: 28px; }
.st-sticky { position: sticky; left: 0; background: #fff; text-align: left !important; z-index: 1; }
.st-matrix thead .st-sticky { background: #f6f6f6; }
.st-vert { writing-mode: vertical-rl; font-size: .75rem; padding: 6px 2px !important; }
.st-vert a { color: inherit; text-decoration: none; }
.st-group-row th { background: #eee; text-align: left; }
.st-total { font-weight: bold; background: #fafafa; }
.st-focus td, .st-focus th { background: var(--st-tint1); }
.st-t0 { background: #fff; } .st-t1 { background: rgba(var(--st-rgb), .12); } .st-t2 { background: rgba(var(--st-rgb), .3); }
.st-t3 { background: rgba(var(--st-rgb), .5); } .st-t4 { background: rgba(var(--st-rgb), .75); } .st-t5 { background: var(--capital-color); color: var(--capital-text-color); }
/* 演習 */
.st-setup { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 12px; border: 1px solid #ddd; border-radius: 12px; background: #fafafa; margin: 12px 0 20px; }
.st-field { display: flex; flex-direction: column; gap: 2px; }
.st-field label { font-size: .8rem; color: #555; }
.st-field select { padding: 8px; border: 1px solid #bbb; border-radius: 6px; background: #fff; font-size: .95rem; max-width: 100%; box-sizing: border-box; }
.st-field { min-width: 0; max-width: 100%; }
.st-practice { margin: 12px 0; }
.st-q-head { display: flex; justify-content: space-between; align-items: baseline; font-size: .85rem; color: #555; margin-bottom: 4px; }
.st-q-img { display: block; width: 100%; height: auto; border: 1px solid #ddd; border-radius: 8px; background: #fff; }
.st-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(56px, 1fr)); gap: 8px; margin: 12px 0; }
.st-choice { padding: 14px 0; font-size: 1.2rem; font-weight: bold; border: 2px solid #bbb; border-radius: 10px; background: #fff; cursor: pointer; }
.st-choice:hover:not([disabled]) { border-color: var(--capital-border-color); background: var(--st-tint1); }
.st-choice.is-correct { border-color: #1a9a4b; background: #e6f7ec; }
.st-choice.is-wrong { border-color: #d33; background: #fde8e8; }
.st-choice[disabled] { cursor: default; }
.st-result { border-radius: 10px; padding: 10px 14px; margin: 8px 0; }
.st-result.ok { background: #e6f7ec; border: 1px solid #1a9a4b; }
.st-result.ng { background: #fde8e8; border: 1px solid #d33; }
.st-result-main { font-weight: bold; font-size: 1.1rem; }
.st-result-meta { font-size: .85rem; color: #444; margin-top: 4px; }
.st-expl { white-space: pre-wrap; margin-top: 6px; }
.st-summary { border: 1px solid #ddd; border-radius: 12px; padding: 16px; background: #fff; }
.st-wrong-list { padding-left: 1.2em; }
.st-error { color: #c00; }
@media (max-width: 600px) {
  .st-hero-title { font-size: 1.6rem; }
  .st-choice { padding: 12px 0; }
}

/* パンくず・タブ（概要／過去問） */
.st-crumb { font-size: .8rem; color: #666; margin: 0 0 4px; }
.st-crumb a { color: #666; }
.st-crumb-sep { margin: 0 4px; color: #aaa; }
.st-tabs { display: flex; gap: 4px; border-bottom: 2px solid #eee; margin: 8px 0 16px; }
.st-tab { padding: 8px 18px; margin-bottom: -2px; border-bottom: 3px solid transparent; color: #555; text-decoration: none; font-weight: bold; }
.st-tab:hover { color: var(--capital-color); }
.st-tab.is-active { color: var(--capital-color); border-bottom-color: var(--capital-color); }

/* 概要ページ */
.st-cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; background: var(--st-tint1); border-color: var(--st-tint2); }
.st-cta-title { margin: 0 0 6px; font-weight: bold; font-size: 1.05rem; }
.st-cta .st-actions { margin: 0; }
.st-doc h2 { font-size: 1.25rem; margin: 28px 0 12px; padding-left: 10px; border-left: 5px solid var(--capital-color); }
.st-doc p, .st-doc li { line-height: 1.8; }
.st-doc table { border-collapse: collapse; width: 100%; margin: 12px 0; font-size: .9rem; display: block; overflow-x: auto; }
.st-doc th, .st-doc td { border: 1px solid #e3e3e3; padding: 6px 10px; text-align: left; white-space: nowrap; }
.st-doc thead th { background: var(--st-tint1); }
.st-table td.st-left { text-align: left; }

/* トップ：分野 × 実施団体の絞り込み */
.st-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.st-filter-label { font-size: .8rem; color: #555; min-width: 4.5em; font-weight: bold; }
.st-chip { border: 1px solid #ccc; background: #fff; border-radius: 999px; padding: 4px 12px; font-size: .85rem; cursor: pointer; color: #333; }
.st-chip small { color: #888; margin-left: 2px; }
.st-chip:hover { border-color: var(--capital-border-color); }
.st-chip.is-active { background: var(--capital-color); border-color: var(--capital-border-color); color: var(--capital-text-color); font-weight: bold; }
.st-chip.is-active small { color: inherit; }
.st-field-group { margin-top: 18px; }
.st-field-title { font-size: 1rem; margin: 0 0 8px; color: #444; }
.st-card-org { display: inline-block; font-size: .7rem; color: #555; background: var(--st-tint1); border: 1px solid var(--st-tint2); border-radius: 4px; padding: 0 6px; margin-bottom: 4px; }

/* 横幅：表や長い語で画面からはみ出さないように */
.st-rank-table td.st-left { white-space: normal; min-width: 8em; }
.st-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.st-main img { max-width: 100%; height: auto; }
.st-main { overflow-wrap: anywhere; }

/* 複数選択・複数画像（2026-11-03） */
.st-choice.is-picked, .st-choice.is-picked:hover { background: var(--capital-color); color: #fff; border-color: var(--capital-color); }
.st-multi-note { margin: 8px 0; font-weight: bold; color: var(--capital-color-dark2); }
.st-submit { display: block; margin: 10px auto 0; min-width: 200px; }
.st-submit:disabled { opacity: .5; cursor: not-allowed; }
.st-q-img-sub { margin-top: 10px; }
/* お気に入りボタン（タブの右端） */
.st-tabs { align-items: flex-end; }
.st-fav { margin-left: auto; margin-bottom: 4px; padding: 4px 12px; border: 1px solid var(--capital-color); border-radius: 999px; background: #fff; color: var(--capital-color-dark2); font-size: .9rem; font-weight: bold; cursor: pointer; text-decoration: none; white-space: nowrap; }
.st-fav.is-on { background: var(--capital-color); color: #fff; }
.st-fav:disabled { opacity: .6; }
/* マイページ（学習データ） */
.st-my { margin-bottom: 2rem; }
.st-my-list { list-style: none; padding: 0; margin: 0 0 1rem; }
.st-my-list li { padding: 8px 0; border-bottom: 1px solid #eee; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.st-my-list li > a:first-child { font-weight: bold; }
.st-my-sub { font-size: .85rem; }
.st-my-x { margin-left: auto; font-size: .8rem; padding: 2px 10px; border: 1px solid #ccc; border-radius: 999px; background: #fff; cursor: pointer; }
.st-ok { color: #2e7d32; font-weight: bold; }
.st-ng { color: #c62828; font-weight: bold; }
/* トップ：お気に入り・現在進行中、資格名の検索 */
.st-mine-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.st-mine-item { display: inline-block; padding: 6px 14px; border: 1px solid var(--capital-color); border-radius: 999px; background: var(--st-tint1, #fff7f1); color: var(--capital-color-dark2); font-weight: bold; text-decoration: none; }
.st-search { margin: 0 0 12px; }
.st-search input { box-sizing: border-box; width: 100%; max-width: 420px; padding: 8px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 1rem; }
/* 広告枠（問題・回答ボタンから離し、本文の下にだけ置く） */
.st-ad { margin: 32px 0 8px; min-height: 100px; text-align: center; overflow: hidden; }
.st-ad-label { font-size: .7rem; color: #999; margin-bottom: 4px; }
.st-ad-preview { display: flex; align-items: center; justify-content: center; min-height: 250px; background: repeating-linear-gradient(45deg, #eee, #eee 10px, #e4e4e4 10px, #e4e4e4 20px); color: #888; font-size: .85rem; border-radius: 8px; }
.st-ad-practice_bottom { margin-top: 48px; }
@media (max-width: 600px) { .st-ad-preview { min-height: 200px; } }
/* トップ：まとめ（航空従事者など）。1つのカードで、開くと資格の一覧 */
.st-family > summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.st-family > summary::-webkit-details-marker { display: none; }
.st-family-open { color: var(--capital-color-dark2); font-weight: bold; white-space: nowrap; }
.st-family[open] .st-family-open { visibility: hidden; }
.st-family[open] { grid-column: 1 / -1; }
.st-family-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 16px; }
.st-family-list li { padding: 6px 0; border-top: 1px solid #eee; }
.st-family-list a { font-weight: bold; }
/* 個人設定のトグル（スイッチ） */
.st-h2-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.st-h2-row .st-h2 { margin-bottom: 8px; }
.st-toggle { display: inline-flex; flex: none; white-space: nowrap; align-items: center; gap: 8px; cursor: pointer; font-size: .85rem; color: #555; user-select: none; }
.st-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.st-toggle-track { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #ccc; transition: background .2s; flex: none; }
.st-toggle-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .2s; }
.st-toggle input:checked + .st-toggle-track { background: var(--capital-color); }
.st-toggle input:checked + .st-toggle-track::after { transform: translateX(18px); }
.st-toggle input:focus-visible + .st-toggle-track { outline: 2px solid var(--capital-color-dark2); outline-offset: 2px; }
.st-toggle input:disabled + .st-toggle-track { opacity: .6; }
[hidden] { display: none !important; }
/* トップ：資格カード右上のお気に入りの星（塗りつぶし＝お気に入り済み） */
.st-card-item { position: relative; }
.st-card-item > .st-card { height: 100%; box-sizing: border-box; padding-right: 44px; }
.st-star { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; font-size: 1.4rem; line-height: 1; color: #bbb; cursor: pointer; text-decoration: none; border-radius: 50%; padding: 0; }
.st-star:hover { background: var(--st-tint1); color: var(--capital-color); }
.st-star.is-on { color: var(--capital-color); }
.st-star:disabled { opacity: .5; }
.st-star:focus-visible { outline: 2px solid var(--capital-color-dark2); outline-offset: 1px; }
.st-star-inline { position: static; display: inline-flex; width: 28px; height: 28px; font-size: 1.1rem; vertical-align: middle; margin-left: 4px; }
/* ロゴ画像（ヘッダー・フッター。元データは design/logo） */
.menu-brand .st-brand { height: 100%; display: flex; align-items: center; }
.menu-brand .st-brand img { height: 100%; width: auto; display: block; }
.footer-brand img.st-footer-logo { height: 5rem; width: auto; max-width: 100%; }
@media screen and (max-width: 600px) { .footer-brand img.st-footer-logo { height: 4rem; } }

/* 狭い画面（320px）の調整（2026-11-04 網羅テスト） */
.st-tab, .st-fav, .st-plist-n, .st-plist-go { white-space: nowrap; flex-shrink: 0; }
.st-tabs { flex-wrap: wrap; row-gap: 4px; }
.menu-brand { min-width: 0; flex-shrink: 1; }
.menu-brand .st-brand img { max-width: calc(100vw - 150px); height: auto; max-height: 100%; object-fit: contain; }
@media screen and (max-width: 360px) { .st-tab { padding: 8px 12px; } .st-fav { font-size: .8rem; padding: 3px 8px; } }
.st-ad-practice_bottom { margin-top: 96px; }
/* 問題画像の拡大表示（タップで全画面） */
.st-q-img { cursor: zoom-in; }
.st-zoom { position: fixed; inset: 0; z-index: 20000; background: rgba(0,0,0,.88); display: flex; flex-direction: column; }
.st-zoom[hidden] { display: none !important; }
html.st-zoom-open, html.st-zoom-open body { overflow: hidden; }
.st-zoom-bar { display: flex; justify-content: flex-end; gap: 8px; padding: 8px; flex: none; }
.st-zoom-bar button { border: none; border-radius: 999px; background: #fff; color: #333; font-weight: bold; padding: 8px 16px; font-size: .95rem; cursor: pointer; }
.st-zoom-close { width: 40px; padding: 8px 0 !important; font-size: 1.3rem !important; line-height: 1; }
.st-zoom-box { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 0 8px 24px; touch-action: pan-x pan-y pinch-zoom; }
.st-zoom-box img { display: block; width: 100%; height: auto; margin: 0 auto; background: #fff; cursor: zoom-in; }
.st-zoom.is-zoomed .st-zoom-box img { width: auto; max-width: none; min-width: 200%; cursor: zoom-out; }
@media (min-width: 900px) { .st-zoom-box img { width: auto; max-width: 100%; } .st-zoom.is-zoomed .st-zoom-box img { min-width: 0; width: auto; max-width: none; transform-origin: top left; zoom: 1.8; } }
.st-zoom-hint { margin: 4px 0 0; font-size: .75rem; color: #888; text-align: right; }
