/* ============================================================
   E-計算！ 道具のページの共通の見た目（assets/css/tool-kit.css）
   assets/js/tool-kit.js（SPTOOL）と一緒に使う。Math の便利ツールが読む。
   部品の名前（sp-…）は Sports と同じ。Sports は sports/css/sports.css に同じ部品を持つ（2026-11-19 時点。まとめるのは後で）。
   分野の色（--accent）は ek.css の data-section の層から来る。
   ============================================================ */

/* ---- 印刷：入力・広告・ボタンを消し、結果だけを出す ---- */
@media print {
  .site-header, .site-footer, .ek-ad, .adsbygoogle, .sp-noprint, button { display: none !important; }
  .sp-print { width: 100% !important; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
}

/* ---- A4 の紙（SPTOOL.printSheet）：印刷のときだけ #tkSheet を出し、ほかを消す ---- */
#tkSheet { display: none; }
@media print {
  body.tk-sheet-mode > *:not(main), body.tk-sheet-mode main > *:not(#tkSheet) { display: none !important; }
  body.tk-sheet-mode #tkSheet { display: block; }
  .tk-page { break-after: page; color: #000; background: #fff; font-size: 12pt; }
  .tk-page:last-child { break-after: auto; }
  .tk-page-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-bottom: 1px solid #000; padding-bottom: 4px; margin-bottom: 8mm; font-size: 11pt; }
  .tk-page-head b { font-size: 14pt; }
  .tk-page-foot { margin-top: 6mm; font-size: 8.5pt; color: #444; }
}

/* ---- タブ（計算の形の切り替え） ---- */
.sp-tabs { display: flex; gap: 6px; margin: 14px 0 0; flex-wrap: wrap; }
.sp-tabs button { appearance: none; border: 1px solid var(--grid); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.sp-tabs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink, #fff); }
.sp-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool-layout[hidden] { display: none; }
.input-unit > span { white-space: nowrap; }

/* ---- 入力 ---- */
.field > .lbl { display: block; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 5px; }
html[data-ui="v2"] .field > .lbl .hint { display: block; margin: 3px 0 0; font-size: 12px; font-weight: 400; color: var(--muted); line-height: 1.6; }
.field textarea { width: 100%; box-sizing: border-box; min-height: 9em; padding: 10px 12px; border: 1px solid var(--grid); border-radius: var(--r); background: var(--surface, #fff); color: var(--ink); font: 14px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }
.field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- 結果の表・注記・ボタン ---- */
.sp-table td:first-child { text-align: left; }
.sp-table tr.sp-cur td { background: var(--accent-soft); }
.sp-rule { margin: 10px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.sp-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.7; }
.sp-errors { margin: 12px 0 0; padding: 10px 14px; border-radius: var(--r); background: color-mix(in srgb, #D97A2B 12%, transparent); font-size: 13.5px; }
.sp-errors p { margin: 0 0 4px; }
.sp-errors ul { margin: 0; padding-left: 1.2em; }
.sp-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 0; }
.sp-btn { appearance: none; border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: var(--r); padding: 8px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.sp-btn:hover { background: var(--accent-soft); }
.sp-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-btn[disabled] { opacity: .45; cursor: not-allowed; }
#copyMsg { font-size: 13px; color: var(--ink-2); }
.sp-h3 { margin: 18px 0 6px; font-size: 15px; }

/* ---- 保存と記録 ---- */
.sp-resume { margin: 14px 0 0; padding: 12px 16px; border-radius: var(--r); background: var(--accent-soft); font-size: 14px; }
.sp-resume p { margin: 0; }
.sp-record ul { margin: 6px 0 0; padding-left: 1.2em; font-size: 13px; }

/* ---- 結果を入れる行の並び ---- */
.sp-res { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.sp-res li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--grid); font-size: 14px; }
.sp-res-t { min-width: 6em; }
.sp-res-n { width: 3.2em; padding: 6px 8px; border: 1px solid var(--grid); border-radius: var(--r); font: inherit; text-align: center; background: var(--surface, #fff); color: var(--ink); }
.sp-res-n:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- 端末の中だけで計算することの印 ---- */
.tk-local { display: inline-flex; align-items: center; gap: 6px; margin: 10px 0 0; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--ink-2); font-size: 12.5px; }
