/* =====================================================================
   style.css — たこ足配線の電力チェック ツール固有の微調整のみ。
   共通スタイルは /_shared/shirugear.css に任せる（結果表示は sg-result）。
   ===================================================================== */

/* 安全上の注意（強めに） */
.psl-danger {
  border-left: 4px solid #e03131;
  background: var(--sg-danger-bg, #fff5f5);
}
.psl-danger__head {
  margin: 0 0 0.4em;
  font-weight: 700;
  color: #c92a2a;
}
.psl-danger__body {
  margin: 0;
  line-height: 1.8;
  font-size: 0.94rem;
}

/* 定格入力 */
.psl-rating {
  max-width: 12em;
}

/* 家電の行 */
.psl-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: var(--sg-space-1, 4px);
}
.psl-row {
  display: grid;
  grid-template-columns: minmax(9em, 1.2fr) minmax(6em, 1fr) 5.5em auto auto;
  align-items: center;
  gap: 6px;
}
.psl-preset,
.psl-name {
  min-width: 0;
}
.psl-w {
  text-align: right;
}
.psl-unit {
  color: var(--sg-muted, #777);
  font-size: 0.9rem;
}
.psl-del {
  width: 2em;
  height: 2em;
  line-height: 1;
  font-size: 1.1rem;
  border: 1px solid var(--sg-border, #e5e7eb);
  border-radius: 8px;
  background: transparent;
  color: var(--sg-muted, #777);
  cursor: pointer;
}
.psl-del:hover {
  color: #c92a2a;
  border-color: #f1aeae;
}

.psl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

/* 使用率メーター */
.psl-meter {
  height: 12px;
  border-radius: 999px;
  background: var(--sg-border, #e5e7eb);
  overflow: hidden;
  margin: 12px 0;
}
.psl-meter__bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #2f9e44; /* OK: 緑 */
  transition: width 0.2s ease;
}
.psl-meter__bar.is-warn {
  background: #f08c00; /* 注意: 橙 */
}
.psl-meter__bar.is-over {
  background: #e03131; /* 超過: 赤 */
}

/* 判定メッセージ */
.psl-judge {
  margin: 8px 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  line-height: 1.75;
  font-size: 0.94rem;
  font-weight: 600;
}
.psl-judge.is-ok {
  background: var(--sg-ok-bg, #ebfbee);
  color: #2b8a3e;
}
.psl-judge.is-warn {
  background: var(--sg-warn-bg, #fff4e6);
  color: #d9480f;
}
.psl-judge.is-over {
  background: var(--sg-danger-bg, #fff5f5);
  color: #c92a2a;
}

/* サマリ行の値 */
.psl-k {
  color: var(--sg-muted, #555);
}
.psl-v {
  font-weight: 600;
  text-align: right;
  flex: 1 1 auto;
}
.psl-v.is-over {
  color: #c92a2a;
}

/* 早見表 */
.sg-chart {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 2px 16px;
}
.sg-chart-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--sg-border, #e5e7eb);
}
.psl-chart-key {
  flex: 1 1 auto;
  font-weight: 600;
  text-align: left;
}
.sg-chart-row__val {
  flex: 0 0 auto;
  color: var(--sg-muted, #555);
  white-space: nowrap;
}

/* 狭幅では行を2段に */
@media (max-width: 480px) {
  .psl-row {
    grid-template-columns: 1fr 5.5em 2.5em;
    grid-template-areas:
      "preset preset del"
      "name w unit";
    gap: 6px;
  }
  .psl-preset {
    grid-area: preset;
  }
  .psl-name {
    grid-area: name;
  }
  .psl-w {
    grid-area: w;
  }
  .psl-unit {
    grid-area: unit;
    align-self: center;
  }
  .psl-del {
    grid-area: del;
    justify-self: end;
  }
}
