/* ==========================================
   1. Base Block Layout (専用ブロックレイアウト)
   ========================================= */
.finance-block {
  background-color: #FFFFFF;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.05);
  border: 1px solid #E2E8F0; 
  display: flex;
  flex-direction: column;
  align-items: flex-start; 
  width: 100%;
}

.finance-block h3 {
  font-size: 1.15rem;
  color: #1E293B;
  margin-bottom: 8px;
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%; 
  text-align: left;
}

.field-desc {
  font-size: 0.88rem;
  color: #40546A;
  margin-bottom: 16px;
  line-height: 1.4;
  text-align: left;
  width: 100%;
}

/* Daftar contoh item (pengganti jarak yang dulu dibuat pakai <br>) */
.field-desc-list {
  margin: 0 0 16px 0;
  padding-left: 20px;
  font-size: 0.88rem;
  color: #40546A;
  line-height: 1.6;
  width: 100%;
}

/* Catatan/info box (pengganti jarak yang dulu dibuat pakai <br>) */
.field-note {
  position: relative;
  background-color: #F8FAFC;
  border-left: 4px solid #CBD5E1;
  padding: 12px 14px 12px 34px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.6;
  width: 100%;
  box-sizing: border-box;
}

.field-note i {
  position: absolute;
  left: 14px;
  top: 13px;
  color: #64748B;
}

/* ==========================================
   2. Input Group Extend (専用コンテナ)
   ========================================== */
.list-container {
  width: 100%;
}

/* ==========================================
   3. Row Containers (動的な入力行の余白・通貨単位設定)
   ========================================== */
.dynamic-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 12px;
  width: 100%;
  max-width: 600px; 
}

/* インドネシア・ルピア(Rp)などの単位テキスト */
.rp-text, 
.unit-text {
  font-weight: bold;
  color: #40546A;
  white-space: nowrap;
}

.finance-block .input-group input[type="text"],
.finance-block .input-group input[type="number"] {
  background-color: #FFFFFF;
  border-color: #718696;
}

.finance-block .input-group input::placeholder {
  color: #526579;
  opacity: 1;
}


/* ==========================================
   4. Summary Rows & Result Area (計算シミュレーション・結果表示)
   ========================================== */
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px dashed #E2E8F0;
  font-weight: 700;
  color: #334155;
  width: 100%;
  max-width: 600px; 
}

.calc-value {
  font-size: 1.15rem;
  color: #1E293B;
}

.calculation-summary-box {
  width: 100%;
  max-width: 600px;
  background-color: #FFFFFF;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #CBD5E1;
  margin-bottom: 24px;
  box-sizing: border-box;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 4px;
  font-size: 0.95rem;
  color: #334155;
}

.calculation-section + .calculation-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid #E2EBE6;
}

.calculation-section-title {
  margin: 0 0 10px;
  color: #172B26;
  font-size: 0.95rem;
  font-weight: 700;
}

.calculation-row,
.monthly-balance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 40px;
  padding: 8px 4px;
  color: #475569;
  font-size: 0.9rem;
}

.calculation-row strong,
.monthly-balance-row strong,
.adjustment-row strong,
.equation-factor strong,
.equation-result strong {
  color: #172B26;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.monthly-balance-row {
  margin-top: 6px;
  padding: 12px;
  border-radius: 8px;
  background: #F3F8F4;
  color: #00552F;
  font-weight: 700;
}

.monthly-balance-row strong {
  color: #00552F;
  font-size: 1.05rem;
}

.calculation-section-desc {
  margin: -4px 0 12px;
  color: #64746C;
  font-size: 0.85rem;
  line-height: 1.5;
}

.projection-equation {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24px minmax(0, 0.7fr) 24px minmax(0, 1.1fr);
  align-items: stretch;
  gap: 8px;
}

.equation-factor,
.equation-result {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #E2EBE6;
  border-radius: 8px;
  background: #F8FAFC;
}

.equation-factor span,
.equation-result span {
  color: #64746C;
  font-size: 0.78rem;
  line-height: 1.35;
}

.equation-factor strong,
.equation-result strong {
  text-align: left;
  overflow-wrap: anywhere;
}

.equation-operator {
  display: grid;
  place-items: center;
  color: #64746C;
  font-size: 1.1rem;
  font-weight: 600;
}

.equation-result {
  border-color: #B7D5C3;
  background: #EFF7E8;
}

.equation-result strong {
  color: #00552F;
}

.capital-adjustments {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.adjustment-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #F8FAFC;
  color: #475569;
  font-size: 0.87rem;
}

.adjustment-type {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
}

.adjustment-add {
  background: #EFF7E8;
  color: #00552F;
}

.adjustment-subtract {
  background: #FCEDEC;
  color: #A33A34;
}

.summary-total-divider {
  border: none;
  border-top: 1px solid #CBD5E1;
  margin: 16px 0 12px;
}

.total-final-line {
  font-size: 1.05rem;
  font-weight: 600;
  color: #172B26;
  background-color: #F3F8F4;
  border-left: 3px solid #8CC63E;
  border-radius: 6px;
  padding: 12px 14px;
}

#total-modal-bisnis {
  font-size: 1.2rem;
  color: #1F7737;
  font-weight: 700;
}

/* ==========================================
   5. Chart Layout (グラフ表示エリア)
   ========================================== */
.chart-visualization {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  align-items: center;
  gap: 28px;
  width: 100%;
  max-width: 760px;
  margin: 12px 0 0;
}

.chart-container {
  width: 100%;
  max-width: 280px;
  height: 260px;
  margin: 0 auto;
  position: relative;
}

.chart-heading {
  width: 100%;
  max-width: 760px;
  margin-top: 8px;
}

.chart-heading h4 {
  margin: 0 0 4px;
  color: #172B26;
  font-size: 1rem;
}

.chart-heading p,
.chart-note {
  color: #64746C;
  font-size: 0.85rem;
  line-height: 1.55;
}

.chart-legend {
  display: grid;
  gap: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chart-legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #E8EEE9;
  color: #334155;
  font-size: 0.9rem;
  line-height: 1.4;
}

.chart-legend li:last-child {
  border-bottom: 0;
}

.chart-legend-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.chart-legend-swatch {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.chart-legend-value {
  flex: 0 0 auto;
  color: #172B26;
  font-weight: 700;
  text-align: right;
}

.chart-legend-total {
  margin-bottom: 4px;
  border-bottom: 2px solid #CBD5E1 !important;
  color: #172B26 !important;
  font-weight: 700;
}

.chart-note {
  width: 100%;
  max-width: 760px;
  margin: 0 0 20px;
  padding: 10px 12px;
  background: #F3F8F4;
  border-left: 3px solid #8CC63E;
  border-radius: 0 8px 8px 0;
}

.chart-empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 24px;
  color: #64746C;
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: center;
}

.chart-empty-state[hidden],
.chart-container canvas[hidden] {
  display: none;
}

@media (max-width: 480px) {
  .chart-visualization {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .chart-container {
    height: 260px;
  }

  .chart-legend li {
    font-size: 0.85rem;
  }

  .chart-note {
    font-size: 0.8rem;
  }

  .total-final-line {
    font-size: 0.95rem;
  }

  #total-modal-bisnis {
    font-size: 1.05rem;
  }

  .projection-equation {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  .equation-factor,
  .equation-result {
    gap: 5px;
    padding: 10px 12px;
  }

  .equation-operator {
    min-height: 18px;
    font-size: 0.95rem;
  }

  .adjustment-row {
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 7px;
    padding: 8px;
    font-size: 0.8rem;
  }

  .adjustment-row strong {
    font-size: 0.83rem;
  }
}