/* 中和滴定のページ（色だけに頼らず、線種・形・文字でも区別する） */
.seg .btn[aria-pressed="true"], .ct-presets .btn[aria-pressed="true"], .ct-inds .btn[aria-pressed="true"] { background: var(--blue); color: #fff; }
.seg .btn[aria-pressed="true"]:hover, .ct-presets .btn[aria-pressed="true"]:hover, .ct-inds .btn[aria-pressed="true"]:hover { background: var(--blue-dark); }
.ct-sim [hidden] { display: none !important; }
.ct-mode-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0 0 10px; }
.ct-presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 0 0 12px; }
.ct-presets .btn { padding: 4px 2px; min-width: 0; font-size: 0.85rem; }
/* 濃度を当てるときは、色を見ながら滴下できるようにビーカーを操作の上に置く */
.sim-stage { display: flex; flex-direction: column; min-width: 0; }
.is-unknown .ct-setup { order: 0; }
.is-unknown #figure-wrap { order: 1; margin-bottom: 8px; }
.is-unknown .ct-now { order: 2; grid-template-columns: minmax(0, 1fr); justify-items: center; }
.is-unknown #status { order: 3; }
.is-unknown #unk-group { order: 4; }
.ct-setup { margin: 0 0 8px; font-size: 0.92rem; line-height: 1.6; }
.ct-sim #plot { cursor: pointer; height: 360px; }

.ct-v-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 4px 0; }
.ct-v-btns .btn { min-width: 0; padding: 4px 2px; }
.ct-v-btns2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ct-v-btns3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ct-status { min-height: 3.6em; line-height: 1.6; font-size: 0.95rem; }

.ct-now { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 12px; align-items: start; margin: 4px 0 10px; }
.ct-rig-wrap { min-width: 0; text-align: center; }
#rig { display: block; width: 100%; max-width: 118px; height: auto; margin: 0 auto; }
.ct-color-label { margin: 2px 0 0; font-size: 0.82rem; line-height: 1.4; font-weight: 700; }
.ct-big { display: flex; align-items: baseline; gap: 8px; margin: 0 0 6px; font-variant-numeric: tabular-nums; }
.ct-big b { font-size: 1.8rem; line-height: 1.1; color: var(--blue-dark); }
.ct-bars { display: grid; gap: 4px; }
.ct-bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; align-items: baseline; font-size: 0.82rem; }
.ct-bar-val { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-bar { grid-column: 1 / -1; height: 12px; background: #e8edf5; border-radius: 3px; overflow: hidden; }
.ct-fill { display: block; height: 100%; width: 0; }
.ct-fill-a { background: #c2410c; }
.ct-fill-b { background: repeating-linear-gradient(135deg, #1f5fd6 0 5px, #174aa8 5px 8px); }

.ct-drop { font-size: 0.86rem; min-width: 0; table-layout: fixed; }
.ct-drop th, .ct-drop td { text-align: center; padding: 3px 2px; white-space: nowrap; }
.ct-drop .is-eq { background: var(--blue-soft); font-weight: 700; }
#drop-box { margin-bottom: 10px; }

.ct-field { display: block; font-size: 0.88rem; font-weight: 500; margin: 8px 0 2px; }
.ctrl-group select { width: 100%; }
.ct-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ct-inds { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 4px 0; }
.ct-inds .btn { flex-direction: column; min-width: 0; padding: 4px 2px; font-size: 0.8rem; line-height: 1.3; }
.ct-inds .btn span { font-weight: 500; font-variant-numeric: tabular-nums; }
.ct-verdict { margin: 8px 0 0; font-size: 0.88rem; line-height: 1.6; }
.ct-verdict p { margin: 2px 0; }
.ct-v-mark { font-weight: 700; }
.ct-v-good { color: #15803d; }
.ct-v-ok { color: #1f5fd6; }
.ct-v-bad { color: #b91c1c; }
.ct-wet-out { font-weight: 700; color: #9a3412; }

.ct-answer-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 0; }
.ct-answer-row input { width: 5.6em; font: inherit; padding: 6px; border: 1px solid #aeb8cc; border-radius: 6px; min-height: 40px; }
.ct-result { margin: 8px 0 0; padding: 8px 12px; border-left: 4px solid var(--blue); background: var(--bg-soft); border-radius: 0 8px 8px 0; font-size: 0.92rem; }
.ct-result p { margin: 4px 0; }

/* 滴定曲線の図 */
#plot .ct-axis { stroke: #3b4457; stroke-width: 1.5; }
#plot .ct-neutral { stroke: #7a8499; stroke-width: 1; stroke-dasharray: 3 4; }
#plot .ct-neutral-label { font-size: 10.5px; fill: #5c6578; }
#plot .ct-curve { fill: none; stroke: var(--c-path); stroke-width: 2.6; stroke-linejoin: round; }
#plot .ct-pin { fill: none; stroke: #6d7890; stroke-width: 2; stroke-dasharray: 7 5; }
#plot .ct-pin-label { font-size: 11px; fill: #5c6578; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
#plot .ct-band-line { stroke-width: 1; stroke-dasharray: 2 3; }
#plot .ct-band-label { font-size: 11.5px; font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
#plot .ct-eq-line { stroke: var(--c-q, #6d28d9); stroke-width: 1.2; stroke-dasharray: 5 4; }
#plot .ct-eq { fill: #fff; stroke: #6d28d9; stroke-width: 2.5; }
#plot .ct-eq-label { font-size: 11.5px; font-weight: 700; fill: #5b21b6; paint-order: stroke; stroke: #fff; stroke-width: 3px; stroke-linejoin: round; }
#plot .ct-guide { stroke: var(--blue); stroke-width: 1; stroke-dasharray: 2 3; }
#plot .ct-point { fill: var(--blue); stroke: #0d2f73; stroke-width: 2; }
#plot .ct-point-label { font-size: 12.5px; font-weight: 700; fill: var(--blue-dark); paint-order: stroke; stroke: #fff; stroke-width: 3.5px; stroke-linejoin: round; }
#plot .ct-handle { fill: transparent; stroke: none; cursor: grab; touch-action: none; }
#plot .ct-handle:active { cursor: grabbing; }
.ct-lg-eq { fill: #fff; stroke: #6d28d9; stroke-width: 2.5; }
.ct-lg-band { fill: #f6c1d8; stroke: #db2777; stroke-width: 1; stroke-dasharray: 2 2; }

/* ビュレットとビーカーの図 */
#rig text { font-family: var(--font); fill: var(--text); }
.ct-glass { fill: none; stroke: #3b4457; stroke-width: 1.5; stroke-linejoin: round; }
.ct-tick { stroke: #7a8499; stroke-width: 1; }
.ct-tick-label { font-size: 9px; fill: #566078; }
.ct-liquid-t { fill: #cfdcf5; }

/* 4 つの組み合わせの小さな図 */
.ct-four { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 8px 0 14px; }
.ct-four figure { margin: 0; min-width: 0; text-align: center; }
.ct-four svg { display: block; width: 100%; height: auto; }
.ct-four svg text { font-family: var(--font); font-size: 11px; fill: var(--muted); }
.ct-four figcaption { font-size: 0.85rem; font-weight: 700; }
.ct-four .mini-axis { stroke: #3b4457; stroke-width: 1; fill: none; }
.ct-four .mini-grid { stroke: #e8edf5; stroke-width: 1; }
.ct-four .mini-curve { fill: none; stroke: var(--c-path); stroke-width: 2.2; }
.ct-four .mini-eq { fill: #fff; stroke: #6d28d9; stroke-width: 2; }
.ct-four .mini-neutral { stroke: #7a8499; stroke-width: 1; stroke-dasharray: 3 3; }

/* 器具の図 */
.ct-tools { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; }
.ct-tool path, .ct-tool rect { fill: #f4f7fc; stroke: #3b4457; stroke-width: 1.8; stroke-linejoin: round; }
.ct-tool .ct-tool-mark { stroke: #c2410c; stroke-width: 1.4; fill: none; }
.ct-tool-text text { font-family: var(--font); font-size: 13px; fill: var(--text); }
.ct-judge td { text-align: center; font-weight: 700; }
.ct-judge { min-width: 0; }
.ct-tool-table tbody th { min-width: 5.2em; }
.ct-summary small { font-weight: 500; color: var(--muted); }

@media (max-width: 600px) {
  .ct-presets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-sim #plot { height: 320px; }
  .ct-now { grid-template-columns: 96px minmax(0, 1fr); gap: 8px; }
  .ct-four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ct-tool-text text { font-size: 15px; }
  .ct-drop { font-size: 0.8rem; }
}
