/* --- カラーパレット定義 --- */
:root {
    /* Primary & Accent */
    --color-primary-main: #1abc9c; /* ブライトミントグリーン (Headerタイトル等) */
    --color-primary-dark: #16a085; 
    --color-primary-light: #e8f8f5; 
    
    /* Neutral */
    --color-neutral-darkblue: #34495e; 
    --color-text-dark: #333333; 
    --color-text-medium: #555555; /* ミドルグレー */
    --color-text-light: #7f8c8d; /* ライトグレー */
    --color-border: #dddddd; 
    --color-background-light: #f4f4f4; 
    --color-white: #ffffff; 

    /* Semantic */
    --color-error: #e74c3c; 

    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; 
    --border-radius-base: 6px;
    --box-shadow-base: 0 4px 15px rgba(0, 0, 0, 0.1); 
    --spacing-unit: 16px;
    --max-content-width: 600px; 
}

/* --- リセットと基本設定 --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--color-background-light);
    color: var(--color-text-dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column; 
    align-items: center; 
    margin: 0;
    padding: 0;
}

/* ---------------------------------------------------------------------- */
/* --- Header Style --- */
/* ---------------------------------------------------------------------- */
.site-header {
    width: 100%;
    background-color: var(--color-white);
    color: var(--color-text-dark);
    padding-top: 15px;
    padding-bottom: 15px; 
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); 
    position: sticky;
    top: 0;
    z-index: 100; 
}
.header-content {
    width: 95%;
    max-width: var(--max-content-width); 
    margin: 0 auto;
    padding: 0 10px;
}
.site-header h1 {
    margin: 0;
    font-size: 1.8em;
    color: var(--color-primary-main);
}
.site-header .subtitle {
    color: var(--color-text-light);
    margin: 0;
    font-size: 1em;
}

/* ---------------------------------------------------------------------- */
/* --- Breadcrumbs Style --- */
/* ---------------------------------------------------------------------- */
/* 修正: カード内に移動したため、背景色や余白を調整 */
.breadcrumbs {
    width: 100%;
    background-color: transparent; /* カード内なので透過 */
    padding: 15px 25px 0; /* カードのパディングに合わせる */
    margin-bottom: -10px; /* タイトルとの距離調整 */
}
.breadcrumb-content {
    width: 100%;
    margin: 0;
    padding: 0;
    font-size: 0.85em; 
    color: var(--color-text-medium); 
}
.breadcrumb-content a {
    color: var(--color-text-medium);
    text-decoration: underline;
    text-decoration-color: var(--color-border);
}
.breadcrumb-content a:hover {
    color: var(--color-primary-main);
}
.breadcrumb-content .separator {
    margin: 0 8px;
    font-size: 0.8em;
    color: var(--color-text-light);
}
.breadcrumb-content .current {
    color: var(--color-text-light); /* 現在地は少し薄く */
    font-weight: normal;
}


/* ---------------------------------------------------------------------- */
/* --- Page Wrapper / Main Container --- */
/* ---------------------------------------------------------------------- */
.page-wrapper {
    flex-grow: 1; 
    width: 100%;
    display: flex;
    justify-content: center;
    padding-top: 20px; 
    padding-bottom: 25px; 
}

.main-container {
    max-width: var(--max-content-width);
    width: 95%;
    padding: 0; 
    margin: 0; 
}

/* ---------------------------------------------------------------------- */
/* --- Single Block Wrapper --- */
/* ---------------------------------------------------------------------- */
.single-block-wrapper {
    background-color: var(--color-white);
    border-radius: var(--border-radius-base);
    box-shadow: var(--box-shadow-base);
    width: 100%;
    overflow: hidden; /* 角丸を維持 */
}

/* ---------------------------------------------------------------------- */
/* --- Section Block Styles --- */
/* ---------------------------------------------------------------------- */
.section-block {
    padding: 20px 25px;
}

.calculation-block,
.results-block,
.notes-block {
    border-bottom: 1px solid var(--color-border);
}

.main-content {
    padding: 0;
}

/* ---------------------------------------------------------------------- */
/* --- Block Titles --- */
/* ---------------------------------------------------------------------- */
h2 { 
    font-size: 1.5em; 
    color: var(--color-neutral-darkblue); 
    border-left: 5px solid var(--color-primary-dark);
    padding-left: 10px; 
    margin: 20px 0 15px; 
}
.block-title { 
    font-size: 1.5em;
    color: var(--color-text-dark);
    margin-bottom: 20px;
    text-align: left; 
    position: relative;
    padding-left: 10px;
}
.block-title::after {
    content: none; 
}
.calculation-block .block-title,
.results-block .block-title,
.notes-block .block-title { 
    border-left: 5px solid var(--color-primary-dark); 
}

/* ---------------------------------------------------------------------- */
/* --- Forms --- */
/* ---------------------------------------------------------------------- */
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; color: var(--color-text-medium); font-size: 0.95rem; }
.form-input, .form-select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--border-radius-base); font-size: 1rem; color: var(--color-text-dark); background-color: var(--color-white); transition: border-color 0.2s, box-shadow 0.2s; -webkit-appearance: none; appearance: none;
}
.form-select {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2316a085%22%20d%3D%22M287%20197.973L146.2%2057.173L5.4%20197.973H287z%22%2F%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat; background-position: right 12px center; background-size: 10px; padding-right: 35px;
}
.form-input:focus, .form-select:focus {
    border-color: var(--color-primary-main); box-shadow: 0 0 0 2px var(--color-primary-light); outline: none;
}
.slider-wrapper {
    display: flex; align-items: center; gap: 12px; background-color: var(--color-background-light); border-radius: var(--border-radius-base); padding: 8px 15px; border: 1px solid var(--color-border);
}
.range-slider {
    flex-grow: 1; -webkit-appearance: none; appearance: none; height: 4px; background: var(--color-border); border-radius: 2px;
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none; width: 18px; height: 18px; background: var(--color-primary-dark); border-radius: 50%; border: 3px solid var(--color-white); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); margin-top: -7px; cursor: grab;
}
.range-slider::-moz-range-thumb {
    width: 18px; height: 18px; background: var(--color-primary-dark); border-radius: 50%; border: 3px solid var(--color-white); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); cursor: grab;
}
.slider-value {
    font-size: 1.4em; font-weight: bold; color: var(--color-primary-dark); min-width: 50px; text-align: right;
}

/* ---------------------------------------------------------------------- */
/* --- Results --- */
/* ---------------------------------------------------------------------- */
.results-block { background-color: var(--color-primary-light); }
.results-block .block-title { color: var(--color-primary-dark); }
.result-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; font-size: 1.05em; color: var(--color-text-dark); }
.result-item:not(.total-row) { border-bottom: 1px dashed rgba(22, 160, 133, 0.3); }
.result-label { font-weight: 500; color: var(--color-text-medium); }
.result-value { font-weight: bold; font-size: 1.2em; color: var(--color-primary-dark); }
.total-row .result-label { color: var(--color-text-dark); font-weight: 600; }
.total-row .result-value { font-size: 1.5em; color: var(--color-primary-dark); font-weight: 700; }

/* ---------------------------------------------------------------------- */
/* --- Notes --- */
/* ---------------------------------------------------------------------- */
.cultural-notes {
    font-size: 0.9rem; color: var(--color-text-medium); line-height: 1.6; padding: 12px; background-color: var(--color-background-light); border-left: 4px solid var(--color-primary-main); border-radius: var(--border-radius-base);
}
.cultural-notes strong { color: var(--color-text-dark); }

/* ---------------------------------------------------------------------- */
/* --- Usage Notes (New Section) --- */
/* ---------------------------------------------------------------------- */
.usage-notes-block {
    background-color: var(--color-white);
    padding: 20px 25px 25px; /* 下部余白を少し多めに */
}
.usage-notes-title {
    font-size: 1rem;
    font-weight: bold;
    color: var(--color-neutral-darkblue);
    margin-bottom: 10px;
}
.usage-notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.usage-notes-list li {
    font-size: 0.8em;
    color: var(--color-text-light); /* アッシュグレー/ライトグレー系 */
    line-height: 1.6;
    margin-bottom: 6px;
    padding-left: 10px;
    position: relative;
}
/* 中黒(・)の代わりの装飾 */
.usage-notes-list li::before {
    content: "・";
    position: absolute;
    left: 0;
    top: 0;
}

/* ---------------------------------------------------------------------- */
/* --- Footer Style --- */
/* ---------------------------------------------------------------------- */
.page-footer {
    width: 100%;
    background-color: var(--color-neutral-darkblue); 
    color: #ddd;
    padding: 30px 0 20px; 
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
    margin-top: auto; 
}

.footer-content {
    max-width: var(--max-content-width);
    width: 95%;
    margin: 0 auto; 
    padding: 0 10px;
}

/* フッターリンクを横並びにするラッパー */
.footer-links-wrapper {
    display: flex;
    justify-content: flex-start;
    gap: 40px; /* セクション間の間隔 */
    margin-bottom: 20px;
}

.footer-section {
    border-bottom: none; /* 従来のボーダーを削除 */
    margin-bottom: 0;
    padding-bottom: 0;
}

.footer-section .section-title {
    font-size: 1em;
    font-weight: bold;
    color: var(--color-primary-main); 
    margin-bottom: 10px;
}
.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-section li {
    margin-bottom: 5px;
}
.footer-section li a {
    color: #ccc;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s;
}
.footer-section li a:hover {
    color: var(--color-white);
    text-decoration: underline;
}

/* コピーライト */
.copyright {
    text-align: center;
    font-size: 0.8em;
    color: #95a5a6;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #556c80;
}

/* ---------------------------------------------------------------------- */
/* --- Responsive adjustments --- */
/* ---------------------------------------------------------------------- */
@media (max-width: 600px) {
    .page-wrapper {
        padding: 15px 0;
    }
    .site-header {
        padding: 10px 0;
    }
    .header-content {
        padding: 0 15px;
    }
    .site-header h1 {
        font-size: 1.6em;
    }
    .site-header .subtitle {
        font-size: 0.9em;
    }
    .breadcrumbs {
        padding: 15px 20px 0; /* モバイルでの余白調整 */
    }
    .section-block {
        padding: 15px 20px;
    }
    .block-title {
        font-size: 1.2rem;
    }
    .form-input, .form-select {
        padding: 8px 10px;
        font-size: 0.9rem;
    }
    .total-row .result-value {
        font-size: 1.4em;
    }
    .page-footer {
        padding: 20px 0;
    }
    /* モバイルではフッターリンクを縦並びに戻すか、狭い間隔にする */
    /* ここではスペースがあれば横並び、なければ折り返す設定にします */
    .footer-links-wrapper {
        flex-direction: column;
        gap: 20px;
    }
}