/* ============================================================
   E-計算！ Math — 緯度経度の距離・面積（geodesic-distance-area.html）だけで使う見た目
   共通（../assets/css/ek.css・css/math.css）の上に重ねる。色は共通のトークン（--accent, --ink, --muted, --grid ほか）だけを使う。
   ============================================================ */

/* ページ上部の要点 */
.gd-quick { margin: 0 0 22px; }
.gd-quick ul { margin: 4px 0 0; padding-left: 1.3em; }
.gd-quick li { margin: 2px 0; }

/* ---- 入力 ---- */
.gd-pt, .gd-pts {
  display: block; width: 100%; min-width: 0; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r);
  font: 15px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, "BIZ UDGothic", monospace; font-variant-numeric: tabular-nums;
}
.gd-pt { height: 44px; padding: 0 12px; }
.gd-pts { padding: 10px 12px; min-height: 11em; resize: vertical; white-space: pre; overflow-x: auto; }
.gd-pt:focus, .gd-pts:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.gd-pt[aria-invalid="true"], .gd-pts[aria-invalid="true"] { border: 2px solid var(--s2); }
@media (max-width: 600px) { .gd-pt, .gd-pts { font-size: 16px; } }   /* iOS で入力時に拡大されないように */
/* 読み取った値（入力欄のすぐ下）。高さを先に確保して、入力のたびに下が動かないようにする */
.gd-echo { margin: 5px 0 0; min-height: 3.2em; font-size: 12.5px; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.gd-echo b { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.gd-echo .gd-err { color: var(--tint-warn-ink, #8A4B00); font-size: 13px; }   /* 読めない理由（入力欄のすぐ下） */
.gd-swap { margin: -4px 0 14px; }
.gd-hint-list { margin: 4px 0 0; padding-left: 1.2em; font-size: 12px; color: var(--muted); line-height: 1.6; }
.gd-hint-list code { font-size: 11.5px; }

/* ---- 結果 ---- */
/* 結果の数字の欄の高さを先に確保する（入力を変えたときに、下の図が動かないように） */
#result { min-height: 250px; display: flow-root; }
@media (max-width: 600px) { #result { min-height: 290px; } }
/* 数字の途中では折り返さない（大きな数は、ページの script が桁区切りのカンマのあとに <wbr> を入れて、そこでだけ折り返せるようにする） */
#result .res-mini .v, #result .res-mini .s { overflow-wrap: normal; word-break: normal; }
#result .res-mini .v small { white-space: nowrap; }   /* 単位（km など）の途中で折り返さない */
@media (max-width: 400px) {
  html[data-ui="v2"] #result .res-mini .v { font-size: 15px; }
  html[data-ui="v2"] #result .res-mini .v.long { font-size: 13px; letter-spacing: -0.01em; }   /* 10字以上の数 */
}
html[data-ui="v2"] #result .res-hero .big b { font-size: clamp(30px, 9vw, 44px); overflow-wrap: normal; }
#resultPanel [hidden] { display: none !important; }
.gd-h3 { margin: 22px 0 4px; font-size: 15px; }
.gd-tbl.gd-scrolly { max-height: 360px; overflow: auto; }   /* 頂点の表だけ高さを抑える */
table.data td.gd-c, table.data th.gd-c { white-space: normal; min-width: 6.5em; }
/* 2点の結果の表（見出しは左、値は右。狭い画面では折り返す） */
table.data th.gd-k { text-align: left; white-space: normal; min-width: 6em; font-weight: 600; }
table.data td.gd-v { text-align: right; white-space: normal; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
table.data td .gd-dms { display: block; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
/* 最後の行の下線：共通の CSS は最後の行の td の下線だけ消すので、見出しのセル（th）にも同じように（2点の結果の表・球との比べの表） */
#resultPanel table.data tbody tr:last-child th { border-bottom: none; }
.gd-btns { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 8px; font-size: 13px; }
.gd-btns .hint { color: var(--muted); font-size: 12.5px; }

/* ---- 略図（SVG）。上が北 ---- */
.gd-fig { margin: 18px 0 0; padding: 12px; border: 1px solid var(--grid); border-radius: var(--r); background: var(--surface); min-width: 0; }
.gd-fig figcaption { font-size: 14px; font-weight: 700; color: var(--ink); margin: 0 0 8px; line-height: 1.6; }
.gd-fig figcaption small { font-weight: 400; color: var(--muted); font-size: 12px; }
.gd-fig svg { display: block; width: 100%; height: auto; background: var(--surface); }
.gd-fig .g-grid { stroke: var(--grid); stroke-width: 1; fill: none; }
.gd-fig .g-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.gd-fig .g-poly { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2.2; stroke-linejoin: round; }
.gd-fig .g-poly.bad { fill: none; stroke-dasharray: 6 4; }
.gd-fig .g-path { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.gd-fig .g-chord { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 5 4; }
.gd-fig .g-cross { fill: none; stroke: var(--s2); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 7 5; }
.gd-fig .p-v { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.gd-fig .p-ab { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.gd-fig .g-num { fill: var(--ink); font-size: 12px; font-weight: 700; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.gd-fig .g-north { fill: var(--ink-2); font-size: 12px; font-weight: 700; }
.gd-fig .g-north-a { stroke: var(--ink-2); stroke-width: 1.5; fill: none; }
.gd-fig .g-scale { stroke: var(--ink); stroke-width: 2; fill: none; }
.gd-fig .g-scale-t { fill: var(--ink); font-size: 11.5px; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.gd-fig .g-pole { fill: var(--ink-2); }
.gd-fig .g-empty { fill: var(--muted); font-size: 14px; }
.gd-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; margin: 8px 0 0; font-size: 12px; color: var(--ink-2); }
.gd-legend li { display: flex; align-items: center; gap: 6px; }
.gd-legend svg { width: 22px; height: 14px; flex: none; }
.gd-legend [hidden] { display: none; }
.gd-note { font-size: 11.5px; color: var(--ink-2); line-height: 1.8; padding-top: 10px; margin: 8px 0 0; border-top: 1px solid var(--grid); }
