﻿body{
  font-family: sans-serif;
  margin: 20px;
  background: #e8f5e9;
  color: #222;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

.hero-image {
  position: relative;
}

.hero-image {
  position: relative;
  overflow: hidden;
  height: 150px;
}

.hero-image img {
  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: center;

  display: block;
}

.overview-link {
  position: absolute;

  left: 20px;
  bottom: 10px;

  color: black;

  font-size: 0.85rem;
  font-weight: normal;

  text-decoration: none;

  opacity: 0.8;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.overview-link:hover {

  opacity: 1;

  transform: translateX(4px);

}

/* ===== ヒーロー ===== */
.hero-image{
  position:relative;
  width:100%;
  overflow:hidden;
}

.hero-image img{
  width:100%;
  display:block;
}

.hero-image h2{
  position:absolute;
  top:20px;
  left:20px;
  z-index:2;
  
  margin:0;

  color:#333333;
  font-size:clamp(21px, 3vw, 26px);
  font-weight:700;
  letter-spacing:1px;

  text-shadow:
    2px 2px 0 rgba(255,255,255,0.6);
}
/* ===== 見出し ===== */
h2, h3{
  margin: 12px 0;
}

h3{
  margin-top: 20px;
}

/* ===== テーブル基本 ===== */
table{
  border-collapse: collapse;
  background: #fff;
  width: 100%;
  table-layout:auto;
  margin-bottom: 20px;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

th, td{
  border: 1px solid #ddd;
  padding: 8px 10px;
  font-size: 16px;
  overflow-wrap:anywhere;
}

/* ヘッダ */
th{
  background: #f0f0f0;
  text-align: center;
}

/* ===== 値列共通 ===== */

#inputTable td:last-child,
.result-table td.value{

  width:18vw;

  min-width:105px;

  max-width:210px;

  box-sizing:border-box;
}

#inputTable select{

  width:100%;
  min-height:40px;

  border:none;

  background:transparent;

  direction:rtl;

  padding:8px 10px;

  box-sizing:border-box;

  font-size:16px;
  font-family:inherit;
  color:inherit;

  outline:none;

  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:none;

  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

/* ===== 入力セル ===== */

#inputTable td:last-child{
  padding:0;
  background:#fffef0;
}

#inputTable input{

  width:100%;
  height:100%;
  
  min-height:40px;

  border:none;
  margin:0;

  background:transparent;

  text-align:right;

  padding:8px 10px;

  box-sizing:border-box;

  font-size:16px;
  font-family:inherit;
  color:inherit;

  outline:none;

  appearance:none;
  -webkit-appearance:none;
  -moz-appearance:textfield;
}

#inputTable input:focus{
  background:#ffe9a8;
}

#ratio-error{
  background:#fffef0;
}

/* ===== 入力エラー専用 ===== */

.input-error-text{

  display:none;

  width:100%;

  box-sizing:border-box;

  margin-top:0px;

  padding-right:10px;

  font-size:12px;

  color:#d60000;

  line-height:1.1;

  text-align:right;
  
  position:relative;

  top:-6px;
  
  background:#fffef0;
}

.input-error-text.show{
  display:block;
}

.select-error{
  color:#d60000;
}

.top-error {

  color:#d60000;

  font-size: 12px;

  font-weight: normal;

  margin-top: 0px;

  display: none;

}

.top-error.show {

  display: block;

}

/* ===== 結果セル ===== */

.result-table td.value{
  background:#fff3d9;
  text-align:right;
  padding:8px 10px;
}

/* ===== 共通エラー ===== */

.error-value{
  color:#d60000;
  font-weight:bold;
}

.error-text{
  margin-top:4px;
  font-size:12px;
  color:#d60000;
  line-height:1.2;
}

/* ===== ボタン ===== */
button{
  padding: 10px 16px;
  font-size: 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 8px;
  background: #4a90e2;
  color: white;
  transition: 0.2s;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}

.button-area{
  margin:20px 0;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.calc-btn{
  width: clamp(160px, 22vw, 260px);
}

.button-right{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

button:hover{
  background: #3a78c2;
}

/* ===== 計算ボタン無効 ===== */

button:disabled{
  background:#999999;
  cursor:not-allowed;
  opacity:0.7;
}

/* ===== 結果エリア ===== */
#result{
  margin-top: 30px;
}

/* セクション見出し */
.section{
  background: #ddd;
  font-weight: bold;
}

  .csv-note{
    margin-top:20px;
    font-size:11px;
    line-height:1.2;
    color:#666666;
  }

  .csv-note p{
    margin:0;
  }

/* ===== モバイル対応 ===== */
@media (max-width: 768px){

  .button-area{
    display:flex;
    flex-direction:column;
    gap:10px;
    align-items:stretch;
  }

  /* 計算ボタン */
  .calc-btn{
    width:100%;
    font-size:14px;
    padding:8px 12px;
  }

  /* 右側ボタン群 */
  .button-right{
    display:flex;
    flex-direction:column;
    gap:8px;
    width:100%;
  }

  /* 全ボタンを同じ比率で縮小 */
  .button-right button{
    width:100%;
    font-size:13px;
    padding:7px 10px;
  }
  
}