/* コンパス（compass）部品。青＝半径・直径（中心から）、オレンジ＝くらべる線・切り口、みどり＝ぴったり */
.cp-w { --cp-b: #2563eb; --cp-bl: #eaf1ff; --cp-o: #f59e0b; --cp-od: #b45309; --cp-g: #0f8a72; --cp-r: #c2410c; }
.cp-svg { width: 100%; height: auto; display: block; margin: 4px 0; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.cp-svg.cp-grab { touch-action: none; cursor: grab; }
.cp-svg text { font-weight: 700; fill: var(--ink, #1f2937); }
.cp-grid line { stroke: #eef1f5; stroke-width: 1; }

.cp-circ { fill: none; stroke: var(--ink, #1f2937); stroke-width: 3; }
.cp-rd { stroke: var(--cp-b); stroke-width: 2.5; stroke-dasharray: 6 4; }
.cp-rad { stroke: var(--cp-b); stroke-width: 4; }
.cp-rad.new { animation: cp-in .4s ease both; }
.cp-pt { fill: var(--ink, #1f2937); }
.cp-c { fill: var(--cp-r); }
.cp-hd { fill: rgba(245, 158, 11, .35); stroke: var(--cp-od); stroke-width: 3; cursor: grab; }
.cp-ch { stroke: var(--cp-o); stroke-width: 5; stroke-linecap: round; }
.cp-ch.dia { stroke: var(--cp-b); }
.cp-old { stroke: #c9ced6; stroke-width: 2; }
.cp-svg .cp-tl { font-size: 24px; paint-order: stroke; stroke: #fff; stroke-width: 5px; }
.cp-svg .cp-tl.b { fill: var(--cp-b); }
.cp-svg .cp-tl.o { fill: var(--cp-od); }
.cp-svg .cp-tl.s { font-size: 22px; fill: var(--sub, #4b5563); }
.cp-svg .cp-tl.nm { font-size: 28px; }
.cp-svg .cp-tl.nm.o { fill: var(--cp-od); }

/* コンパスの 絵 */
.cp-cmp { pointer-events: none; }
.cp-leg { stroke: #6b7280; stroke-width: 7; stroke-linecap: round; }
.cp-pen { stroke: #eab308; stroke-width: 9; stroke-linecap: round; }
.cp-tip { stroke: #374151; stroke-width: 4; stroke-linecap: round; }
.cp-hdl { stroke: #374151; stroke-width: 9; stroke-linecap: round; }
.cp-hinge { fill: #374151; }
.cp-needle { fill: #fff; stroke: #374151; stroke-width: 2.5; }

/* copy */
.cp-seg { stroke: var(--ink, #1f2937); stroke-width: 5; stroke-linecap: round; }
.cp-seg.sel { stroke: var(--cp-od); }
.cp-ok { fill: none; stroke: var(--cp-g); stroke-width: 4; }
.cp-base { stroke: var(--ink, #1f2937); stroke-width: 3; }
.cp-arc { fill: none; stroke: #6b7280; stroke-width: 3; }
.cp-mk { fill: var(--cp-od); }

/* ball */
.cp-ball { stroke: var(--cp-od); stroke-width: 2.5; }
.cp-cap { fill: #fff; opacity: .6; stroke: none; }
.cp-knife { stroke: var(--cp-r); stroke-width: 2.5; stroke-dasharray: 8 5; }
.cp-face { fill: rgba(245, 158, 11, .55); stroke: var(--cp-od); stroke-width: 2.5; }
.cp-face.big { fill: #fff4dc; }
.cp-ghost { stroke: #c9ced6; stroke-width: 2; stroke-dasharray: 4 4; }
.cp-hit { fill: transparent; cursor: ns-resize; }
.cp-box { fill: #f8fafc; stroke: #6b7280; stroke-width: 3; }
.cp-dim { stroke: var(--sub, #4b5563); stroke-width: 2; }

@keyframes cp-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cp-rad.new { animation: none; } }

/* HTML */
.cp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.cp-row.tabs { margin-bottom: 12px; }
.cp-q { font-weight: 700; margin: 0 0 8px; line-height: 2; }
.cp-w button { font: inherit; cursor: pointer; color: var(--ink, #1f2937); }
.cp-b, .cp-g, .cp-p { min-height: 48px; padding: 4px 14px; border: 2px solid var(--line, #e5e7eb); background: #fff; border-radius: 12px; font-weight: 700; }
.cp-g { border-color: var(--ink, #1f2937); min-width: 64px; }
.cp-g[aria-pressed="true"], .cp-p[aria-pressed="true"] { border-color: var(--cp-b); background: var(--cp-bl); }
.cp-p { border-radius: 999px; font-size: .9rem; min-height: 44px; }
.cp-b.go { background: var(--cp-b); border-color: var(--cp-b); color: #fff; }
.cp-b.back { border-style: dashed; font-weight: 400; }
.cp-b.sq { min-width: 48px; padding: 0 10px; font-size: 1.1rem; }
.cp-w button:disabled { opacity: .45; cursor: default; }
.cp-lab { font-size: .9rem; color: var(--sub, #4b5563); font-weight: 700; }
.cp-num { font-size: 1.2rem; min-width: 2em; text-align: center; }
.cp-read { background: #f3f6ff; border-radius: 12px; padding: 8px 14px; min-height: 56px; }
.cp-read p { margin: 4px 0; }
.cp-big { font-size: 1.15rem; font-weight: 700; text-align: center; line-height: 2.2; }
.cp-note { font-size: .95rem; line-height: 1.9; }
.cp-note.s { font-size: .85rem; color: var(--sub, #4b5563); }
.cp-note.ok { color: var(--cp-g); font-weight: 700; }
.cp-res { font-weight: 700; }
.cp-res.ok { color: var(--ok, #0f8a72); }
.cp-res.ng i { color: var(--ng, #c2410c); font-style: normal; }
.cp-bars { margin: 6px 0; }
.cp-bar { position: relative; height: 30px; margin: 4px 0; background: #fff; border-radius: 6px; border: 1.5px solid var(--line, #e5e7eb); overflow: hidden; }
.cp-bar span { position: absolute; left: 0; top: 0; bottom: 0; background: #fde7b8; }
.cp-bar.dia span { background: #bcd2fb; }
.cp-bar.now { border-color: var(--cp-od); }
.cp-bar em { position: relative; font-style: normal; font-weight: 700; font-size: .9rem; padding-left: 8px; line-height: 27px; }

/* tri */
.cp-tfill { fill: #fff8e8; }
.cp-tri { stroke: var(--cp-od); stroke-width: 5; stroke-linecap: round; }
.cp-tri.eq { stroke: var(--cp-b); }
.cp-half { fill: #fff4dc; stroke: none; }
.cp-half.f { fill: #dbe7ff; opacity: .9; }
.cp-fold { stroke: #6b7280; stroke-width: 2; stroke-dasharray: 6 4; }
.cp-ang { stroke: none; }
.cp-ang.l { fill: rgba(220, 38, 38, .45); }
.cp-ang.r { fill: rgba(5, 150, 105, .45); }
