/* General Body and Container */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column; 
    align-items: center; 
    min-height: 100vh;
    margin: 0;
    padding: 0; 
}

/* Header */
.site-header {
    width: 100%;
    background-color: #ffffff;
    color: #333333; 
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 
    z-index: 100; 
}
.header-content {
    width: 95%;
    max-width: 800px;
    margin: 0 auto;
}
.site-header h1 {
    margin: 0;
    font-size: 1.6em;
    color: #1abc9c;
}
.site-header .subtitle {
    color: #7f8c8d;
    margin: 0;
    font-size: 0.9em;
}
.beta-tag {
    font-size: 0.6em;
    color: #e74c3c;
    vertical-align: top;
    font-weight: bold;
    margin-left: 5px;
}

/* Breadcrumbs (Updated for Container placement) */
.breadcrumbs {
    width: 100%;
    /* Container内配置用に背景色とborderを調整 */
    background-color: transparent;
    border-bottom: none;
    padding: 0 0 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee; /* 薄い区切り線を追加 */
}
/* Container内のため .breadcrumbs-content のラッパーとしての幅制限は不要だが、
   リスト自体のスタイルは維持 */
.breadcrumbs ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    font-size: 0.85em;
}
.breadcrumbs li {
    display: flex;
    align-items: center;
}
.breadcrumbs a {
    color: #7f8c8d;
    text-decoration: none;
    transition: color 0.2s;
}
.breadcrumbs a:hover {
    color: #1abc9c;
    text-decoration: underline;
}
.breadcrumbs .separator {
    margin: 0 8px;
    color: #7f8c8d;
    font-size: 0.8em;
}
.breadcrumbs .current-page {
    color: #7f8c8d; 
    font-size: 0.9em;
    cursor: default;
}

/* Main Container */
.container {
    background-color: #fff;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); 
    width: 95%;
    max-width: 800px; 
    margin: 20px auto 30px auto; 
    box-sizing: border-box;
}

/* Controls & Inputs */
.controls-wrapper {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 5px solid #16a085;
}
.controls-wrapper h2 {
    margin-top: 0;
    font-size: 1.3em;
    color: #2c3e50;
    border: none;
    padding: 0;
}
.notice {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-bottom: 10px;
}
.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    color: #fff;
    vertical-align: middle;
}
.badge.required { background-color: #e74c3c; }
.badge.base { background-color: #16a085; }

.input-group label {
    display: block;
    font-weight: bold;
    color: #555;
    margin-bottom: 5px;
}
.input-group input {
    padding: 10px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 5px;
    width: 100%;
    max-width: 200px;
    box-sizing: border-box;
}
.input-help {
    font-size: 0.8em;
    color: #95a5a6;
    margin-top: 5px;
}

/* Property Cards */
#properties-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}
.property-card {
    flex: 1;
    min-width: 280px;
    background-color: #fff;
    border: 1px solid #e8f8f5;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    position: relative;
    transition: transform 0.2s;
}
.property-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.card-header {
    background-color: #e8f8f5;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #1abc9c;
}
.card-header h3 {
    margin: 0;
    font-size: 1.1em;
    color: #2c3e50;
}
.delete-btn {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 1.5em;
    cursor: pointer;
    line-height: 1;
}

.card-body {
    padding: 15px;
}
.input-row {
    margin-bottom: 12px;
}
.input-row label {
    display: block;
    font-size: 0.9em;
    color: #555;
    margin-bottom: 4px;
}
.input-with-unit {
    display: flex;
    align-items: center;
    gap: 5px;
}
.input-with-unit input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: right;
    font-size: 1em;
}
.input-with-unit span {
    color: #7f8c8d;
    font-size: 0.9em;
    width: 2em;
}

.toggle-row {
    margin-top: 5px;
    margin-bottom: 5px;
}
.toggle-label {
    font-size: 0.85em;
    cursor: pointer;
    color: #34495e;
    display: flex;
    align-items: center;
    gap: 5px;
}
.cost-input-area {
    background-color: #fcfcfc;
    padding: 10px;
    border-radius: 5px;
    border: 1px dashed #ddd;
    margin-top: 5px;
    animation: fadeIn 0.3s ease;
}
.hidden { display: none; }

/* Buttons */
.action-area {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.main-btn, .sub-btn {
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
}
.main-btn { background-color: #1abc9c; color: #fff; }
.main-btn:hover { background-color: #16a085; }
.sub-btn { background-color: #34495e; color: #fff; }
.sub-btn:hover { background-color: #2c3e50; }
.sub-btn:disabled { background-color: #95a5a6; cursor: not-allowed; }

/* Result Area */
.result-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 3px solid #1abc9c;
}
.result-container h2 {
    color: #2c3e50;
    border-left: 6px solid #16a085;
    padding-left: 10px;
    margin-bottom: 20px;
}

.verdict-box {
    background-color: #e8f8f5;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #1abc9c;
}
.verdict-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #1abc9c;
}
.verdict-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.verdict-title {
    font-weight: bold;
    font-size: 1.1em;
    color: #2c3e50;
    margin-bottom: 5px;
}
.verdict-detail {
    font-size: 0.95em;
    color: #555;
    line-height: 1.5;
}
.highlight-good { color: #16a085; font-weight: bold; }
.highlight-bad { color: #e74c3c; font-weight: bold; }
.best-choice-badge {
    background-color: #f1c40f; 
    color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 5px;
    font-size: 0.9em;
}

/* Comparison Tables */
.table-wrapper, .scroll-table-wrapper {
    overflow-x: auto;
    margin-bottom: 30px;
    border-radius: 5px;
    border: 1px solid #ddd;
}
.scroll-table-wrapper {
    max-height: 400px; 
    overflow-y: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}
th, td {
    padding: 12px 10px;
    text-align: center;
    border-bottom: 1px solid #ddd;
    font-size: 0.9em;
}
th {
    background-color: #34495e;
    color: #fff;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}
tr:nth-child(even) { background-color: #f9f9f9; }
.money-cell { font-family: monospace; font-size: 1.1em; }

/* 単位補助表示（日換算など） */
.unit-sub {
    font-size: 0.8em;
    color: #7f8c8d;
    display: block; /* 改行させる */
    margin-top: 2px;
}

.total-row { 
    font-weight: bold; 
    background-color: #e8f8f5 !important; 
    border-top: 2px solid #16a085;
}
.subtotal-row {
    font-weight: bold;
    background-color: #fff9c4 !important; /* 淡い黄色 */
    color: #555;
    border-top: 1px solid #ddd;
}

/* Chart Controls */
.chart-controls-container {
    background-color: #fdfdfd;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 5px;
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}
.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.control-label {
    font-size: 0.8em;
    font-weight: bold;
    color: #7f8c8d;
}
.radio-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}
.radio-label {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    background-color: #f1f2f6;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    border: 1px solid #ddd;
    transition: background-color 0.2s;
}
.radio-label:hover {
    background-color: #e2e6ea;
}
.radio-label input[type="radio"] {
    accent-color: #1abc9c;
}

/* Chart Wrapper */
.chart-wrapper {
    position: relative;
    width: 100%;
    height: 400px; 
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    box-sizing: border-box;
}

/* Usage Notes Section (New) */
.usage-notes {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #ddd;
}
.usage-notes h3 {
    font-size: 1.1em;
    color: #2c3e50;
    margin-bottom: 15px;
    margin-top: 0;
}
.usage-notes ul {
    list-style-type: disc;
    padding-left: 20px;
    color: #555;
    font-size: 0.85em;
    line-height: 1.7;
}
.usage-notes li {
    margin-bottom: 8px;
}


/* Footer (Updated for Flex Layout) */
.page-footer {
    width: 100%;
    background-color: #34495e;
    color: #ddd;
    padding: 40px 0 20px 0;
    margin-top: auto; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
.footer-content {
    max-width: 800px;
    width: 95%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}
/* New Wrapper for Columns */
.footer-columns {
    display: flex;
    flex-direction: column;
    gap: 20px;
    border-bottom: 1px solid #556c80;
    padding-bottom: 25px;
}

.footer-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 400;
    letter-spacing: 0.05em;
    transition: color 0.3s;
    display: inline-block;
}
.footer-link:hover {
    color: #1abc9c;
    text-decoration: underline;
}

.page-footer .section-title {
    font-size: 1.1em;
    font-weight: bold;
    color: #1abc9c; 
    margin-bottom: 12px;
    margin-top: 0;
}
.copyright {
    text-align: center;
    font-size: 0.8em;
    color: #95a5a6;
    margin: 0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 600px) {
    .action-area {
        flex-direction: row;
    }
    .chart-controls-container {
        flex-direction: row;
        align-items: center;
    }
    .control-group {
        flex-direction: row;
        align-items: center;
    }
    .control-label {
        margin-right: 5px;
    }
    /* Footer columns adjustment for larger screens */
    .footer-columns {
        flex-direction: row;
        gap: 60px; /* Space between columns */
    }
}