.drag-bar {
  width: 4px;
  background-color: var(--brand, #8cad9e);
  cursor: col-resize;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 999;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
  border-radius: 2px;
}

/* --- FP電卓 ヘッダー --- */
.fpc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--brand, #8cad9e);
  border-radius: 8px;
  margin-bottom: 12px;
}
.fpc-header__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.fpc-header__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #fff;
  opacity: 0.8;
  transition: opacity 0.15s, background 0.15s;
}
.fpc-header__close:hover {
  opacity: 1;
  background: rgba(255,255,255,0.2);
  color: #fff;
  text-decoration: none;
}

/* --- ボタンカード (メニュー) --- */
/* --- メニューグリッド --- */
.fpc-menu {
  display: flex !important;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
#fp_calculator_area .btn-card {
  height: auto;
  min-height: 38px;
  padding: 6px 2px;
  font-size: 12px;
  font-weight: 500;
  flex: 0 0 calc((100% - 12px) / 3);
  max-width: calc((100% - 12px) / 3);
  text-align: center;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #fff;
  color: #444;
  transition: all 0.15s;
  line-height: 1.3;
  box-sizing: border-box;
}
#fp_calculator_area .btn-card:hover {
  background: var(--brand-light, #e8f5e9);
  border-color: var(--brand, #8cad9e);
  color: var(--brand-dark, #3d6b52);
}
#fp_calculator_area .btn-card.active {
  background: var(--brand, #8cad9e);
  color: #fff;
  border-color: var(--brand, #8cad9e);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* --- 開閉ボタン (タブバー) --- */
#fp_calculator_area .fp_calculator,
.loan_detail .fp_calculator {
  background: linear-gradient(#b0b0b0, #949494);
  color: #fff !important;
  padding: 9px;
  border-radius: 3px;
}
#fp_calculator_area .fp_calculator.btn-default,
.loan_detail .fp_calculator.btn-default {
  margin-left: 12px;
}
.loan_tool_box .red {
  color: red!important;
}

/* --- 計算実行ボタン --- */
.fp_calculator_do {
  display: inline-block;
  padding: 12px 24px!important;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  background: var(--brand, #8cad9e);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  width: 100%;
  margin-top: 12px;
}
.fp_calculator_do:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* --- エリア全体 --- */
#fp_calculator_area {
  background: #fff;
  display: none;
  padding: 12px 14px 200px;
  border-left: 1px solid #e9ecef;
  position: sticky;
  top: 45px;
  max-height: calc(100vh - 45px);
  overflow-y: auto;
  align-self: flex-start;
}
#fp_calculator_area hr {
  margin-top: 9px;
  margin-bottom: 9px;
  border-color: #e9ecef;
}
#fp_calculator_area h2 {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  background: #f5f5f5;
  color: #333;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--brand, #8cad9e);
}
#fp_calculator_area h3 {
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  background: #f5f5f5;
  color: #333;
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid var(--brand, #8cad9e);
}

/* --- テーブル --- */
#fp_calculator_area table {
  border-collapse: collapse;
  width: 100%;
}
#fp_calculator_area table td,
#fp_calculator_area table th {
  border: solid 1px #ddd;
  padding: 6px;
  font-size: 13px;
}
#fp_calculator_area table thead tr td {
  background: var(--brand, #8cad9e);
  color: #fff;
  font-weight: bold;
  text-align: center;
  border: solid 1px #fff;
}
#fp_calculator_area tbody#loanTableBody td,
#fp_calculator_area table#transposedLoanTable tbody td {
  text-align: right;
  border: var(--brand, #8cad9e) solid 1px;
}

/* --- その他 --- */
#fp_calculator_area .analizer_pro {
  min-width: 100%;
}
#fp_calculator_area .tool_box,
#fp_calculator_area .loan_tool_box {
  background: #fff;
}
#fp_calculator_area .tool_box:before,
#fp_calculator_area .loan_tool_box:before {
  content: "";
  display: none;
}
/* --- 説明ブロック --- */
.fpc-desc {
  font-size: 13px;
  color: #555;
  margin: 6px 0 10px;
  line-height: 1.6;
}
.fpc-help {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 0;
  margin-bottom: 10px;
  font-size: 13px;
}
.fpc-help summary {
  padding: 8px 10px;
  cursor: pointer;
  color: var(--brand-dark, #3d6b52);
  font-weight: 600;
  font-size: 13px;
  list-style: none;
}
.fpc-help summary::-webkit-details-marker {
  display: none;
}
.fpc-help summary::before {
  content: "▶ ";
  font-size: 9px;
  margin-right: 4px;
  transition: transform 0.15s;
  display: inline-block;
}
.fpc-help[open] summary::before {
  transform: rotate(90deg);
}
.fpc-help[open] summary {
  border-bottom: 1px solid #e9ecef;
}
.fpc-help p,
.fpc-help dl {
  padding: 10px 12px;
  margin: 0;
  color: #444;
  line-height: 1.7;
}
.fpc-help-list {
  display: grid;
  gap: 4px;
}
.fpc-help-list dt {
  font-weight: 600;
  color: #333;
  font-size: 13px;
  margin-top: 4px;
}
.fpc-help-list dd {
  margin: 0 0 0 0;
  font-size: 13px;
  color: #666;
  padding-bottom: 4px;
  border-bottom: 1px dotted #e9ecef;
}
.fpc-help-list dd:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.fpc-notice-list {
  padding: 8px 10px 8px 24px;
  margin: 0;
  font-size: 13px;
  color: #666;
  line-height: 1.7;
}
.fpc-notice-list li {
  margin-bottom: 2px;
}

/* --- ツールボックス内の全般的なUI --- */
.fp_calculator_box {
  display: none;
  font-size: 14px;
  line-height: 1.7;
  color: #333;
}
.fp_calculator_box input,
.fp_calculator_box select {
  background: #fff !important;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 14px;
}
.fp_calculator_box input:focus,
.fp_calculator_box select:focus {
  border-color: var(--brand, #8cad9e);
  outline: none;
  box-shadow: 0 0 0 2px rgba(140, 173, 158, 0.15);
}
.fp_calculator_box input[required] {
  background-color: #fff3e0 !important;
  border-color: #ffb74d;
}
.fp_calculator_box input[readonly] {
  background-color: #f5f5f5 !important;
  color: #666;
}

/* --- フォームグリッド（投資逆算等） --- */
.fpc-form-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 10px;
  align-items: center;
}
.fpc-form-label {
  font-size: 14px;
  font-weight: 600;
  color: #444;
  white-space: nowrap;
  text-align: right;
}
.fpc-form-input {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
}
.fpc-form-input input {
  flex: 1;
  min-width: 0;
  max-width: 140px;
}
.fpc-form-input input.annualInterestRate {
  max-width: 120px;
}

/* --- 計算結果ハイライト --- */
.fp_calculator_box input.active {
  background: #fff8e1 !important;
  border: 2px solid #f59e0b !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  color: #d97706 !important;
  padding: 8px 10px !important;
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
  animation: fpc-result-pulse 0.6s ease;
}
@keyframes fpc-result-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
/* 結果行の親要素にラベル風表示 */
.fpc-result-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #f59e0b;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 12px 0;
  text-align: center;
  animation: fpc-result-pulse 0.6s ease;
}
.fpc-result-banner__label {
  font-size: 12px;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 4px;
}
.fpc-result-banner__value {
  font-size: 22px;
  font-weight: 800;
  color: #d97706;
  letter-spacing: 0.5px;
}
.fpc-result-banner__sub {
  font-size: 16px;
  font-weight: 700;
  color: #92400e;
  margin-top: 2px;
}

/* 説明テキスト */
.fp_calculator_box b {
  display: inline-block;
  margin-top: 6px;
  color: #333;
  font-size: 14px;
}
.fp_calculator_box > br + b,
.fp_calculator_box .tool_box ~ b,
.fp_calculator_box .loan_tool_box ~ b {
  margin-top: 10px;
}

/* ツール選択ラベル */
.fpc-select-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-dark, #3d6b52);
  margin-bottom: 8px;
}

/* ツール選択ボタン群 */
.fpc-tool-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.fpc-tool-btn {
  flex: 0 0 calc(50% - 3px);
  padding: 10px 6px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  border: 2px solid #d0d0d0;
  border-radius: 8px;
  background: #fff;
  color: #444;
  cursor: pointer;
  transition: all 0.15s;
  line-height: 1.3;
}
.fpc-tool-btn:hover {
  background: var(--brand-light, #e8f5e9);
  border-color: var(--brand, #8cad9e);
  color: var(--brand-dark, #3d6b52);
}
.fpc-tool-btn.active {
  background: var(--brand, #8cad9e);
  color: #fff;
  border-color: var(--brand, #8cad9e);
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

/* ツール内部のフォームエリア */
#fp_calculator_area .tool_box,
#fp_calculator_area .loan_tool_box {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 12px;
  margin-top: 8px;
}

/* h2とコンテンツの間隔 */
#fp_calculator_area h2 {
  margin-top: 0;
  margin-bottom: 10px;
}
#fp_calculator_area h3 {
  margin-top: 0;
  margin-bottom: 10px;
}

/* hr のスタイル */
#fp_calculator_area .tool_box hr,
#fp_calculator_area .loan_tool_box hr {
  margin-top: 8px;
  margin-bottom: 8px;
  border: none;
  border-top: 1px dashed #ddd;
}

/* 説明セクション（ボタン下の解説） */
.fp_calculator_box .tool_box ~ b,
.fp_calculator_box .tool_box ~ br,
.fp_calculator_box .loan_tool_box ~ b,
.fp_calculator_box .loan_tool_box ~ br {
  font-size: 13px;
  color: #666;
}
.fp_calculator_box .tool_box ~ hr,
.fp_calculator_box .loan_tool_box ~ hr {
  margin-top: 6px;
  margin-bottom: 6px;
  border: none;
  border-top: 1px dotted #e0e0e0;
}

/* スクロールバーのスタイリング */
#fp_calculator_area::-webkit-scrollbar {
  width: 5px;
}
#fp_calculator_area::-webkit-scrollbar-track {
  background: transparent;
}
#fp_calculator_area::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
#fp_calculator_area::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

.securities_master canvas {
  width: 375px!important;
  height: 375px!important;
}
