/* stylesCommon.css: NeoCalc 共通見た目 */
*,*::before,*::after{
  box-sizing: border-box;
}

:root{
  --brand:#007BFF;
  --bg:#f4f4f4;
  --card:#ffffff;
  --text:#333;
  --muted:#666;
  --border:#d9d9d9;
  --shadow:0 2px 5px rgba(0,0,0,0.10);
  --footerH:40px;
}

html {
  height: 100%;
  font-size: 16px;
}

body{
  height: 100%;
  margin:0;
  padding:0;
  font-family: Arial, sans-serif;
  color:var(--text);
  background-color:var(--bg);
  padding-bottom: calc(var(--footerH) + 16px);
}

header{
  background-color:var(--brand);
  color:#fff;
  padding:0.2rem 1.2rem;
  text-align:center;
}

main{
  max-width: 800px;
  margin: 0.6rem auto;
  padding: 0.6rem;
  background: var(--card);
  box-shadow: var(--shadow);
  border-radius: 10px;
}

h1, h2{
  text-align:center;
  margin:1.2rem 0 0.5rem 0;
}

h3{
  text-align:center;
  margin:2rem 0 0.5rem 0;
  font-size: 0.8rem;
}

h1.following, h2.following{
  margin-top: 2.4rem;
}


/* Navigation */
nav{
  margin: 0.4rem 0 0.8rem 0;
  background: #e6f2ff;
  border: 1px solid #cfe3ff;
  border-radius: 5px;
  padding: 0.4rem 0.8rem;
}

/* topnav：画面幅に応じて2行/3行…に折り返し、重ならない */
.topnav{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:0.5rem;
}

.topnav li{ margin:0; padding:0; }

.topnav a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0.2rem 0.4rem;
  font-size:0.8rem;
  color:#0b4aa2;
  text-decoration:none;
  background: #ffffffb3;
  border: 1px solid transparent;
  border-radius: 10px;
  white-space:nowrap;
}

.topnav a:hover{
  background:#fff;
  border-color:#b7d5ff;
}


/* 入力欄 */
.inputField {
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items: center;
  margin:0.5rem auto;
}

.firstRow{
    margin: 1rem auto 0.2rem auto;
}

input[type="number"]{
  text-align: center;
  margin: 0.2rem;
  padding: 0.1rem;
  width: 2rem;
}

input[type="number"].d2{  /* 小数点込みで2桁になる入力欄だけ別指定 */
  width: 2.5rem;
}

input[type="number"].d3{  /* 小数点込みで3桁になる入力欄だけ別指定 */
  width: 3rem;
}

input[type="number"].d4{  /* 小数点込みで4桁になる入力欄だけ別指定 */
  width: 3.5rem;
}

input[type="number"].d5{  /* 小数点込みで5桁になる入力欄だけ別指定 */
  width: 4rem;
}

input[type="date"]{
  width: 6rem;
}

input[type="time"]{
  width: 4.5rem;
}

label.index{
  margin:0.2rem 0.2rem 0.2rem 0.8rem;
}

label.unit{
  font-size: 0.8rem;
}

/* 結果ボックス */
.resultBox{
  text-align: center;
  max-width: 30rem;
  margin: 0.8rem auto;
  padding: 0.5rem;
  border: 1px solid #cfe3ff;
  background: #dfeeffc9;
  border-radius: 10px;
}

.resultBox h2{
  margin: 0.2rem 0;
}

.warning{
  color:#d9534f;
  font-weight: bold;
}

.confirmation{
  margin: 0;
  color:#f06e4e;
  font-weight: bold;
}

.buttonRow{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
  margin-top:1rem;  
}

.buttonRow button{  
  padding:0.2rem 0.6rem;
  font-size:1rem;
  border: 1.5px solid transparent;
  border-radius: 10px;
  background: #eeeeee;
  border-color:#c6c6c6;
}

.buttonRow button:hover{  
    background: #e2e2e7;
    border-color:#a1c7fd;
}


/* JS check */
#jscheck, #divJsCheck{
  text-align:center;
  font-size: 0.8rem;
  color:var(--muted);
}

/* Footer */
footer{
  background-color:#333;
  color:#fff;
  text-align:center;
  padding:0.3rem 0.6rem;
  width: 100%;
  min-height: var(--footerH);
  box-sizing: border-box;
}

footer p{ margin:0.4rem ;}

/* Responsive */
@media (max-width: 480px){
  html{ font-size:0.9rem; }
  .resultBox{ max-width: 90%; }

  input[type="date"]{
  width: 7.5rem;
  }

  input[type="time"]{
    width: 5rem;
  }

}