/* -- css -- */

@media screen and (min-width: 1200px) {
    #main .template-wide .wrapper {
        max-width: 1600px;
        width: 100%;
    }
}

/*flex box*/
#main .main {
  display: flex;
  flex-direction: row; /* 横並び */
  align-items: flex-start; /* 上揃え */
  width: 100%;
  /* min-height: calc(100vh - 80px);  ヘッダーとフッター分を引く */
  padding: 10px; /* 全体の余白 */
  gap: 10px; /* 左カラムと右カラムの隙間 */
  box-sizing: border-box;
  padding-bottom: 60px; /* フッターの被り防止 */
}

#main .center {
text-align: center; 
}

#main .buttonarea {
padding-bottom: 2rem;
}

/*
#main #dlCsvButton {
display: none;
}
*/

#main button:hover {
  cursor: pointer;
}

#main .contentA {
  flex: 0 0 auto; /* 伸長しない、縮小しない、ベースサイズはコンテンツ依存 */
  width: auto;
  max-width: none; /* 最大幅制限を解除（テーブルがどれだけ広くても許容する） */
  height: auto; 
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgb(255, 255, 255);
}

/* コンテンツB,Cの要素 */
#main .right {
  flex: 1;
  min-width: 0; 
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/*入力box*/
#main table {
  border-collapse: collapse;
  width: 100%;
  border: 1px solid #d5d5d5;
  white-space: nowrap;
}

#main table td,
#main table th {
  font-weight: 600;
  font-size: 75%;
  vertical-align: middle;
  text-align: left;
  padding: 4px 8px;
  border: 1px solid #d5d5d5;
  white-space: nowrap;
}

#main table th[colspan="3"] {
  background-color: #5a6b8a;
  color: #fff;
  font-size: 95%;
}

#main table th.tablehead {
  width: 100%;             /* セルの幅いっぱいに広げる */
  box-sizing: border-box;  /* paddingやborderを幅に含める（ズレ防止の重要設定） */
  height: 100%;            /* 高さをセルに合わせる */
  min-height: 24px;        /* 視認性確保のための最小高さ */
  margin: 0;               /* 余計なマージンを削除 */
  border: 1px solid #d5d5d5;  /* 必要に応じてボーダーを調整 */
  padding: 2px 4px;        /* 内部の余白調整 */
}

/* スピンボタンを非表示_固定値の部品用*/
#main input[type="number"].no-spin::-webkit-inner-spin-button,
#main input[type="number"].no-spin::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* Firefox用 */
input[type="number"].no-spin {
  -moz-appearance: textfield;
}

#main input, 
#main select {
     -ms-touch-action: manipulation;
     touch-action: manipulation;
     border: 1px solid #ccc;
     border-radius: 3px;
     min-height: 28px;
     padding: 1px 4px 0;

     background: #fff;
     font-size: 13px;
 }

/* コンボボックス全体の枠 */
#main .combo-box {
  position: relative;
  display: inline-block;
}

/* 1. コンテナをインライン要素のようにしつつ、中身はFlexで整列 */
#main #fswOption,
#main #controlOption {
  display: inline-flex;  /* セルの左端に寄せるために inline-flex を使用 */
  align-items: center;   /* 縦方向は中央揃え */
  flex-wrap: wrap;       /* 折り返しを許可 */
}

/* 2. ラジオボタン自体の余白を完全にゼロにする */
#main input[type="radio"],
#main input[type="checkbox"] {
  min-height: auto !important; /* 28px引き伸ばしを確実に解除 */
  width: 14px;                 /* サイズを固定して安定させる */
  height: 14px;
  padding: 0 !important;
  margin: 0 !important;        /* ★重要：個別マージンはすべてゼロ！ */
  border: none;
  cursor: pointer;
  vertical-align: middle;      /* 念のための指定 */
}

/* 3. ラベルの調整（ラジオボタンとの距離だけを指定） */
#main label.check_fsw,
#main label.check_control {
  display: inline-flex;
  align-items: center;         /* ラジオボタンとテキストの縦ズレを防ぐ */
  font-size: 13px;
  font-weight: normal !important; /* 太字解除 */
  cursor: pointer;
  margin-left: 4px;   /* ★ラジオボタンと文字の間のスペース（2px~4pxくらいが綺麗です） */
  margin-right: 15px; /* ★次の選択肢（右のラジオボタン）とのスペース */
}

/* 横のテキスト（label）も縦中央揃えの基準にする */
#main label {
  vertical-align: baseline;
  font-size: 13px;
  font-weight: normal;
}

/* 入力欄（右側に矢印ボタンのスペースを空ける） */
#main .combo-input {
  padding-right: 24px;
  box-sizing: border-box;
}

/* 矢印ボタンのデザイン */
#main .combo-arrow {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 22px;
  background: #f0f0f0;
  border: none;
  border-left: 1px solid #ccc;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #333;
}
#main .combo-arrow:hover {
  background: #e0e0e0;
}

/* ドロップダウンリストのデザイン */
#main .combo-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #ccc;
  border-top: none;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  list-style: none;
  padding: 0;
  margin: 0;
  z-index: 1000;
  max-height: 150px;
  overflow-y: auto;
  box-sizing: border-box;
}
#main .combo-dropdown li {
  padding: 6px 8px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid #eee;
}
#main .combo-dropdown li:last-child {
  border-bottom: none;
}
#main .combo-dropdown li:hover {
  background: #f0f8ff;
  color: #0066cc;
}

/* openクラスがついた時だけリストを表示 */
#main .combo-box.open .combo-dropdown {
  display: block;
}


/*warning.js関連*/
/* コメントボックス　エラー時のスタイル */
#main .input-error {
  border: 2px solid red !important; /* !importantで他のスタイルを上書き */
  background-color: #ffdddd;
}

#main .input-container,
#main .output-container {
  display: flex;
  flex-direction: column;
  width: 100%;
}

#main .error-message {
  color: red;
  margin-top: 4px;
  min-height: 1em;
}

#main .error-message:empty {
  display: none;
}

#main .right-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto auto;
  gap: 10px;
  width: 100%;
}

/* 各エリアの名前定義 */
#main .area-schematic { grid-area: schematic; }
#main .area-table     { grid-area: table; }
#main .area-waveform  { grid-area: waveform; }
#main .area-efficiency{ grid-area: efficiency; }

#main .right-grid {
  grid-template-areas:
    "schematic table"
    "efficiency waveform";
}

/* 各アイテムのスタイル調整 */
#main .grid-item {
  border: 1px solid #ccc;
  padding: 5px;
  background: #fff;
  min-height: 300px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  
}

#main .grid-item canvas {
  width: 100% !important;
  height: 100% !important;
  max-height: 300px;
  object-fit: contain;
}

#main .grid-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* tablw2とcanvasエリアの調整 */
#main .area-table {
  padding: 0 !important; /* グリッドアイテムの余白をなくす */
  align-items: stretch;  /* 中身を横幅いっぱいに引き伸ばす */
}

/*scheamtic========================================*/
/*schematicのタイトル調整 */
#main .area-schematic {
  position: relative; 
}

/*タイトルを絶対配置で上に重ねる */
#main .area-schematic .chart-title {
  position: absolute; /* 親要素を基準に配置 */
  top: 0;             /* 上端に合わせる */
  left: 0;            /* 左端に合わせる */
  width: 100%;        /* 幅いっぱい */
  
  /* 見た目の調整 */
  padding-top: 10px;
  z-index: 10;        /* Canvasより手前に表示 */
  pointer-events: none; /* タイトルがクリックを邪魔しないようにする */
  background-color: transparent; /* 背景は透明（必要なら rgba(255,255,255,0.8) などに） */
  
  /* フォント設定（Chart.jsに合わせる） */
  font-family: 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
  font-size: 14px;
  font-weight: bold;
  color: #666;
  text-align: center;
}
/*scheamtic========================================*/

/*chart-error========================================*/
.chart-container {
  position: relative; /* オーバーレイの基準点 */
}

/* エラー時のオーバーレイ（メッセージ用） */
.error-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.3); /* 半透明の白で覆う */
  display: flex;
  justify-content: center;
  align-items: center;
  color: red;
  font-weight: bold;
  font-size: 16px;
  opacity: 0;         /* 初期状態は非表示 */
  pointer-events: none; /* 下のグラフへの操作を無効化する場合 */
  transition: opacity 0.3s;
  z-index: 100;
}

/* エラー状態のクラス */
.chart-container.has-error .error-overlay {
  opacity: 1; /* 表示 */
  pointer-events: auto;
}

/* エラー時はCanvasを少しぼかす等しても良い */
.chart-container.has-error canvas {
  filter: grayscale(100%) blur(2px);
  opacity: 0.5;
}
/*chart-error========================================*/
#main .area-table .contentC {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}

#main .table2 {
  width: 100%;
  height: 100%;
  margin: 0;
  border-collapse: collapse;
}

#main .table2 tr {
  height: 10%;
}

#main .table2 th,
#main .table2 td {
  height: auto;
  vertical-align: middle; /* 上下中央揃え */
}

#main .table2 input[type="text"],
#main .table2 input[type="number"],
#main .table2 input[type="string"] {
  width: 100%;
  height: 100%;
  border: none;
  box-sizing: border-box;
}

@media (max-width: 768px) {
  #main .main {
    flex-direction: column; /* 全体を縦並びに */
    align-items: center;
  }
  
  #main .contentA {
    flex: none;
    width: 100%;
    max-width: 100%;
  }

  #main .right {
    width: 100%;
  }

  #main .right-grid {
    grid-template-columns: 1fr; /* グリッドも1列に */
    grid-template-areas:
      "schematic"
      "table"
      "waveform"
      "efficiency";
  }
}

#product_link {
  margin-left: 0px; color: #0066cc; text-decoration: underline; 
}

 .ablic-section-button a,  .ablic-section-button button,  .ablic-section-button span {
	position: relative;
	display: inline-block;
	min-width: 126px;
	padding: 10px 18px;
	margin: 0 0 0 20px;
	text-align: center;
	text-decoration: none;
	font-size: 15px;
	font-weight: 500;
	line-height: 16px;
	outline: none;
	z-index: 2;
	background: #3EA3E6;
	background: linear-gradient(180deg, #00aff4 0, #00aff4 45%, #008ed5);
	color: #ffffff;
	overflow: hidden;
	cursor: pointer;
	-webkit-transition: opacity 0.2s, background 0.2s;
	transition: opacity 0.2s, background 0.2s;
	cursor: pointer;
        border: none;
	border-radius: 20px;
}
 .ablic-section-button a:hover,  .ablic-section-button button:hover,  .ablic-section-button span:hover {
	opacity: 0.7;
}
