:root { font-family: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif; color: #17364e; --blue: #2f5fb7; --bar: #8fb4e8; --modal: #2f5fb7; --line: #c3d2e0; }
* { box-sizing: border-box; }
body { margin: 0; background: linear-gradient(#f2f8ff, #fff 42%); }
.lab { width: min(100%, 720px); margin: auto; padding: 12px max(12px, env(safe-area-inset-right)) calc(18px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.eyebrow { margin: 0 0 3px; color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .08em; }
h1 { margin: 0 0 6px; font-size: 21px; }
.lead { margin: 0 0 10px; color: #5a6b83; font-size: 13px; line-height: 1.55; }

.tabs { display: flex; gap: 6px; margin-bottom: 10px; }
.tabs button { flex: 1 1 0; min-height: 44px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: #17364e; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.tabs button.active { border-color: var(--blue); color: #fff; background: var(--blue); }

.panel { display: grid; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.panel label { display: grid; gap: 5px; color: #61728a; font-size: 12px; font-weight: 700; }
textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: #17364e; font: inherit; font-size: 15px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; line-height: 1.55; resize: vertical; }
input[type="range"] { width: 100%; min-height: 32px; accent-color: var(--blue); touch-action: manipulation; }
.panel output { color: var(--blue); font-size: 15px; font-weight: 800; }
.scene { margin: 0; font-size: 13.5px; line-height: 1.7; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions button { flex: 1 1 auto; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--blue); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.actions button.reveal { color: #8e5a24; }

.output { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 190px; padding: 6px 0; }
.bar-col { display: flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; }
.bar { width: 100%; border-radius: 5px 5px 0 0; background: var(--bar); }
.bar.modal { background: var(--modal); }
.count { color: #41546c; font-size: 11px; font-weight: 800; }
.range { color: #8697ad; font-size: 10px; }
.axis-note { margin: 4px 0 10px; color: #7a889e; font-size: 11.5px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { padding: 7px 6px; border-bottom: 1px solid #e2e9f2; text-align: center; white-space: nowrap; }
th { color: #61728a; font-size: 11.5px; }
tr.modal-row { background: #eaf2fb; font-weight: 700; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-top: 11px; }
.grid > div { display: grid; gap: 2px; padding: 8px 10px; border-radius: 9px; background: #f5f8fc; }
.grid > div.wide { grid-column: 1 / -1; }
.grid span { color: #61728a; font-size: 11.5px; font-weight: 700; }
.grid b { font-size: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.grid b.answer { color: var(--blue); font-size: 19px; }

.balls { display: flex; flex-wrap: wrap; gap: 4px; min-height: 40px; margin-bottom: 4px; }
.ball { width: 15px; height: 15px; border-radius: 50%; }
.ball.red { background: #d9534f; }
.ball.white { border: 1px solid #b9c6d6; background: #fff; }
.empty { color: #8697ad; font-size: 12px; }
.truth { margin: 9px 0 0; padding: 9px 11px; border-radius: 9px; background: #fff6e2; color: #7a5a12; font-size: 13px; line-height: 1.6; }

.note { margin: 9px 0 0; color: #55657d; font-size: 12.5px; line-height: 1.65; }
.warn { margin: 0; color: #b4392f; font-size: 13px; font-weight: 700; }

@media (max-width: 420px) {
  h1 { font-size: 19px; }
  .chart { height: 160px; }
  .grid b { font-size: 14px; }
  .range { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* スライダーは指で操作するため、つまみを大きくして掴みやすくする。
   input の高さを44pxにすると余白が目立つので、つまみ側で当たり判定を確保する。 */
input[type="range"] { min-height: 44px; background: transparent; -webkit-appearance: none; appearance: none; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: #dbe5f2; }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: #dbe5f2; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 28px; height: 28px; margin-top: -11px; border: 3px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 1px 4px #17384b55; cursor: pointer; }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border: 3px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 1px 4px #17384b55; cursor: pointer; }
.more { align-self: center; margin-left: 4px; color: #61728a; font-size: 11.5px; font-weight: 700; }
