:root { font-family: "Hiragino Sans", "Yu Gothic", system-ui, sans-serif; color: #17364e; --blue: #2f5fb7; --rose: #c2405a; --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; line-height: 1.25; }
header p:last-child { 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; padding: 6px 4px; 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); }

.board-wrap { width: min(100%, 460px); margin: 0 auto; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; box-shadow: 0 6px 20px #1c4a7a14; }
#board { display: block; width: 100%; height: 100%; touch-action: none; }

.grid .line { stroke: #e4ecf5; stroke-width: 1; }
.grid .axis { stroke: #8fa4bb; stroke-width: 1.6; }
.tick { fill: #90a2b8; font-size: 10px; }
.graph { stroke-width: 3; stroke-linecap: round; fill: none; }
.graph.first { stroke: var(--blue); }
.graph.second { stroke: var(--rose); }
.dot { stroke: #fff; stroke-width: 2.5; }
.dot.first { fill: var(--blue); }
.dot.second { fill: var(--rose); }
.hit { fill: transparent; cursor: grab; }
.point-label { fill: #41546c; font-size: 11px; font-weight: 700; }
.rate-triangle { fill: none; stroke: #e8a33d; stroke-width: 2.5; stroke-dasharray: 5 4; }
.rate-label { fill: #b37a1c; font-size: 11px; font-weight: 800; text-anchor: middle; }
.cross-dot { fill: #f5b73d; stroke: #8a5f10; stroke-width: 2.5; }

.readout { margin: 12px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.value-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: 5px 0; border-bottom: 1px dashed #e2e9f2; }
.value-row:last-of-type { border-bottom: 0; }
.value-row span { min-width: 84px; color: #61728a; font-size: 12px; font-weight: 700; }
.value-row b { font-size: 17px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.value-row b.answer { color: var(--blue); font-size: 19px; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; color: #fff; font-size: 11px; }
.tag.first { background: var(--blue); }
.tag.second { background: var(--rose); }
.note { margin: 8px 0 0; color: #55657d; font-size: 12.5px; line-height: 1.6; }
.warn { margin: 0; color: #b4392f; font-size: 13px; font-weight: 700; line-height: 1.6; }

.controls { margin-top: 10px; }
.steps { margin: 0; padding-left: 1.2em; color: #3d4d64; font-size: 13px; line-height: 1.85; }
.steps li { margin-bottom: 2px; }
.hint { margin: 10px 0 0; color: #7a889e; font-size: 11.5px; text-align: center; }

@media (max-width: 420px) {
  h1 { font-size: 19px; }
  .tabs button { font-size: 12px; }
  .value-row b { font-size: 16px; }
  .value-row span { min-width: 72px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
/* ラベルが方眼や軸の数字に埋もれないよう、白で縁取りする */
.point-label { stroke: #fff; stroke-width: 3px; paint-order: stroke; }
.rate-label.start { text-anchor: start; }
