/* =====================================================================
   style.css — 階段の寸法計算 ツール固有の微調整のみ。
   共通スタイルは /_shared/shirugear.css に任せる（結果表示は sg-result）。
   ===================================================================== */

.sg-result__value,
.sg-result-row__value {
  font-variant-numeric: tabular-nums;
}
.sg-result__value {
  overflow-wrap: anywhere;
}

/* 入力：2列は狭い画面で折り返す。上端揃え（説明文の長さが違っても入力欄がずれない） */
#st-form .sg-row {
  flex-wrap: wrap;
  align-items: flex-start;
}
#st-form .sg-row > .sg-field {
  flex: 1 1 140px;
  min-width: 0;
}
.sg-field .sg-help {
  margin-top: var(--sg-space-1);
}

/* 単位つき入力 */
.st-unit-input {
  display: flex;
  align-items: center;
  gap: 6px;
}
.st-unit-input .sg-input {
  flex: 1 1 auto;
  min-width: 0;
}
.st-unit {
  flex: 0 0 auto;
  color: var(--sg-muted, #777);
  font-size: 0.9rem;
}
#category {
  width: 100%;
  max-width: 100%;
}

.st-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: var(--sg-space-3);
  font-size: 0.9rem;
  line-height: 1.6;
  cursor: pointer;
}
.st-check input {
  margin-top: 0.3em;
  flex: 0 0 auto;
}

/* 例のボタン */
.st-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: var(--sg-space-4);
}
.st-presets__label {
  color: var(--sg-muted, #777);
  font-size: 0.85rem;
}
.st-preset {
  padding: 8px 12px;
  font-size: 0.85rem;
}

/* 照合リスト */
.st-judge {
  list-style: none;
  margin: var(--sg-space-3) 0 0;
  padding: 0;
}
.st-judge__item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--sg-border, #e5e7eb);
  line-height: 1.6;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.st-judge__item > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.st-judge__mark {
  flex: 0 0 auto;
  min-width: 4.2em;
  text-align: center;
  padding: 1px 6px;
  border-radius: var(--sg-radius-sm, 6px);
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid currentColor;
}
.is-ok .st-judge__mark {
  color: var(--sg-ok, #2b8a3e);
}
.is-ng .st-judge__mark {
  color: var(--sg-danger, #d23b3b);
}
.is-warn .st-judge__mark {
  color: var(--sg-danger, #d23b3b);
}
.is-info .st-judge__mark {
  color: var(--sg-muted, #777);
}

/* 側面図 */
.st-diagram {
  margin-top: var(--sg-space-3);
  text-align: center;
}
.st-diagram__svg {
  width: 100%;
  max-width: 440px;
  height: auto;
}
.st-d-floor {
  stroke: var(--sg-muted, #777);
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
}
.st-d-fill {
  fill: var(--sg-primary, #3b5bdb);
  fill-opacity: 0.12;
  stroke: none;
}
.st-d-line {
  fill: none;
  stroke: var(--sg-primary, #3b5bdb);
  stroke-width: 1.8;
  stroke-linejoin: miter;
}
.st-d-upper {
  stroke: var(--sg-text, #333);
  stroke-width: 3.5;
  stroke-linecap: square;
}
.st-d-dim {
  stroke: var(--sg-muted, #777);
  stroke-width: 1;
}
.st-d-label {
  fill: var(--sg-text, #333);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.st-d-small {
  fill: var(--sg-primary, #3b5bdb);
  font-size: 10px;
  font-weight: 700;
}

/* 表：狭い画面は横スクロール */
.st-table-wrap {
  position: relative; /* 表内の visually-hidden(absolute) がページ幅を広げないように */
  overflow-x: auto;
  margin-top: var(--sg-space-3);
}
.st-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  white-space: nowrap;
}
.st-table th,
.st-table td {
  padding: 8px 6px;
  text-align: right;
  border-bottom: 1px solid var(--sg-border, #e5e7eb);
  font-variant-numeric: tabular-nums;
}
.st-table thead th {
  color: var(--sg-muted, #777);
  font-weight: 600;
  border-bottom-width: 2px;
}
.st-table tbody th[scope="row"] {
  font-weight: 600;
}
.st-table tr.is-current {
  background: var(--sg-primary-soft, rgba(59, 91, 219, 0.08));
}
.st-table .st-ok {
  color: var(--sg-ok, #2b8a3e);
  font-weight: 700;
  text-align: center;
}
.st-table .st-ng {
  color: var(--sg-danger, #d23b3b);
  font-weight: 700;
  text-align: center;
}
.st-table .st-cur {
  color: var(--sg-muted, #777);
  font-size: 0.8rem;
}
.st-pick {
  padding: 4px 8px;
  font-size: 0.8rem;
}

/* 法令の早見：区分名は折り返す */
.st-law {
  white-space: normal;
}
.st-law tbody th[scope="row"] {
  text-align: left;
  font-weight: 500;
  min-width: 11em;
  line-height: 1.5;
}
.st-law td {
  white-space: nowrap;
  vertical-align: top;
}
