body {
    background-color: var(--bg-color);
    color: var(--text-color);
}

.input-group {
    text-align: left;
    margin-bottom: 15px;
}

.input-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.input-group input {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.15);
}

/* 슬라이더 스타일 */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: var(--input-border);
    outline: none;
    margin: 15px 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: background 0.3s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--primary-color);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    transition: background 0.3s;
}

.input-group small {
    font-size: 0.8rem;
    color: #888;
}

button {
    width: 100%;
    margin-top: 10px;
}

.secondary-btn {
    background-color: #666;
    margin-top: 10px;
}

.result-area {
    margin-top: 20px;
    text-align: left;
}

/* 결과 섹션 그룹 */
.result-section {
    background: var(--input-bg, #f5f5f5);
    border: 1.5px solid var(--input-border, #ddd);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 10px;
}

.result-section-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888;
    margin-bottom: 8px;
}

.result-section-summary {
    border-color: var(--primary-color, #1976d2);
    background: rgba(25, 118, 210, 0.06);
}

.result-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.result-item:last-child {
    margin-bottom: 0;
}

.result-item.gross {
    font-weight: 600;
    color: var(--text-color);
}

.deduction {
    color: #e57373;
}

[data-theme="dark"] .deduction {
    color: #ff8a80;
}

.total {
    font-weight: bold;
}

.final {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid var(--input-border, #ddd);
}

hr {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 15px 0;
}

/* ===== 메뉴 그리드 ===== */
.menu-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 1rem;
}

.menu-box {
    background: var(--input-bg, #f5f5f5);
    border: 1.5px solid var(--input-border, #ddd);
    border-radius: 12px;
    padding: 4px 8px;
    transition: border-color 0.2s;
}

.menu-box:hover {
    border-color: var(--primary-color, #1976d2);
}

.menu-box button {
    background: transparent;
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 600;
    text-align: left;
    padding: 10px 4px;
    margin: 0;
    box-shadow: none;
}

.menu-box button:hover {
    background: transparent;
    color: var(--primary-color, #1976d2);
}

/* ===== 전세 vs 월세 ===== */
.rent-desc {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 1.2rem;
}

.rent-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.rent-col {
    background: var(--input-bg, #f5f5f5);
    border: 1.5px solid var(--input-border, #ddd);
    border-radius: 10px;
    padding: 1rem;
}

.rent-col h3 {
    margin: 0 0 0.8rem;
    font-size: 1rem;
    color: var(--primary-color, #1976d2);
}

.rent-result {
    margin-top: 1rem;
}

.rent-result-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.rent-result-box {
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.jeonse-box {
    background: rgba(25, 118, 210, 0.08);
    border: 1.5px solid rgba(25, 118, 210, 0.3);
}

.wolse-box {
    background: rgba(76, 175, 80, 0.08);
    border: 1.5px solid rgba(76, 175, 80, 0.3);
}

.rent-result-title {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.4rem;
}

.rent-result-main {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color, #1976d2);
    margin-bottom: 0.5rem;
}

.rent-result-detail {
    font-size: 0.78rem;
    color: #888;
    line-height: 1.6;
}

.rent-verdict {
    text-align: center;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    margin: 0.5rem 0;
}

.rent-verdict.jeonse-win { background: rgba(25,118,210,0.1); color: #1565c0; }
.rent-verdict.wolse-win  { background: rgba(76,175,80,0.1);  color: #2e7d32; }
.rent-verdict.neutral    { background: rgba(120,120,120,0.1); color: #555; }

.rent-note {
    font-size: 0.78rem;
    color: #aaa;
    margin-top: 0.8rem;
    text-align: center;
}

@media (max-width: 480px) {
    .rent-columns, .rent-result-cols { grid-template-columns: 1fr; }
}

/* ===== 전세대출 상환 계산기 ===== */
.loan-type-group {
    display: flex; flex-direction: column; gap: 8px; margin-top: 6px;
}
.loan-radio {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.92rem; cursor: pointer; color: var(--text-color);
    line-height: 1;
}
.loan-radio input[type="radio"] {
    flex-shrink: 0;
    width: 16px; height: 16px;
    margin: 0;
    accent-color: var(--accent-color);
    cursor: pointer;
}
.loan-radio small { color: #888; font-size: 0.78rem; margin-left: 2px; }

.loan-summary {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin: 1rem 0;
}
.loan-summary-item {
    background: var(--input-bg, #f5f5f5);
    border: 1.5px solid var(--input-border, #ddd);
    border-radius: 10px; padding: 0.8rem 1rem;
    display: flex; flex-direction: column; gap: 4px;
}
.loan-summary-item.highlight {
    border-color: var(--primary-color, #1976d2);
    background: rgba(25,118,210,0.06);
}
.loan-summary-label { font-size: 0.78rem; color: #888; }
.loan-summary-val { font-size: 1.1rem; font-weight: 700; color: var(--text-color); }
.loan-summary-val.red { color: #e53935; }
.loan-summary-val.blue { color: var(--primary-color, #1976d2); }

.schedule-toggle-row { text-align: center; margin: 0.5rem 0; }
.schedule-toggle-btn { width: auto !important; padding: 0.5rem 1.4rem; font-size: 0.88rem; }

.schedule-table {
    width: 100%; border-collapse: collapse; font-size: 0.82rem; margin-top: 0.8rem;
    overflow-x: auto; display: block;
}
.schedule-table th, .schedule-table td {
    padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--input-border, #eee);
    white-space: nowrap;
}
.schedule-table th { background: var(--input-bg, #f5f5f5); font-weight: 600; text-align: center; }
.schedule-table td:first-child { text-align: center; }
.schedule-table tr:last-child td { font-weight: 700; color: var(--primary-color, #1976d2); }

.compare-table td, .compare-table th { text-align: center; }
.compare-table tr.compare-selected td {
    background: rgba(25,118,210,0.08);
    font-weight: 600;
}

@media (max-width: 480px) {
    .loan-summary { grid-template-columns: 1fr; }
}
