/* ============================================================
   E-計算！ Math — すべての点を囲む最小の円（minimum-enclosing-circle.html）だけで使う見た目
   共通の部品（.vp-msg・.vp-sample・.vp-add・.vp-tag など）は css/math.css のものを使う
   ============================================================ */

/* ---- 座標の入力欄 ---- */
.mec-ta {
  display: block; width: 100%; min-width: 0; min-height: 168px; resize: vertical;
  padding: 10px 12px; font: inherit; font-size: 15px; line-height: 1.6; font-variant-numeric: tabular-nums;
  color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
}
.mec-ta:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.mec-ta[aria-invalid="true"] { border-color: var(--s2, #B4442C); border-width: 2px; }
@media (max-width: 600px) { .mec-ta { font-size: 16px; } }
.mec-count { display: block; margin-top: 6px; font-size: 12px; color: var(--muted); }
.field input.mec-in { text-align: right; }
.field input.bad { border-color: var(--s2, #B4442C); border-width: 2px; }
.field select#unit { text-align: left; }

/* 計算の設定（乱数の種）。フォームの中の折りたたみ */
form details.mec-opt { margin: 0 0 14px; }
form details.mec-opt .field { margin: 12px 0 0; }

/* ---- 結果 ---- */
/* 計算結果が入るまでの高さを先に取っておく（読み込み後に下の要素がずれないように） */
.mec-result { min-height: 250px; }
.mec-result .res-mini .v { overflow-wrap: anywhere; }
/* 「円を決める点」の名前：区切りのない長い英字の名前（30文字まで）でも、狭い画面で横にはみ出さないように折り返す */
.mec-result .res-mini .s { overflow-wrap: anywhere; }
.mec-h3 { margin: 22px 0 6px; font-size: 15px; }

/* ---- 図（点と円） ---- */
.mec-figwrap { margin: 18px 0 0; }
.mec-fig {
  display: block; width: 100%; aspect-ratio: 4 / 3; height: auto;
  background: var(--surface); border: 1px solid var(--grid); border-radius: var(--r);
  touch-action: manipulation; user-select: none; -webkit-user-select: none; cursor: crosshair;
}
@media (max-width: 600px) { .mec-fig { aspect-ratio: 1 / 1; } }
.mec-figcap { margin: 6px 0 0; font-size: 12px; color: var(--muted); line-height: 1.7; }
.mec-fig .g-line { stroke: var(--grid); stroke-width: 1; }
.mec-fig .g-axis { stroke: var(--line-strong); stroke-width: 1; }
.mec-fig .g-lab { fill: var(--muted); font-size: 11px; }
.mec-fig .mec-c { fill: color-mix(in srgb, var(--accent) 9%, transparent); stroke: var(--accent); stroke-width: 2; }
.mec-fig .chk-c { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 6 5; }
.mec-fig .mec-rl { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 3; }
/* 中心の印と文字は点の上に描く。下の点をつかめるように、印はクリックを通す */
.mec-fig .mec-ctr-h { stroke: var(--surface); stroke-width: 5; stroke-linecap: round; }
.mec-fig .mec-ctr { stroke: var(--ink); stroke-width: 2; }
.mec-fig .chk-ctr { stroke: var(--ink-2); stroke-width: 1.5; }
.mec-fig .mec-ctr-h, .mec-fig .mec-ctr, .mec-fig .chk-ctr { pointer-events: none; }
.mec-fig .lab { fill: var(--ink); font-size: 12px; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.mec-fig .lab.r { fill: var(--accent); font-weight: 700; }
.mec-fig .lab.muted { fill: var(--muted); }
.mec-fig .pt-hit { fill: transparent; cursor: grab; touch-action: none; }
.mec-fig .pt-dot { fill: var(--ink-2); stroke: var(--surface); stroke-width: 1.5; pointer-events: none; }
.mec-fig .pt.on .pt-dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.mec-fig .pt.sup .pt-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.mec-fig .pt.sel .pt-dot { stroke: var(--ink); stroke-width: 3; }
.mec-fig .pt-many { fill: var(--ink-2); }
.mec-fig .empty-msg { fill: var(--muted); font-size: 14px; }
.mec-fig.dragging, .mec-fig.dragging .pt-hit { cursor: grabbing; }

.mec-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; min-height: 30px; font-size: 13px; }
.mec-bar .note { margin: 0; flex: 1 1 12em; }
.mec-bar button[hidden] { display: none; }
.mec-dl { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

/* 一覧の表：名前の列は折り返してよい */
table.data td.mec-name { white-space: normal; min-width: 6em; overflow-wrap: anywhere; }
table.data td.mec-name .vp-tag { margin-left: 4px; }

/* 早わかり（リードの直後） */
.mec-quick { margin: 0 0 22px; }
.mec-quick ul { margin: 4px 0 0; padding-left: 1.3em; }
.mec-quick li { margin: 2px 0; }
.mec-fig text { pointer-events: none; }
/* 結果欄の中で hidden を付けた要素は、表示の指定（display:flex など）より優先して隠す */
#resultPanel [hidden] { display: none !important; }
