/**
 * assets/css/tokupicks-psuwatt.css
 * [tokupicks_psu_watt] 電源Wシミュレーター 専用スタイル
 *
 * tokupicks.css の共通クラス（.tp-card / .tp-input / .tp-select / .tp-loading 等）を
 * 前提に、このツール固有のパーツだけを `.tp-psuw-` プレフィックスで追加する。
 * 他ショートコード（board/page/pcbuilder/price-chart）には一切影響しない独立ファイル。
 */

#tokupicks-psuwatt {
  --tp-bg-main:   #f8fafc;
  --tp-bg-card:   #ffffff;
  --tp-bg-input:  #f1f5f9;
  --tp-border:    #e2e8f0;
  --tp-text-main: #0f172a;
  --tp-text-sub:  #64748b;
  --tp-orange:    #ff6b00;
  --tp-cyan:      #00c8b5;
  --tp-red:       #ef4444;
  --tp-green:     #059669;
  --tp-radius:    12px;
  --tp-shadow:    0 2px 12px rgba(0,0,0,.07);

  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
  color: var(--tp-text-main);
  padding: 8px 0;
  box-sizing: border-box;
  width: 100%;
}
#tokupicks-psuwatt *, #tokupicks-psuwatt *::before, #tokupicks-psuwatt *::after {
  box-sizing: border-box;
}

.tp-psuw-lede {
  font-size: 12.5px;
  color: var(--tp-text-sub);
  line-height: 1.7;
  margin: 0 0 14px;
}

.tp-psuw-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
  align-items: start;
  width: 100%;
}
@media (max-width: 820px) {
  .tp-psuw-grid { grid-template-columns: minmax(0, 1fr); }
}

.tp-psuw-card-title {
  font-size: 13px;
  font-weight: 900;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---------- 入力フィールド共通 ---------- */
.tp-psuw-field { margin-bottom: 14px; }
.tp-psuw-field:last-child { margin-bottom: 0; }
.tp-psuw-field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.tp-psuw-field-label { font-size: 12px; font-weight: 700; color: var(--tp-text-main); }
.tp-psuw-field-power {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  font-weight: 900;
  color: var(--tp-orange);
}

/* ---------- CPU/GPU コンボボックス検索（実データ連携） ---------- */
.tp-psuw-combo { position: relative; }
.tp-psuw-combo-clear {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  color: var(--tp-text-sub);
  cursor: pointer;
  border-radius: 6px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tp-psuw-combo-clear:hover { background: var(--tp-bg-input); color: var(--tp-text-main); }
.tp-psuw-combo-list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--tp-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  display: none;
}
.tp-psuw-combo-list.tp-open { display: block; }
.tp-psuw-combo-opt {
  padding: 9px 12px;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #f1f5f9;
}
.tp-psuw-combo-opt:last-child { border-bottom: none; }
.tp-psuw-combo-opt:hover, .tp-psuw-combo-opt.tp-active { background: #fff7ed; }
.tp-psuw-combo-opt-name { color: var(--tp-text-main); flex: 1; min-width: 0; }
.tp-psuw-combo-opt-power {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11.5px;
  font-weight: 900;
  color: var(--tp-orange);
  flex-shrink: 0;
}
.tp-psuw-combo-empty, .tp-psuw-combo-loading {
  padding: 16px 12px;
  font-size: 12px;
  color: var(--tp-text-sub);
  text-align: center;
}
.tp-psuw-combo-note {
  font-size: 10.5px;
  color: var(--tp-text-sub);
  margin-top: 5px;
  line-height: 1.5;
}

/* CPU/GPUが選ばれていない場合の手動W数入力 */
.tp-psuw-manual {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.tp-psuw-manual label {
  font-size: 11px;
  color: var(--tp-text-sub);
  flex-shrink: 0;
}
.tp-psuw-manual input[type=number] {
  width: 84px;
  flex: 0 0 auto;
}

/* ---------- トグル群（マザーボード/クーラー） ---------- */
.tp-psuw-toggle { display: flex; gap: 8px; }
.tp-psuw-toggle-btn {
  flex: 1 1 0;
  background: var(--tp-bg-input);
  border: 1px solid var(--tp-border);
  color: var(--tp-text-sub);
  border-radius: 8px;
  padding: 9px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}
.tp-psuw-toggle-btn:hover { border-color: var(--tp-orange); }
.tp-psuw-toggle-btn.tp-active {
  background: #fff3e8;
  border-color: var(--tp-orange);
  color: #c2410c;
}

/* ---------- ステッパー ---------- */
.tp-psuw-stepper { display: flex; align-items: center; gap: 10px; }
.tp-psuw-stepper-btn {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--tp-border);
  background: var(--tp-bg-input);
  color: var(--tp-text-main);
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all .15s;
}
.tp-psuw-stepper-btn:hover { border-color: var(--tp-orange); }
.tp-psuw-stepper-btn:disabled { opacity: .35; cursor: not-allowed; }
.tp-psuw-stepper-val {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 13px; font-weight: 900; min-width: 42px; text-align: center;
}
.tp-psuw-stepper-unit { font-size: 11px; color: var(--tp-text-sub); }

/* ---------- 結果カード ---------- */
.tp-psuw-peak-block {
  text-align: center;
  padding: 4px 0 14px;
  border-bottom: 1px solid var(--tp-border);
  margin-bottom: 14px;
}
.tp-psuw-peak-label { font-size: 11px; color: var(--tp-text-sub); margin-bottom: 4px; }
.tp-psuw-peak-value {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 32px; font-weight: 900; color: var(--tp-cyan);
}
.tp-psuw-peak-note { font-size: 10px; color: var(--tp-text-sub); margin-top: 5px; }

.tp-psuw-recommend-label { font-size: 11px; color: var(--tp-text-sub); text-align: center; margin-bottom: 4px; }
.tp-psuw-recommend-range { display: flex; align-items: baseline; justify-content: center; gap: 10px; margin-bottom: 14px; }
.tp-psuw-recommend-num {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 28px; font-weight: 900; color: var(--tp-orange);
}
.tp-psuw-recommend-sep { font-size: 15px; color: var(--tp-text-sub); }
.tp-psuw-recommend-warning {
  background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c;
  border-radius: 10px; padding: 10px 12px; font-size: 12px; line-height: 1.6;
  text-align: center; margin-bottom: 14px;
}

.tp-psuw-loadmeters { display: flex; flex-direction: column; gap: 10px; }
.tp-psuw-loadmeter { background: var(--tp-bg-input); border: 1px solid var(--tp-border); border-radius: 10px; padding: 10px 12px; }
.tp-psuw-loadmeter-head { display: flex; align-items: center; justify-content: space-between; font-size: 12px; margin-bottom: 6px; }
.tp-psuw-loadmeter-title { font-weight: 700; }
.tp-psuw-loadmeter-pct { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-weight: 900; }
.tp-psuw-loadmeter-track { height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; position: relative; }
.tp-psuw-loadmeter-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--tp-orange), var(--tp-cyan)); transition: width .2s ease; }
.tp-psuw-loadmeter-sweet { position: absolute; top: -1px; bottom: -1px; left: 50%; width: 25%; border-left: 1px dashed #94a3b8; border-right: 1px dashed #94a3b8; }
.tp-psuw-loadmeter-desc { font-size: 10.5px; color: var(--tp-text-sub); margin-top: 5px; }

/* ---------- 電源ユニット提案エリア（実データ・得ピックスDB連携） ---------- */
.tp-psuw-shop-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.tp-psuw-shop-tag {
  background: var(--tp-bg-input); border: 1px solid var(--tp-border); color: var(--tp-text-sub);
  border-radius: 999px; padding: 6px 13px; font-size: 12px; font-weight: 900;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  cursor: pointer; transition: all .15s;
}
.tp-psuw-shop-tag:hover { border-color: var(--tp-orange); }
.tp-psuw-shop-tag.tp-active { background: #fff3e8; border-color: var(--tp-orange); color: #c2410c; }

.tp-psuw-shop-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.tp-psuw-shop-card {
  background: #fff;
  border: 1px solid var(--tp-border);
  border-radius: 10px;
  padding: 13px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  box-shadow: var(--tp-shadow);
}
.tp-psuw-shop-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tp-psuw-shop-card-watt {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11px; font-weight: 900; color: #0e7490;
  border: 1px solid #a5f3fc; background: #ecfeff;
  border-radius: 999px; padding: 2px 8px; flex-shrink: 0; white-space: nowrap;
}
.tp-psuw-shop-card-name {
  font-size: 12.5px; font-weight: 700; line-height: 1.4; color: var(--tp-text-main);
  text-decoration: none;
}
.tp-psuw-shop-card-name:hover { color: var(--tp-cyan); }
.tp-psuw-shop-card-store { font-size: 11px; color: var(--tp-text-sub); }
.tp-psuw-shop-card-prices { display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.tp-psuw-shop-card-price {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 17px; font-weight: 900; color: var(--tp-text-main);
}
.tp-psuw-shop-card-price .tp-psuw-eff-label { font-size: 10px; font-weight: 700; color: var(--tp-text-sub); margin-left: 3px; }
.tp-psuw-shop-card-list { font-size: 11px; color: var(--tp-text-sub); text-decoration: line-through; }
.tp-psuw-shop-card-pt { font-size: 10.5px; color: var(--tp-text-sub); }
.tp-psuw-shop-card-btn {
  margin-top: 2px;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  text-align: center; text-decoration: none;
  background: #00c8b5; color: #fff; font-weight: 900; font-size: 12px;
  border: none; border-radius: 6px; padding: 8px 0;
  cursor: pointer; transition: background .15s; font-style: italic;
}
.tp-psuw-shop-card-btn:hover { background: #00a89a; }
.tp-psuw-shop-empty { grid-column: 1 / -1; text-align: center; color: var(--tp-text-sub); font-size: 12.5px; padding: 30px 10px; }
.tp-psuw-shop-note { margin-top: 12px; font-size: 10.5px; color: var(--tp-text-sub); line-height: 1.7; }

.tp-psuw-cta-row { margin-top: 14px; text-align: center; }
.tp-psuw-cta-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--tp-orange); color: #fff; font-weight: 900; font-size: 12.5px;
  text-decoration: none; border-radius: 8px; padding: 10px 18px;
  transition: background .15s;
}
.tp-psuw-cta-link:hover { background: #e05e00; }
