/* =====================================================================
   style.css — 六角レンチ・スパナのサイズ早見 ツール固有の微調整のみ。
   共通スタイルは /_shared/shirugear.css に任せる（結果表示は sg-result）。
   色は共有CSSの変数のみを使い、ダークモードでも読めるようにする。
   ===================================================================== */

/* 調べ方の切替 */
.sg-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: var(--sg-space-1, 4px);
}
.sg-mode {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.95rem;
}

/* 結果の主表示（新旧JIS併記で長くなるため折り返し可） */
.sg-result__value {
  line-height: 1.5;
  word-break: break-word;
}

/* 選択サイズの内訳 */
.sg-spec {
  display: flex;
  flex-direction: column;
  margin-top: var(--sg-space-3, 12px);
  border-top: 1px solid var(--sg-border, #e5e7eb);
}
.sg-spec-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sg-space-3, 12px);
  padding: 7px 0;
  border-bottom: 1px solid var(--sg-border, #e5e7eb);
}
.sg-spec-row__key {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--sg-muted, #555);
  font-size: 0.95rem;
}
.sg-spec-row__val {
  flex: 0 1 auto;
  min-width: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}
/* 逆引きの種別名は長いので折り返し可・呼び径の列は詰める */
.sg-spec-row.is-wrap .sg-spec-row__key {
  flex: 0 0 auto;
  font-weight: 600;
  color: var(--sg-fg, #1a2230);
}
.sg-spec-row.is-wrap .sg-spec-row__val {
  flex: 1 1 auto;
  white-space: normal;
  font-weight: 500;
}
/* 新旧JISで違う行を目立たせる */
.sg-spec-row.is-diff .sg-spec-row__val {
  color: var(--sg-warm, #f59f3c);
}

/* 早見表（横スクロール保護） */
.sg-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.sg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  white-space: nowrap;
}
.sg-table th,
.sg-table td {
  padding: 6px 8px;
  text-align: right;
  border-bottom: 1px solid var(--sg-border, #e5e7eb);
  font-variant-numeric: tabular-nums;
}
.sg-table thead th {
  color: var(--sg-muted, #777);
  font-weight: 600;
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.3;
  border-bottom: 2px solid var(--sg-border, #e5e7eb);
}
.sg-table th[scope="row"] {
  text-align: left;
  font-weight: 600;
}

/* 旧JISで本体と違うセル */
.sg-table td.is-diff,
.sg-diff-mark {
  background: var(--sg-warm-soft, #fff3e2);
}
.sg-table td.is-diff {
  font-weight: 700;
}
.sg-diff-mark {
  padding: 0 4px;
  border-radius: 3px;
}

/* 選択中の呼び径の行 */
.sg-table tr.is-current th,
.sg-table tr.is-current td {
  background: var(--sg-primary-soft, #eaeefc);
}
.sg-table tr.is-current td.is-diff {
  background: var(--sg-warm-soft, #fff3e2);
}

/* 逆引きで該当したセル */
.sg-table td.is-hit {
  background: var(--sg-primary-soft, #eaeefc);
  color: var(--sg-primary, #3b5bdb);
  font-weight: 700;
  outline: 2px solid var(--sg-primary, #3b5bdb);
  outline-offset: -2px;
}
