/* src/public/css/calculator/rent_initial_cost.css … 賃貸の初期費用シミュレーター */

.calc-box {
    background: #ffffff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-top: 20px;
}

.ric-section-title {
    margin: 26px 0 12px;
    font-size: 1.1rem;
    color: #1e3c72;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e2e8f0;
}
.calc-box > .ric-section-title:first-child { margin-top: 0; }

.ric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
}
.ric-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.input-group { margin-bottom: 16px; }
.input-group label,
.input-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #1e3c72;
    font-size: 0.92rem;
}
.input-group input[type="text"],
.input-group input[type="date"],
.input-group select {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
    background: #ffffff;
}

/* 数字欄＋単位 */
.ric-unit-field {
    display: flex;
    align-items: center;
    gap: 6px;
}
.ric-unit-field input { flex: 1; min-width: 0; text-align: right; }
.ric-unit-field span {
    flex: 0 0 auto;
    color: #475569;
    font-size: 0.9rem;
    white-space: nowrap;
}
.ric-unit-field-sm input { width: 5em; flex: 0 0 auto; }

.ric-checks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 24px;
    margin-bottom: 6px;
}
.ric-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #334155;
}
.ric-inline label { font-weight: bold; }
.ric-inline select,
.ric-inline input {
    padding: 7px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #ffffff;
}

.check-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    font-weight: bold;
    color: #334155;
    cursor: pointer;
}
.check-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.ric-field-note {
    margin: 4px 0 8px;
    font-size: 0.8rem;
    color: #64748b;
    line-height: 1.55;
}
.ric-field-note-top { margin-top: -4px; }

.ric-guarantee-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 10px;
}

/* そのほかの費用 */
.ric-extra-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.ric-extra-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}
.ric-extra-row input {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    box-sizing: border-box;
}
.ric-extra-remove {
    width: 38px;
    height: 38px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fff5f5;
    color: #dc2626;
    cursor: pointer;
}
.ric-extra-remove:hover { background: #fee2e2; }
.ric-btn-add,
.ric-btn-copy {
    padding: 9px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #f8fafc;
    color: #2a5298;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ric-btn-add:hover,
.ric-btn-copy:hover { background: #e2e8f0; }

/* ボタン群 */
.btn-group {
    display: flex;
    gap: 15px;
    margin: 22px 0 8px;
}
.btn-calc {
    flex: 2;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: bold;
    cursor: pointer;
    background-color: #2a5298;
    color: white;
}
.btn-calc:hover { background-color: #1e3c72; }
.btn-clear-tool {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    background-color: #e9ecef;
    color: #495057;
}
.btn-clear-tool:hover { background-color: #dee2e6; }

.ric-message {
    margin: 0;
    min-height: 1.4em;
    font-size: 0.9rem;
    font-weight: bold;
    color: #b45309;
}

/* 結果 */
.ric-total {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4px;
    padding: 18px 12px;
    border-radius: 8px;
    background-color: #f1f3f5;
    margin-bottom: 16px;
}
.ric-total-label { font-size: 0.9rem; color: #64748b; font-weight: bold; }
.ric-total-val { font-size: 2.1rem; font-weight: bold; color: #2a5298; line-height: 1.25; }
.ric-total-sub { font-size: 0.85rem; color: #475569; }

.ric-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ric-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ric-table th,
.ric-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: middle;
}
.ric-table thead th { background-color: #f1f5f9; color: #1e3c72; font-size: 0.85rem; white-space: nowrap; }
.ric-table tbody th { color: #1e293b; font-weight: bold; }
.ric-table .ric-col-basis { color: #64748b; font-size: 0.82rem; }
.ric-table .ric-num { text-align: right; white-space: nowrap; }
.ric-table .ric-col-amount { font-weight: bold; color: #1e293b; }

.ric-copy-row { margin-top: 12px; display: flex; justify-content: flex-end; }

/* === スマホ・タブレット対応 === */
@media (max-width: 768px) {
    .calc-box { padding: 20px; }
    .ric-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .btn-group { gap: 10px; }
    .btn-calc, .btn-clear-tool { padding: 12px; font-size: 0.95rem; }
    .ric-total-val { font-size: 1.7rem; }
    .ric-table { font-size: 0.85rem; }
    .ric-table th, .ric-table td { padding: 8px 6px; }
}
@media (max-width: 480px) {
    .ric-grid, .ric-grid-3 { grid-template-columns: 1fr; }
    .ric-guarantee-row { grid-template-columns: 1fr; }
    .ric-extra-row { grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) auto; }
}
