﻿* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
button { touch-action: manipulation; }


body {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.7;
  overflow-x: hidden;
}

header {
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  padding: 1rem 0;
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.logo {
  font-size: 1.2rem;
  font-weight: bold;
  color: #1a73e8;
  text-decoration: none;
}

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* ━━━ ヒーロー ━━━ */
.hero {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}

.hero-icon { font-size: 3rem; margin-bottom: 0.5rem; }

h1 {
  font-size: 1.9rem;
  font-weight: bold;
  margin-bottom: 0.6rem;
}

h2 {
  font-size: 1.05rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.description {
  color: #666;
  font-size: 0.95rem;
  line-height: 1.8;
}

/* ━━━ カード共通 ━━━ */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid #e0e0e0;
}

/* ━━━ 料金設定カード ━━━ */
.rate-card {
  border-left: 4px solid #f59e0b;
}

.rate-row {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.rate-main {
  flex-shrink: 0;
}

.rate-label {
  display: block;
  font-size: 0.875rem;
  font-weight: bold;
  color: #555;
  margin-bottom: 0.4rem;
}

.rate-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rate-input-wrap input {
  width: 90px;
  padding: 0.55rem 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #f59e0b;
  font-family: inherit;
  text-align: right;
  transition: border-color 0.2s;
}

.rate-input-wrap input:focus {
  outline: none;
  border-color: #f59e0b;
}

.unit {
  font-size: 0.9rem;
  color: #888;
  white-space: nowrap;
}

.rate-hint {
  font-size: 0.8rem;
  color: #999;
  line-height: 1.6;
  padding-top: 0.2rem;
}

/* ━━━ 家電カード ━━━ */
.appliance-card {
  background: #fff;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  border-left: 4px solid #1a73e8;
  transition: box-shadow 0.2s;
}

.appliance-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.card-top {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.6rem;
}

.preset-select {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  color: #555;
  background: #fafafa;
  cursor: pointer;
  transition: border-color 0.2s;
}

.preset-select:focus {
  outline: none;
  border-color: #1a73e8;
}

.del-btn {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  color: #bbb;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.del-btn:hover {
  border-color: #ef5350;
  color: #ef5350;
  background: #fff5f5;
}

.name-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #333;
  margin-bottom: 0.75rem;
  transition: border-color 0.2s;
}

.name-input:focus {
  outline: none;
  border-color: #1a73e8;
}

/* 3列入力グリッド */
.card-inputs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

.input-mini label {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 0.25rem;
}

.input-unit-wrap {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.input-unit-wrap input[type=number] {
  width: 100%;
  min-width: 0;
  padding: 0.5rem 0.5rem;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  text-align: right;
  transition: border-color 0.2s;
}

.input-unit-wrap input[type=number]:focus {
  outline: none;
  border-color: #1a73e8;
}

.input-unit-wrap .unit {
  font-size: 0.78rem;
  white-space: nowrap;
  color: #999;
  flex-shrink: 0;
}

/* カード内の計算結果 */
.card-result {
  background: #f8faff;
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.card-monthly-label {
  font-size: 0.78rem;
  color: #888;
  white-space: nowrap;
}

.card-monthly-value {
  font-size: 1.05rem;
  font-weight: bold;
  color: #1a73e8;
}

.card-annual-value {
  font-size: 0.8rem;
  color: #aaa;
  margin-left: auto;
}

/* ━━━ 追加ボタン ━━━ */
.add-btn-wrap {
  text-align: center;
  margin-bottom: 1rem;
}

.btn-add {
  padding: 0.7rem 2rem;
  border: 2px dashed #1a73e8;
  border-radius: 10px;
  background: #f0f6ff;
  color: #1a73e8;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-add:hover {
  background: #e0edff;
}

/* ━━━ 合計結果カード ━━━ */
.result-card {
  background: linear-gradient(135deg, #1a2744 0%, #1e3a6e 60%, #0d2445 100%);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  margin-bottom: 1rem;
  color: #fff;
}

.result-totals {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.result-item {
  flex: 1;
  min-width: 0;
}

.result-item-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 0.25rem;
}

.result-item-value {
  font-size: 1.6rem;
  font-weight: bold;
  color: #ffd54f;
  line-height: 1.2;
}

.result-item-value.result-annual {
  font-size: 1.2rem;
  color: #fff;
}

.result-yen {
  font-size: 0.75em;
  font-weight: normal;
  margin-left: 0.1em;
  opacity: 0.8;
}

.result-divider {
  width: 1px;
  height: 48px;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
}

/* バーチャート */
.bar-chart-section {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 1rem;
}

.bar-chart-title {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.bar-name {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
  width: 140px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-wrap {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd54f, #ffb300);
  border-radius: 999px;
  transition: width 0.4s ease;
  min-width: 2px;
}

.bar-value {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.75);
  width: 70px;
  text-align: right;
  flex-shrink: 0;
}

/* ━━━ Amazonおすすめ ━━━ */
.amazon-card h2 { margin-bottom: 0.25rem; }

.amazon-note {
  font-size: 0.82rem;
  color: #999;
  margin-bottom: 1rem;
}

.amazon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.amazon-item {
  display: block;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}

.amazon-item:hover {
  border-color: #FF9900;
  box-shadow: 0 2px 8px rgba(255,153,0,0.15);
  transform: translateY(-1px);
}

.amazon-item-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.amazon-item-name { font-size: 0.9rem; font-weight: bold; margin-bottom: 0.25rem; }
.amazon-item-desc { font-size: 0.78rem; color: #888; line-height: 1.5; margin-bottom: 0.5rem; }
.amazon-item-link { font-size: 0.8rem; color: #FF9900; font-weight: bold; }

/* ━━━ 説明カード ━━━ */
.explanation-item {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f0f0f0;
}

.explanation-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.explanation-item h3 {
  font-size: 0.9rem;
  font-weight: bold;
  margin-bottom: 0.3rem;
  color: #f59e0b;
}

.explanation-item p {
  font-size: 0.875rem;
  color: #666;
  line-height: 1.7;
}

footer {
  text-align: center;
  padding: 2rem;
  color: #999;
  font-size: 0.875rem;
}

footer a { color: #999; text-decoration: none; margin: 0 0.5rem; }
footer a:hover { color: #1a73e8; }
footer p { margin-bottom: 0.3rem; }

/* ━━━ レスポンシブ ━━━ */

/* ─── Tips grid (rank-tracker 統一パターン) ──────── */
.tips-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.tip-item { display: flex; gap: .65rem; }
.tip-icon { font-size: 1.4rem; flex-shrink: 0; }
.tip-text strong { display: block; font-weight: 700; margin-bottom: .15rem; font-size: .88rem; }
.tip-text p { font-size: .8rem; color: #78716c; line-height: 1.55; }
@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }

  .rate-row { flex-direction: column; gap: 0.5rem; }

  .card-inputs { grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }

  .result-totals { flex-direction: column; gap: 0.75rem; }
  .result-divider { width: 100%; height: 1px; }
  .result-item-value { font-size: 1.35rem; }

  .bar-name { width: 100px; font-size: 0.72rem; }
  .bar-value { width: 60px; font-size: 0.72rem; }

  .amazon-grid { grid-template-columns: repeat(2, 1fr); }

  .tips-grid { grid-template-columns: 1fr; }
}

.amazon-notice {
  font-size: 0.72rem;
  color: #bbb;
  margin-top: 0.2rem;
}

/* ━━━ ヒーローバッジ ━━━ */
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.badge {
  display: inline-block;
  padding: 5px 13px;
  background: #fffbeb;
  color: #d97706;
  border: 1.5px solid #fde68a;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ━━━ 活用シーン ━━━ */
.scene-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
}
.scene-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-radius: 12px;
}
.scene-icon { font-size: 1.7rem; flex-shrink: 0; }
.scene-body strong { display: block; font-size: .88rem; font-weight: 700; color: #d97706; margin-bottom: .2rem; }
.scene-body p { font-size: .78rem; color: #78716c; line-height: 1.55; margin: 0; }

@media (max-width: 600px) {
  .scene-grid { grid-template-columns: 1fr; }
}

/* ━━━ FAQ ━━━ */
.faq-list { display: flex; flex-direction: column; }
.faq-item { padding: .9rem 0; border-bottom: 1px solid #f0f0f0; }
.faq-item:last-child { border-bottom: none; padding-bottom: 0; }
.faq-q { font-size: .9rem; font-weight: 700; color: #f59e0b; margin-bottom: .35rem; }
.faq-a { font-size: .85rem; color: #555; line-height: 1.75; }

/* ━━━ 家電電気代早見表 ━━━ */
.table-wrap { overflow-x: auto; }
.table-note-top { font-size: .8rem; color: #aaa; margin-bottom: .65rem; }
.table-note     { font-size: .75rem; color: #bbb; margin-top: .5rem; }

.appliance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .83rem;
  min-width: 520px;
}
.appliance-table th {
  background: #f59e0b;
  color: #fff;
  padding: .5rem .75rem;
  text-align: right;
  font-weight: 700;
  font-size: .78rem;
  white-space: nowrap;
}
.appliance-table th:first-child { text-align: left; }
.appliance-table td {
  padding: .42rem .75rem;
  border-bottom: 1px solid #f0f0f0;
  text-align: right;
  color: #444;
  vertical-align: middle;
}
.appliance-table td:first-child { text-align: left; font-weight: 500; }
.appliance-table tr:hover td { background: #fffbeb; }
.elec-val { font-weight: 700; color: #d97706; font-variant-numeric: tabular-nums; }
.hl-row td { background: #fffbeb !important; }
.section-row td {
  background: #f5f5f5;
  font-weight: 700;
  font-size: .78rem;
  color: #666;
  padding: .28rem .75rem;
  letter-spacing: .03em;
}

/* ━━━ 関連ツール ━━━ */
.related-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.related-tool-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .85rem 1rem;
  border: 1.5px solid #fde68a;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.related-tool-item:hover { border-color: #f59e0b; box-shadow: 0 2px 8px rgba(245,158,11,.15); }
.related-tool-icon { font-size: 1.6rem; flex-shrink: 0; }
.related-tool-item strong { display: block; font-size: .88rem; font-weight: 700; color: #d97706; margin-bottom: .2rem; }
.related-tool-item p { font-size: .76rem; color: #888; line-height: 1.5; margin: 0; }

@media (max-width: 560px) {
  .related-tools { grid-template-columns: 1fr; }
}
