/* 理科ラボ「実験道具」ページの枠（scripts/make-lab-tools.py）。道具の本体は .lab-tool-app の中。 */
.lab-tool-page { margin: 0; min-width: 320px; background: radial-gradient(circle at 85% 0%, #dff5f6 0, transparent 30rem), #f4f7f8; color: #173b52; font-family: "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", system-ui, sans-serif; }
.lab-tool-page *, .lab-tools-index * { box-sizing: border-box; }
.lab-tool-page .page-shell { width: min(1200px, calc(100% - 32px)); margin: 0 auto; }
.lab-tool-top { padding: 30px 0 8px; }
.lab-tool-hero .eyebrow { margin: 4px 0 8px; color: #087c86; font-size: .8rem; font-weight: 900; letter-spacing: .08em; }
.lab-tool-hero h1 { margin: 0 0 10px; color: #12364b; font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.3; letter-spacing: -.02em; }
.lab-tool-hero p:last-child { max-width: 760px; margin: 0 0 12px; color: #496373; line-height: 1.8; }
.lab-tool-app { width: min(1200px, calc(100% - 32px)); margin: 8px auto 0; border: 1px solid #d8e3e7; border-radius: 18px; background: #fff; box-shadow: 0 12px 30px rgba(29, 63, 78, .08); overflow: hidden; color: #173b52; }
.lab-tool-bottom { padding-bottom: 20px; }
.lab-tool-note { margin: 22px 0 0; color: #607783; font-size: .88rem; line-height: 1.8; }
@media (max-width: 560px) {
  .lab-tool-page .page-shell, .lab-tool-app { width: calc(100% - 20px); }
  .lab-tool-top { padding-top: 20px; }
  .lab-tool-app { border-radius: 14px; overflow-x: auto; }
}
/* 一覧ページ */
.lab-tools-index article > h1 { margin: 6px 0 12px; color: #12364b; font-size: clamp(1.6rem, 4vw, 2.3rem); }
.lab-tools-index article > p { max-width: 760px; color: #496373; line-height: 1.85; }
.lab-tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 24px 0 8px; }
.lab-tool-card { display: flex; flex-direction: column; gap: 6px; padding: 0 0 16px; border: 1px solid #d8e3e7; border-radius: 16px; background: #fff; color: #173b52; text-decoration: none; overflow: hidden; box-shadow: 0 10px 24px rgba(29, 63, 78, .07); transition: transform .15s, box-shadow .15s; }
.lab-tool-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(29, 63, 78, .13); }
.lab-tool-card:focus-visible { outline: 3px solid #c58220; outline-offset: 3px; }
.lab-tool-card img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; display: block; background: #eef4f5; border-bottom: 1px solid #e3ecef; }
.lab-tool-card-meta { margin: 8px 16px 0; color: #087c86; font-size: .78rem; font-weight: 800; }
.lab-tool-card-title { margin: 0 16px; font-size: 1.12rem; font-weight: 800; line-height: 1.45; }
.lab-tool-card-text { margin: 0 16px; color: #607783; font-size: .9rem; line-height: 1.7; }
@media (prefers-reduced-motion: reduce) { .lab-tool-card { transition: none; } }
.lab-tool-app .lab-orig-h1 { display: none !important; }
.information-page article a.lab-tool-card { color: #173b52; text-decoration: none; }
.information-page article a.lab-tool-card .lab-tool-card-title { color: #12364b; }
/* トップの「実験道具」 */
.lab-tools-home { margin: 0 0 48px; }
.lab-tools-home-head .section-kicker { margin-bottom: 4px; }
.lab-tools-home-head h2 { margin: 0 0 6px; color: #12364b; font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
.lab-tools-home-head p { margin: 0; color: #496373; line-height: 1.7; }
.lab-tools-home .lab-tool-grid { margin-top: 14px; }
.lab-tools-home .lab-tool-card { padding-bottom: 14px; }
.lab-tools-home-link { margin: 14px 0 0; }
.lab-tools-home-link a { display: inline-flex; align-items: center; min-height: 44px; color: #087c86; font-weight: 800; }

.lab-tools-home .lab-tool-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 820px) { .lab-tools-home .lab-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lab-tools-home .lab-tool-card:nth-child(n+3) { display: none; } }
@media (max-width: 600px) { .lab-tools-home .lab-tool-grid { grid-template-columns: 1fr; } }
/* 「操作して理解する」ページの型：使い方・ミッション・わかること・関連教材 */
.lab-howto { margin: 6px 0 4px; }
.lab-howto h2 { margin: 0 0 8px; color: #12364b; font-size: 1rem; }
.lab-howto ol { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: howto; }
.lab-howto li { position: relative; padding: 12px 14px 12px 48px; border: 1px solid #d3e5e8; border-radius: 12px; background: #fff; line-height: 1.6; counter-increment: howto; }
.lab-howto li::before { content: counter(howto); position: absolute; left: 12px; top: 12px; width: 26px; height: 26px; border-radius: 50%; background: #087c86; color: #fff; font-weight: 800; text-align: center; line-height: 26px; }
.lab-howto b { display: block; color: #12364b; }
.lab-howto span { color: #496373; font-size: .9rem; }
.lab-tool-app { scroll-margin-top: 12px; }
.lab-tool-app.is-loaded { animation: lab-loaded 1s ease; }
@keyframes lab-loaded { 0% { box-shadow: 0 0 0 4px rgba(8, 124, 134, .55); } 100% { box-shadow: 0 12px 30px rgba(29, 63, 78, .08); } }
.lab-missions { margin-top: 36px; }
.lab-missions .eyebrow, .lab-summary .eyebrow { margin: 0 0 4px; color: #087c86; font-size: .8rem; font-weight: 900; letter-spacing: .08em; }
.lab-missions h2, .lab-summary h2, .lab-related h2 { margin: 0 0 8px; color: #12364b; font-size: clamp(1.3rem, 2.6vw, 1.7rem); }
.lab-missions-lead { margin: 0 0 16px; color: #496373; line-height: 1.8; }
.lab-mission-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.lab-mission { display: flex; flex-direction: column; padding: 18px; border: 1px solid #d8e3e7; border-radius: 16px; background: #fff; box-shadow: 0 8px 20px rgba(29, 63, 78, .06); }
.lab-mission-no { margin: 0; color: #087c86; font-size: .78rem; font-weight: 900; letter-spacing: .08em; }
.lab-mission h3 { margin: 2px 0 6px; color: #12364b; font-size: 1.15rem; line-height: 1.45; }
.lab-mission-goal { margin: 0 0 10px; color: #315461; font-weight: 700; line-height: 1.7; }
.lab-mission-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.lab-mission-load { min-height: 44px; padding: 8px 16px; border: 0; border-radius: 10px; background: #087c86; color: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.lab-mission-load:hover { background: #075b65; }
.lab-mission-load.is-sub { border: 1px solid #087c86; background: #fff; color: #087c86; }
.lab-mission-load.is-sub:hover { background: #eaf7f8; }
.lab-mission-load:focus-visible, .lab-mission-learn summary:focus-visible, .lab-related a:focus-visible { outline: 3px solid #c58220; outline-offset: 3px; }
.lab-mission-steps { margin: 0 0 10px; padding-left: 1.3em; color: #315461; line-height: 1.75; font-size: .95rem; }
.lab-mission-look { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: #f3f8f9; color: #315461; line-height: 1.7; font-size: .93rem; }
.lab-mission-look b { display: block; color: #087c86; font-size: .8rem; }
.lab-mission-learn { margin-top: auto; border-top: 1px solid #e3ecef; padding-top: 8px; }
.lab-mission-learn summary { display: flex; align-items: center; min-height: 44px; color: #087c86; font-weight: 800; cursor: pointer; }
.lab-mission-learn p { margin: 4px 0 0; padding: 12px 14px; border-radius: 10px; background: #fff8e6; color: #3d3a2a; line-height: 1.8; }
.lab-summary { margin-top: 36px; padding: 22px; border: 1px solid #d8e3e7; border-radius: 16px; background: #fff; }
.lab-summary-table { overflow-x: auto; }
.lab-summary table { width: 100%; border-collapse: collapse; min-width: 480px; }
.lab-summary th, .lab-summary td { padding: 10px 12px; border-bottom: 1px solid #e3ecef; text-align: left; line-height: 1.6; }
.lab-summary thead th { color: #087c86; font-size: .9rem; }
.lab-summary tbody th { color: #12364b; white-space: nowrap; }
.lab-summary p { margin: 12px 0 0; color: #315461; line-height: 1.8; }
.lab-related { margin-top: 30px; }
.lab-related-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.lab-related a { display: flex; flex-direction: column; gap: 4px; min-height: 44px; padding: 14px 16px; border: 1px solid #c7dddf; border-radius: 12px; background: #f4faf9; color: #173b52; text-decoration: none; }
.lab-related a:hover { border-color: #087c86; }
.lab-related b { color: #087c86; }
.lab-related span { color: #496373; font-size: .88rem; }
@media (max-width: 760px) { .lab-howto ol { grid-template-columns: 1fr; } .lab-mission-list { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .lab-tool-app.is-loaded { animation: none; } }
@media print { .lab-mission-actions { display: none; } .lab-mission-learn[open] p, .lab-mission-learn p { display: block; } }
.lab-start-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 14px 0 4px; }
.lab-start-row button { min-height: 48px; padding: 10px 22px; border: 0; border-radius: 12px; background: #087c86; color: #fff; font: inherit; font-weight: 800; font-size: 1.02rem; cursor: pointer; box-shadow: 0 6px 14px rgba(8, 124, 134, .22); }
.lab-start-row button:hover { background: #075b65; }
.lab-start-row span { color: #496373; font-size: .92rem; }
/* いまのミッション（道具のすぐ上） */
.lab-current { margin: 14px 0 4px; padding: 16px 18px; border: 2px solid #087c86; border-radius: 16px; background: #f2fbfb; scroll-margin-top: 10px; }
.lab-current-no { margin: 0; color: #087c86; font-size: .78rem; font-weight: 900; letter-spacing: .08em; }
.lab-current h2 { margin: 2px 0 4px; color: #12364b; font-size: 1.2rem; }
.lab-current-goal { margin: 0 0 8px; color: #315461; font-weight: 700; }
.lab-current ol { margin: 0 0 8px; padding-left: 1.3em; color: #315461; line-height: 1.75; }
.lab-current-look { margin: 0 0 8px; padding: 8px 12px; border-radius: 10px; background: #fff; color: #315461; line-height: 1.7; }
.lab-current-look b { margin-right: 10px; color: #087c86; font-size: .82rem; }
.lab-current-learn summary { display: flex; align-items: center; min-height: 44px; color: #087c86; font-weight: 800; cursor: pointer; }
.lab-current-learn p { margin: 0 0 6px; padding: 12px 14px; border-radius: 10px; background: #fff8e6; color: #3d3a2a; line-height: 1.8; }
.lab-current-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; }
.lab-current-nav button, .lab-current-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid #087c86; border-radius: 10px; background: #fff; color: #087c86; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.lab-current-nav .is-next { margin-left: auto; background: #087c86; color: #fff; }
.lab-current-nav .is-next:hover { background: #075b65; }
.lab-current-nav .is-sub { border-color: #b9d3d7; color: #496373; }
.lab-start-row button:focus-visible, .lab-current-nav button:focus-visible, .lab-current-nav a:focus-visible, .lab-current-learn summary:focus-visible { outline: 3px solid #c58220; outline-offset: 3px; }
@media (max-width: 560px) { .lab-current { padding: 14px; } .lab-current-nav .is-next { margin-left: 0; } }
.lab-howto summary { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; list-style: none; }
.lab-howto summary::-webkit-details-marker { display: none; }
.lab-howto summary::before { content: "▸"; color: #087c86; transition: transform .15s; }
.lab-howto[open] summary::before { transform: rotate(90deg); }
.lab-howto summary h2 { margin: 0; }
.lab-howto summary span { color: #607783; font-size: .85rem; }
.lab-howto summary:focus-visible { outline: 3px solid #c58220; outline-offset: 3px; }
/* やること（できたらチェック） */
.lab-current-todo { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin: 0 0 8px; padding: 10px 12px; border: 1px dashed #87b9c0; border-radius: 10px; background: #fff; color: #173b52; line-height: 1.6; }
.lab-current-todo b { margin-right: 8px; color: #087c86; font-size: .82rem; }
.lab-check { flex: none; width: 24px; height: 24px; border: 2px solid #87b9c0; border-radius: 6px; background: #fff; }
.lab-current-todo em { font-style: normal; font-weight: 800; color: #1f7a3d; }
.lab-current-todo[data-done="1"] { border-style: solid; border-color: #2e9a55; background: #eefaf1; }
.lab-current-todo[data-done="1"] .lab-check { border-color: #2e9a55; background: #2e9a55; position: relative; }
.lab-current-todo[data-done="1"] .lab-check::after { content: "✓"; position: absolute; inset: 0; color: #fff; font-weight: 900; text-align: center; line-height: 20px; }

/* 押しやすさ（2026-10-14 社長「ボタンの配置や押しやすさも」）：道具の中の操作部品をそろえる。
   道具ごとの CSS より強く効くよう .lab-tool-page から指定。道具ごとの例外は tools.json の css で。 */
.lab-tool-page .lab-tool-app button, .lab-tool-page .lab-tool-app select { min-height: 40px; font-size: max(14px, 1em); touch-action: manipulation; cursor: pointer; }
.lab-tool-page .lab-tool-app button:disabled { cursor: default; }
.lab-tool-page .lab-tool-app input[type=range] { box-sizing: border-box; min-height: 30px; padding-block: 13px; background-clip: content-box; cursor: pointer; accent-color: #087c86; touch-action: pan-y; }
.lab-tool-page .lab-tool-app input[type=checkbox], .lab-tool-page .lab-tool-app input[type=radio] { width: 20px; height: 20px; flex: none; accent-color: #087c86; cursor: pointer; }
.lab-tool-page .lab-tool-app label { cursor: pointer; }
.lab-tool-page .lab-tool-app :is(button, select, input, summary, a):focus-visible { outline: 3px solid #c58220; outline-offset: 2px; }
@media (pointer: coarse) {
  .lab-tool-page .lab-tool-app button, .lab-tool-page .lab-tool-app select { min-height: 44px; }
  .lab-tool-page .lab-tool-app input[type=range] { min-height: 40px; padding-block: 18px; }
}
.lab-tool-page .lab-tool-app input[type=number], .lab-tool-page .lab-tool-app input[type=text] { min-height: 40px; font-size: 16px; padding: 4px 8px; border: 1px solid #b8ced3; border-radius: 8px; background: #fff; color: #173b52; }

/* 「このページのリンクをコピー」「大画面にする」（lab-share.js・2026-10-15） */
.lab-share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; margin: 12px 0 0; }
.lab-share button { min-height: 40px; padding: 6px 16px; border: 1px solid #087c86; border-radius: 999px; background: #fff; color: #087c86; font: inherit; font-size: .92rem; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.lab-share button:hover { background: #eef7f8; }
.lab-share button[aria-pressed="true"] { background: #087c86; color: #fff; }
.lab-share-status { font-size: .88rem; font-weight: 700; color: #1f6b3a; }
.lab-share-url { flex: 1 1 100%; min-height: 40px; padding: 4px 10px; border: 1px solid #b8ced3; border-radius: 8px; font-size: 16px; }
@media (pointer: coarse) { .lab-share button { min-height: 44px; } }
.lab-stage:fullscreen { background: #f4f7f8; overflow: auto; }
.lab-stage.is-expanded { position: fixed; inset: 0; z-index: 1000; background: #f4f7f8; overflow: auto; }
.lab-stage:fullscreen .lab-share, .lab-stage.is-expanded .lab-share { position: sticky; top: 0; z-index: 5; padding: 8px 0; margin: 0; background: #f4f7f8; }
body.lab-has-expanded { overflow: hidden; }

/* 大画面（PC）で道具を画面いっぱいに（lab-fit.js が .lab-fit を付ける・2026-10-21）
   上の帯は1〜2行にまとめ、残りの高さを道具に使う。ミッションの手順・見るところは「ミッションの説明」で開く。 */
.lab-stage.lab-fit { overflow: auto; }
.lab-stage.lab-fit .lab-stage-bar { position: sticky; top: 0; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; width: auto; margin: 0; padding: 8px 16px; background: #f4f7f8; box-shadow: 0 1px 0 #dbe6e9; }
.lab-stage.lab-fit .lab-share { order: 2; position: static; flex: none; margin: 0 0 0 auto; padding: 0; background: none; }
.lab-stage.lab-fit .lab-share [data-share="copy"] { display: none; }
.lab-stage.lab-fit .lab-current { order: 1; flex: 1 1 520px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0; padding: 6px 12px; }
.lab-stage.lab-fit .lab-current[hidden] { display: none; }
.lab-stage.lab-fit .lab-current-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; }
.lab-stage.lab-fit .lab-current h2 { margin: 0; font-size: 1.05rem; }
.lab-stage.lab-fit .lab-current-todo { margin: 0; padding: 4px 10px; }
.lab-stage.lab-fit .lab-current-nav { margin: 0 0 0 auto; }
.lab-stage.lab-fit .lab-current-nav button, .lab-stage.lab-fit .lab-current-nav a { min-height: 40px; padding: 6px 12px; }
.lab-stage.lab-fit .lab-current-nav .is-next { margin-left: 0; }
.lab-stage.lab-fit:not(.lab-fit-open) :is(.lab-current-goal, .lab-current ol, .lab-current-look, .lab-current-learn) { display: none; }
.lab-stage.lab-fit.lab-fit-open .lab-current { display: block; flex: 1 1 520px; max-height: 46vh; overflow: auto; }
.lab-stage.lab-fit.lab-fit-open .lab-share { align-self: flex-start; }
.lab-stage.lab-fit.lab-fit-open .lab-current-nav { margin: 6px 0 0; }
.lab-fit-more { display: none; }
.lab-stage.lab-fit .lab-fit-more:not([hidden]) { display: inline-flex; align-items: center; }
.lab-stage.lab-fit .lab-tool-app { max-width: none; }
