/* スマホ最優先 */
:root{
  --bg:#f5f6f8;
  --card:#ffffff;
  --line:#d7dee7;
  --text:#111827;
  --muted:#6b7280;
  --brand:#0066cc;
  --brand2:#0f172a;
  --ok:#0a7a2f;
}

body{
  margin:0;
  padding:16px;
  background:var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color:var(--text);
}

.tool{
  max-width:520px;
  margin:0 auto;
  background:var(--card);
  border-radius:16px;
  padding:18px;
  box-shadow:0 4px 18px rgba(0,0,0,.08);
}

h2{
  margin:0 0 8px;
  text-align:center;
  font-size:18px;
}

.desc{
  margin:0 0 14px;
  text-align:center;
  color:var(--muted);
  font-size:13px;
  line-height:1.6;
}

.section{ margin-bottom:14px; }
.label{ font-weight:800; margin-bottom:8px; font-size:14px; }

.unit-select{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:8px;
}
.unit-item input{ display:none; }
.unit-item span{
  display:block;
  text-align:center;
  padding:10px 0;
  border:1px solid var(--line);
  border-radius:10px;
  font-weight:800;
  font-size:13px;
  background:#fff;
}
.unit-item input:checked + span{
  background:var(--brand);
  border-color:var(--brand);
  color:#fff;
}

.products{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.product{
  border:1px solid var(--line);
  border-radius:12px;
  padding:12px;
  background:#fbfdff;
}

.ptitle{
  font-weight:900;
  margin-bottom:8px;
  font-size:14px;
}

.row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.row input{
  width:100%;
  padding:12px 10px;
  border:1px solid var(--line);
  border-radius:10px;
  font-size:16px;
  background:#fff;
}

.buttons{
  display:flex;
  gap:10px;
  margin-top:14px;
}

.btn{
  flex:1;
  padding:14px 12px;
  border:none;
  border-radius:12px;
  font-size:16px;
  font-weight:900;
  cursor:pointer;
}

.btn.primary{ background:var(--brand); color:#fff; }
.btn.primary:hover{ filter:brightness(.95); }

.btn.ghost{ background:var(--brand2); color:#fff; }
.btn.ghost:hover{ filter:brightness(.95); }

.result{
  display:none;
  margin-top:14px;
  padding:12px;
  border-radius:12px;
  background:#f1f5f9;
  border-left:6px solid var(--brand);
  white-space:pre-line;
  font-size:14px;
  line-height:1.8;
}

.badge{
  display:inline-block;
  padding:2px 10px;
  border-radius:999px;
  background:#dcfce7;
  color:var(--ok);
  font-weight:900;
  margin-right:6px;
  font-size:12px;
}

.hint{
  margin-top:12px;
  color:#334155;
  font-size:13px;
}
.hint summary{
  cursor:pointer;
  font-weight:900;
}

@media (max-width:380px){
  .unit-select{ grid-template-columns:1fr; }
  .row{ grid-template-columns:1fr; }
}