/* 物質量のページ専用。共通の部品は style.css を使い、ここには、このページだけのものを書く */
.bs-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 12px; }
.bs-modes .btn { line-height: 1.3; }
.bs-panel[hidden] { display: none; }
.bs-layout { display: grid; gap: 12px 18px; align-items: start; grid-template-columns: 320px minmax(0, 1fr); }
.bs-two { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; align-items: start; }
.bs-status { margin: 8px 0; line-height: 1.6; font-size: 0.95rem; min-height: 3.2em; }

.bs-subs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bs-subs .btn { font-size: 0.86rem; }
.bs-sub-label { margin: 8px 0 4px; font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.bs-sub-label:first-of-type { margin-top: 0; }
.bs-qtys { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 8px; }
.bs-qtys .btn { font-size: 0.84rem; line-height: 1.3; }
.bs-qty-label { margin: 0 0 4px; font-size: 0.86rem; font-weight: 700; }
.bs-input-row { display: flex; align-items: center; gap: 6px; margin: 4px 0 6px; }
.bs-input-row input { flex: 1 1 auto; min-width: 0; height: 40px; font-size: 1rem; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; }
.bs-input-row span { white-space: nowrap; font-weight: 700; }
.bs-sim .theta-row .btn { min-width: 2.6em; padding: 4px 6px; }

/* 換算の図 */
#hub { display: block; width: 100%; max-width: 480px; margin: 0 auto; height: auto; }
.bs-node { fill: #fff; stroke: #7a8499; stroke-width: 1.5; }
.bs-node-mol { fill: var(--blue-soft); stroke: var(--blue); stroke-width: 2; }
.bs-node.is-from { stroke: #9a3412; stroke-width: 3; fill: #fdf0e6; }
.bs-node.is-to { stroke: var(--blue-dark); stroke-width: 3; stroke-dasharray: 6 3; }
.bs-node.is-block { fill: #f1f2f5; stroke-dasharray: 3 3; }
.bs-node-name { font-size: 11.5px; fill: var(--muted); text-anchor: middle; }
.bs-node-val { font-size: 15px; font-weight: 700; fill: var(--text); text-anchor: middle; }
.bs-arrow { stroke: #b6bdcb; stroke-width: 1.5; marker-end: url(#hub-head); }
.bs-arrow.is-on { stroke: var(--blue-dark); stroke-width: 4; marker-end: url(#hub-head-on); }
.bs-arrow.is-block { stroke-dasharray: 3 4; marker-end: none; }
.bs-arrow-text { font-size: 12px; fill: var(--muted); }
.bs-arrow-text.is-on { fill: var(--blue-dark); font-weight: 700; }
.bs-arrow-text.is-block { text-decoration: line-through; }

.bs-steps { margin: 6px 0 0; padding: 0; list-style: none; }
.bs-steps li { padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.bs-steps li:first-child { border-top: 0; }
.bs-steps b { color: var(--blue-dark); }
.bs-steps small { display: block; color: var(--muted); font-size: 0.82rem; }
.bs-steps .is-block { color: #9a3412; }

/* 粒子の中身 */
.bs-glyph { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 40px; margin: 2px 0 6px; }
.bs-atom { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 4px; border-radius: 17px; border: 2px solid #3b4457; background: #fff; font-size: 0.82rem; font-weight: 700; }
.bs-atom.k1 { background: #dfe9fb; }
.bs-atom.k2 { background: #fdf0e6; }
.bs-parts { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.bs-parts th, .bs-parts td { padding: 4px 4px; border-top: 1px solid var(--line); text-align: right; }
.bs-parts th:first-child, .bs-parts td:first-child { text-align: left; }
.bs-parts thead th { border-top: 0; font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.bs-parts .total td { font-weight: 700; }

/* 1 mol の大きさ */
#size { display: block; width: 100%; height: auto; }
.bs-cube { fill: #eef1f6; stroke: #566078; stroke-width: 1.5; }
.bs-cube.is-now { fill: #dfe9fb; stroke: var(--blue-dark); stroke-width: 3; }
.bs-size-text { font-size: 12px; fill: var(--text); }
.bs-size-text.is-now { font-weight: 700; fill: var(--blue-dark); }

/* 比べる */
.bs-cmp-sel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 8px; }
.bs-cmp-sel label { display: block; font-size: 0.86rem; font-weight: 700; }
.bs-cmp-sel select { display: block; width: 100%; height: 40px; margin-top: 2px; font-size: 0.92rem; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.bs-bys { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 8px; }
.bs-bys .btn { font-size: 0.86rem; line-height: 1.3; }
#balance { display: block; width: 100%; max-width: 520px; margin: 0 auto; height: auto; }
.bs-beam { stroke: #3b4457; stroke-width: 4; stroke-linecap: round; }
.bs-stand { stroke: #7a8499; stroke-width: 4; }
.bs-hang { stroke: #7a8499; stroke-width: 1.2; fill: none; }
.bs-plate { stroke: #3b4457; stroke-width: 4; stroke-linecap: round; }
.bs-dot-a { fill: var(--blue); }
.bs-dot-b { fill: #fff; stroke: #9a3412; stroke-width: 2; }
.bs-bal-text { font-size: 13px; font-weight: 700; fill: var(--text); text-anchor: middle; }
.bs-bal-sub { font-size: 12px; fill: var(--muted); text-anchor: middle; }
.bs-cmp-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-top: 8px; }
.bs-cmp-table th, .bs-cmp-table td { padding: 5px 4px; border-top: 1px solid var(--line); text-align: right; overflow-wrap: anywhere; }
.bs-cmp-table th:first-child { text-align: left; }
.bs-cmp-table tbody tr.is-same td { color: var(--blue-dark); font-weight: 700; }

/* 道順を組む */
.bs-q { font-size: 1.08rem; font-weight: 700; margin: 0 0 8px; line-height: 1.6; }
.bs-trail { margin: 0; padding: 0; list-style: none; }
.bs-trail li { padding: 6px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.bs-trail li:first-child { border-top: 0; }
.bs-trail .val { font-weight: 700; }
.bs-trail .op { display: block; font-size: 0.84rem; color: var(--muted); }
.bs-trail li.is-bad .val { color: #9a3412; }
.bs-ops { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 8px 0; }
.bs-ops .btn { font-size: 0.92rem; }
.bs-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.bs-tools .btn { font-size: 0.84rem; line-height: 1.3; padding: 6px 4px; }
.bs-msg { margin: 8px 0; padding: 8px 12px; border-radius: 8px; background: var(--blue-soft); line-height: 1.6; min-height: 3.2em; font-size: 0.95rem; }
.bs-msg.is-bad { background: #fdf0e6; }
.bs-msg.is-done { background: #e6f6ec; font-weight: 700; }

.bs-fig { display: block; width: 100%; max-width: 480px; height: auto; margin: 0 auto; }
.bs-fig text { font-size: 13px; fill: var(--text); }
.bs-fig .f-mol { font-weight: 700; }

@media (max-width: 860px) {
  .bs-layout { grid-template-columns: minmax(0, 1fr); }
  .bs-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .bs-qtys { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
