/* 理科ラボ「基礎を理解する」教材の型（2026-10-15）。ページの枠は balance-two-forces.css・publication.css を使う */
:root { --ink: #173b52; --sub: #496373; --teal: #087c86; --teal-d: #075b65; --line: #c8dfe3; --bg: #f4f7f8; --amber: #c58220; --ok: #2e9a55; --ng: #c0453a; }

.lv-steps { display: grid; margin-top: 18px !important; grid-template-columns: repeat(4, 1fr); gap: 8px; list-style: none; padding: 0; margin: 0 0 12px; }
.lv-steps button { width: 100%; min-height: 56px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--sub); font: inherit; font-size: .88rem; text-align: left; padding: 8px 12px; cursor: pointer; line-height: 1.35; }
.lv-steps button b { display: block; font-size: .75rem; color: var(--teal); }
.lv-steps button[aria-current="step"] { border: 2px solid var(--teal); color: var(--ink); font-weight: 700; }
.lv-steps button[data-done="1"] b::after { content: " ✓"; color: var(--ok); }

.lv-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: clamp(14px, 3vw, 24px); margin-bottom: 16px; }
.lv-step-label { margin: 0; font-size: .8rem; font-weight: 800; color: var(--teal); }
.lv-q h2 { margin: 2px 0 6px; font-size: clamp(1.2rem, 3vw, 1.5rem); }
.lv-question { margin: 0 0 10px; font-weight: 700; }
.lv-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.lv-choices button { min-height: 48px; padding: 8px 16px; border: 2px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.lv-choices button:hover { border-color: var(--teal); }
.lv-choices button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.lv-choices button:disabled { cursor: default; opacity: .9; }
.lv-feedback { margin-top: 10px; padding: 10px 14px; border-radius: 12px; font-weight: 700; }
.lv-feedback[data-ok="1"] { background: #eefaf1; color: #1f6b3a; border: 1px solid #a8dcb8; }
.lv-feedback[data-ok="0"] { background: #fff4ec; color: #8a4a12; border: 1px solid #f0c9a4; }

.lv-view { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 14px; margin-top: 14px; }
#circuit { width: 100%; height: auto; background: #f7fbfc; border: 1px solid #dbe8eb; border-radius: 12px; }
.lv-side { display: flex; flex-direction: column; gap: 10px; }
#height { width: 100%; height: auto; background: #f7fbfc; border: 1px solid #dbe8eb; border-radius: 12px; }
.lv-legend { font-size: .82rem; color: var(--sub); display: flex; gap: 6px; align-items: flex-start; }
.lv-legend .dot { flex: none; width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: #f2a516; box-shadow: 0 0 0 2px #fff3d6; }
.lv-controls { display: flex; flex-direction: column; gap: 6px; }
.lv-controls label { display: flex; flex-direction: column; font-size: .9rem; }
.lv-controls label b { position: absolute; right: 0; }
.lv-controls label { position: relative; }
.lv-controls label[hidden] { display: none; }
.lv-controls input[type=range] { width: 100%; min-height: 40px; accent-color: var(--teal); touch-action: pan-y; }

.lv-try { margin-top: 14px; padding: 12px 16px; border: 2px dashed #f0c9a4; background: #fffaf3; border-radius: 12px; }
.lv-try-title, .lv-learn-title { margin: 0; font-size: .8rem; font-weight: 800; letter-spacing: .06em; }
.lv-try-title { color: #a2610f; } .lv-try p { margin: 4px 0; }
.lv-try-check { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.lv-check { width: 22px; height: 22px; border: 2px solid #c9b79c; border-radius: 6px; background: #fff; position: relative; flex: none; }
.lv-try-check[data-done="1"] .lv-check { background: var(--ok); border-color: var(--ok); }
.lv-try-check[data-done="1"] .lv-check::after { content: "✓"; position: absolute; inset: 0; color: #fff; text-align: center; line-height: 18px; font-weight: 900; }
.lv-learn { margin-top: 12px; padding: 12px 16px; border-left: 6px solid var(--teal); background: #eef7f8; border-radius: 0 12px 12px 0; }
.lv-learn-title { color: var(--teal); } .lv-learn p { margin: 4px 0 0; font-weight: 700; }

.lv-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.lv-nav button { min-height: 48px; padding: 8px 18px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.lv-nav button.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.lv-nav button:disabled { opacity: .45; cursor: default; }

.lv-summary table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }
.lv-summary th, .lv-summary td { border: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
.lv-summary tr:first-child th { background: #eef7f8; }
.lv-summary small { color: var(--sub); }
.lv-note { font-size: .85rem; color: var(--sub); }
.lv-next-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lv-link-card { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; }
.lv-link-card b { display: block; color: var(--teal); } .lv-link-card span { font-size: .9rem; color: var(--sub); }
:is(button, a, input):focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }

@media (max-width: 760px) {
  .lv-steps { grid-template-columns: repeat(2, 1fr); }
  .lv-view { grid-template-columns: 1fr; }
  .lv-next-links { grid-template-columns: 1fr; }
    #height { max-width: 300px; margin: 0 auto; }
}

/* リンクのコピー・大画面（lab-share.js） */
.lab-share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; margin: 0 0 8px; }
.lab-share button { min-height: 40px; padding: 6px 16px; border: 1px solid var(--teal); border-radius: 999px; background: #fff; color: var(--teal); font: inherit; font-size: .92rem; font-weight: 800; cursor: pointer; touch-action: manipulation; }
.lab-share button[aria-pressed="true"] { background: var(--teal); 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 var(--line); border-radius: 8px; font-size: 16px; }
@media (pointer: coarse) { .lab-share button { min-height: 44px; } }
#stage:fullscreen { overflow: auto; border-radius: 0; }
#stage.is-expanded { position: fixed; inset: 0; z-index: 1000; overflow: auto; border-radius: 0; margin: 0; }
body.lab-has-expanded { overflow: hidden; }

/* 今のページの共通ボタン（button{background:#087c86;color:#fff}）に負けないように */
.lv-card button, .lv-steps button { box-shadow: none; }
.lv-summary { margin-top: 20px; }

/* 共通部品（lesson-v2-core.js）の操作 */
.lv-control { display: flex; flex-direction: column; gap: 2px; }
.lv-control[hidden] { display: none; }
.lv-control label { position: relative; display: flex; flex-direction: column; font-size: .9rem; }
.lv-control label b { position: absolute; right: 0; top: 0; }
.lv-control-label { font-size: .9rem; font-weight: 700; color: var(--ink); }
.lv-control input[type=range] { width: 100%; min-height: 40px; accent-color: var(--teal); touch-action: pan-y; }
.lv-seg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lv-seg button { flex: 1 1 auto; min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; }
.lv-seg button[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.lv-seg button:disabled, .lv-control input:disabled { opacity: .55; cursor: default; }
@media (pointer: coarse) { .lv-seg button { min-height: 44px; } }
.lv-controls-hint { margin: 0; font-size: .85rem; color: var(--sub); background: #f7fbfc; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; }
.lv-controls-hint[hidden] { display: none; }
.lv-side-fig:empty { display: none; }
.lv-side-fig svg { width: 100%; height: auto; background: #f7fbfc; border: 1px solid #dbe8eb; border-radius: 12px; }
#scene { width: 100%; height: auto; background: #f7fbfc; border: 1px solid #dbe8eb; border-radius: 12px; }
@media (max-width: 760px) { .lv-side-fig svg { max-width: 300px; display: block; margin: 0 auto; } }
.lv-summary .lv-formula{margin:0 0 12px;padding:10px 14px;border-radius:10px;background:#eef5f7;color:#173b52;font-weight:800;text-align:center}
.lv-credits{margin-top:12px;font-size:.8rem;color:#496373}
.lv-credits summary{cursor:pointer}
.lv-credits ul{margin:6px 0 0;padding-left:1.2em}
.lv-credits a{color:#2f6f80}
