/* app.css */
:root { --primary:#16a34a; --primary-color:var(--primary); --primary-ink:#0f172a; }

/* Layout */
.col-4 {
  width: 33.33%;
  padding-right: 15px;
}
.col-8 {
  width: 66.67%;
  padding-left: 15px;
}
.input-group {
  display: flex;
}
.input-group input {
  flex-grow: 1;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-group select {
  flex-shrink: 0;
  width: auto;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 0;
}
#inputs .card {
  margin-bottom: 20px;
}
#inputs h3 {
  font-size: 1rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5em;
  margin-bottom: 1em;
  margin-top: 1.5em;
}
#inputs .form-group {
  margin-bottom: 15px;
}
#inputs .form-group label {
  font-weight: bold;
  font-size: 0.875rem;
  display: block;
  margin-bottom: 5px;
}
#inputs .form-group input,
#inputs .form-group select {
  width: 100%;
}

/* KPI */
.kpi-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}
.kpi {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: #f9f9f9;
}
.kpi .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 5px;
  display: block;
}
.kpi .value {
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--primary-color);
}
.kpi .unit {
  font-size: 0.9rem;
  margin-left: 4px;
  color: var(--text-muted);
}
.kpi .value.negative {
    color: var(--danger-color);
}

/* Property List */
#propertyList .property-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-bottom: 5px;
}
#propertyList .property-item:hover {
    background-color: var(--background-hover-color);
}
#propertyList .property-item.active {
    border-color: var(--primary-color);
    background-color: #eef7ff;
}
#propertyList .property-item button {
    margin-left: 10px;
}

/* Large Scale Repairs */
.repair-item {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}
.repair-item input {
    width: 100px;
}

/* Tables */
#cf-table, #sell-sim-table, #sensitivity-table, #compareTableContainer table {
  font-size: 0.8rem;
}
#cf-table th, #cf-table td,
#sell-sim-table th, #sell-sim-table td,
#sensitivity-table th, #sensitivity-table td,
#compareTableContainer th, #compareTableContainer td {
    text-align: right;
    padding: 6px 8px;
}
#cf-table th:first-child, #cf-table td:first-child,
#compareTableContainer th:first-child, #compareTableContainer td:first-child {
    text-align: center;
    font-weight: bold;
}
#sell-sim-table th, #sensitivity-table th, #compareTableContainer th {
    text-align: left;
    background-color: #f3f4f6;
}
#sell-sim-table td, #sensitivity-table td, #compareTableContainer td {
    text-align: right;
}

.positive { color: var(--ok-color-text); }
.negative { color: var(--ng-color-text); }
.muted-cell { color: var(--text-muted); }

#compareView {
    display: none; /* Initially hidden */
}

/* Print */
@media print {
  .no-print,
  .app-header,
  .col-4,
  #main-results > .card:nth-child(2), /* Graph */
  #main-results > .card:nth-child(5), /* Sensitivity */
  #about-tool,
  .app-footer {
    display: none;
  }
  body {
    background-color: #fff;
  }
  .container, .row, .col-8 {
    width: 100%;
    display: block;
    padding: 0;
    margin: 0;
  }
  .card {
    border: none;
    box-shadow: none;
    page-break-inside: avoid;
  }
  h1,h2,h3 {
      color: #000;
  }
  #cf-table {
      font-size: 7pt;
  }
  #cf-table th, #cf-table td {
      padding: 4px;
  }
}

/* 修正: スマホ幅で年次表とグラフが横にはみ出さないように */
#cfChart { max-width: 100%; height: auto; }
#cf-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
