body{
  margin:0;
  font-family:system-ui,sans-serif;
  background:#0b0f17;
  color:#fff;
}

.app{
  max-width:900px;
  margin:20px auto;
  padding:10px;
}

.header h1{
  margin:0 0 6px;
}

.sub{
  margin-top: 6px;
  margin-bottom: 14px;
  font-size: 0.95rem;
  color: #b0b8c4;
  letter-spacing: 0.02em;
}

.card{
  background:#1a1f2e;
  padding:15px;
  border-radius:10px;
  margin-bottom:15px;
}

.grid{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
}

.field span{
  display:block;
  font-size:12px;
  opacity:.8;
  margin-bottom:6px;
}

.field input{
  width:100%;
  padding:10px;
  border-radius:8px;
  border:1px solid #2a3247;
  background:#0f1422;
  color:#fff;
  outline:none;
}

/* ✅ UX改善：入力中のフォーカスが分かりやすい */
.field input:focus{
  border-color:#6ea8ff;
  box-shadow:0 0 0 2px rgba(110,168,255,0.2);
}

/* ✅ 追加：入力フォーム下の補足文 */
.hint{
  margin-top:8px;
  font-size:12px;
  color:#b0b8c4;
  line-height:1.5;
}

.actions{
  margin-top:12px;
  display:flex;
  gap:10px;
}

.btn{
  padding:10px 14px;
  border-radius:8px;
  border:none;
  cursor:pointer;
  background:#2a3247;
  color:#fff;
}

.btn:hover{
  filter:brightness(1.05);
}

.primary{
  background:#6ea8ff;
  color:#0b0f17;
  font-weight:700;
}

.divider{
  height:1px;
  background:#2a3247;
  margin:14px 0;
}

/* ✅ ここがスマホ対策の本丸：statsをflexにして崩れを防ぐ */
.stats{
  margin-top:10px;
  line-height:1.6;
  display:flex;
  flex-direction:column;
  gap:14px;
}

/* ✅ statsテキスト表示（preでも崩れない） */
.statsText{
  margin:0;                /* ← iOSでの余白暴走を防ぐ */
  padding:0;
  white-space:pre-line;
  font-family:inherit;
}

/* ✅ 増量/減量目安ブロック（targets） */
.targets{
  padding: 12px;
  border-radius: 10px;
  background: #0f1422;
  border: 1px solid #2a3247;
}

.targetRow{
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 6px 0;
}

.targetRow + .targetRow{
  border-top: 1px dashed rgba(255,255,255,0.08);
  margin-top: 6px;
  padding-top: 10px;
}

.targetRow .label{
  font-size: 12px;
  color: #b0b8c4;
}

.targetRow .value{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.targetRow .delta{
  font-size: 12px;
  color: #b0b8c4;
  opacity: 0.9;
}

.targets .note{
  margin: 10px 0 0;
  font-size: 12px;
  color: #b0b8c4;
  line-height: 1.5;
}

/* ✅ グラフ用 */
.charts{
  display:grid;
  grid-template-columns:1fr;
  gap:16px;
}

.chartBox h3{
  margin:0 0 8px;
  font-size:14px;
  opacity:.9;
}

.canvasWrap{
  height:320px;
  border-radius:10px;
  background:#0f1422;
  border:1px solid #2a3247;
  padding:10px;
}

/* ✅ テーブル */
.table{
  width:100%;
  border-collapse:collapse;
}

.table th,.table td{
  padding:8px;
  border-bottom:1px solid #333;
}

.table th{
  text-align:left;
  opacity:.85;
}

.opBtns{
  display:flex;
  gap:8px;
  justify-content:flex-start;
}

.smallBtn{
  padding:6px 10px;
  border-radius:8px;
  border:none;
  cursor:pointer;
  background:#2a3247;
  color:#fff;
  font-size:12px;
}

.smallBtn.danger{
  background:#ff6e6e;
  color:#0b0f17;
  font-weight:700;
}

/* スマホ */
@media (max-width: 720px){
  .grid{
    grid-template-columns:1fr;
  }
  .canvasWrap{
    height:280px;
  }
  .targetRow{
    grid-template-columns: 76px 1fr auto;
  }
}
