
/* ページ全体 */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: sans-serif;
    background-color: #f4f6fa;
    color: #333;
}

/* ヘッダー */
header {
    background-color: #2563eb;
    color: white;
    text-align: center;
    padding: 35px 20px;
}

header h1 {
    margin: 0;
    font-size: 30px;
}

header p {
    margin-bottom: 0;
}

/* メイン部分 */
main {
    width: 90%;
    max-width: 700px;
    margin: 30px auto;
}

/* 紹介部分 */
.welcome {
    text-align: center;
    margin-bottom: 30px;
}

/* 計算ツール */
.tool {
    background-color: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
}

.tool h2 {
    margin-top: 0;
    color: #2563eb;
}

label {
    display: block;
    margin-top: 18px;
    margin-bottom: 7px;
    font-weight: bold;
}

input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}

button {
    width: 100%;
    margin-top: 25px;
    padding: 14px;
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

button:hover {
    background-color: #1d4ed8;
}

/* 計算結果 */
#result {
    margin-top: 20px;
    padding: 15px;
    background-color: #eff6ff;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
}

/* フッター */
footer {
    text-align: center;
    padding: 25px;
    color: #777;
    font-size: 14px;
}

/* スマートフォン対応 */
@media (max-width: 600px) {
    header h1 {
        font-size: 25px;
    }

    .tool {
        padding: 18px;
    }
}

/* セレクトボックス */
select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    background-color: white;
}

/* 計算結果のデザイン */
.tool p[id$="Result"],
.tool p[id="result"] {
    margin-top: 20px;
    padding: 18px;
    background: #eef4ff;
    border: 1px solid #c9dcff;
    border-radius: 12px;
    color: #1746a2;
    font-size: 17px;
    font-weight: bold;
    line-height: 1.8;
    text-align: center;
    overflow-wrap: anywhere;
}

/* 結果が空でないとき */
.tool p[id$="Result"]:not(:empty),
.tool p[id="result"]:not(:empty) {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tax-result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.tax-result-grid div,
.tax-total {
    background: #ffffff;
    padding: 16px;
    border-radius: 10px;
}

.tax-result-grid small,
.tax-total small {
    display: block;
    color: #64748b;
    margin-bottom: 8px;
}

.tax-result-grid strong {
    font-size: 20px;
    color: #1746a2;
}

.tax-total {
    background: #eaf2ff;
    text-align: center;
}

.tax-total strong {
    display: block;
    font-size: 28px;
    color: #1746a2;
}

#taxReset {
    background-color: #e2e8f0;
    color: #334155;
    margin-top: 10px;
}

#taxReset:hover {
    background-color: #cbd5e1;
}

/* 計算ツール一覧 */
.tool-menu {
    margin: 30px 0;
}

.tool-menu h2 {
    text-align: center;
    margin-bottom: 20px;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.menu-grid a {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    background: white;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    text-decoration: none;
    color: #1746a2;
    transition: 0.2s;
}

.menu-grid a:hover {
    background: #eef4ff;
    transform: translateY(-3px);
}

.menu-grid span {
    font-size: 30px;
}

.menu-grid strong {
    font-size: 17px;
}

.menu-grid small {
    color: #64748b;
    font-size: 13px;
}

/* スムーズなスクロール */
html {
    scroll-behavior: smooth;
}

.tool {
    scroll-margin-top: 20px;
}

/* スマホ対応 */
@media (max-width: 480px) {
    .menu-grid {
        grid-template-columns: 1fr;
    }
}

/* 単価比較ツール */
.compare-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.compare-item {
    background-color: #f4f6fa;
    padding: 15px;
    border-radius: 12px;
}

.compare-item h3 {
    margin-top: 0;
    color: #2563eb;
}

@media (max-width: 400px) {
    .compare-grid {
        gap: 8px;
    }

    .compare-item {
        padding: 10px;
    }
}

/* 貯金シミュレーター */
.saving-progress {
    width: 100%;
    height: 14px;
    background-color: #e2e8f0;
    border-radius: 20px;
    overflow: hidden;
    margin: 15px 0;
}

#savingBar {
    width: 0%;
    height: 100%;
    background-color: #2563eb;
    border-radius: 20px;
    transition: width 0.5s ease;
}

/* カテゴリー別ツール一覧 */
.menu-category {
    margin-bottom: 35px;
}

.category-title {
    font-size: 20px;
    color: #1e3a8a;
    border-left: 5px solid #2563eb;
    padding: 10px 14px;
    background-color: #eaf0ff;
    border-radius: 0 8px 8px 0;
    margin-bottom: 15px;
}

.menu-category .menu-grid a {
    height: 100%;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .category-title {
        font-size: 18px;
    }

    .menu-category {
        margin-bottom: 25px;
    }
}

/* 貯金シミュレーターの達成率バー */

.saving-progress {
    width: 100%;
    height: 20px;
    background-color: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 15px;
}

#savingProgressBar {
    width: 0%;
    height: 100%;
    background-color: #2563eb;
    border-radius: 10px;
    transition: width 0.4s ease;
}

#savingProgressText {
    font-weight: bold;
    color: #2563eb;
}

/* 年収計算の内訳グラフ */

.annual-chart {
    display: flex;
    width: 100%;
    height: 25px;
    background-color: #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

#annualSalaryBar {
    width: 0%;
    height: 100%;
    background-color: #2563eb;
    transition: width 0.4s ease;
}

#annualBonusBar {
    width: 0%;
    height: 100%;
    background-color: #93c5fd;
    transition: width 0.4s ease;
}

#annualChartText {
    font-size: 14px;
    text-align: center;
    font-weight: bold;
}

/* トップページの紹介エリア */

.home-intro {
    background-color: white;
    padding: 25px 20px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.home-intro h2 {
    font-size: 23px;
    margin-top: 0;
    color: #1e293b;
}

.home-intro p {
    color: #64748b;
    line-height: 1.8;
}

.home-features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.home-features span {
    color: #2563eb;
    font-size: 13px;
    font-weight: bold;
}

/* トップページのツール一覧 */

.tool-menu .menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.tool-menu .menu-grid .home-tool-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    padding: 18px;
    background-color: white;
    color: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    text-align: left;
    box-sizing: border-box;
    transition: transform 0.2s, box-shadow 0.2s;
}

.tool-menu .menu-grid .home-tool-card:hover {
    transform: translateY(-3px);
    border-color: #2563eb;
    background-color: #f8faff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.12);
}

.tool-icon {
    font-size: 28px;
}

.home-tool-card strong {
    font-size: 16px;
}

.tool-description {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
}

.menu-category {
    margin-bottom: 28px;
}

/* スマートフォン対応 */

@media (max-width: 480px) {

    .tool-menu .menu-grid {
        gap: 10px;
    }

    .tool-menu .menu-grid .home-tool-card {
        padding: 12px;
    }

    .home-tool-card strong {
        font-size: 14px;
    }

    .home-intro h2 {
        font-size: 20px;
    }

    .home-features {
        gap: 10px;
    }

}
/* トップページのカード文字調整 */
.home-tool-card strong {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 6px;
}

.home-tool-card .tool-description {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: #64748b;
    line-height: 1.6;
}

.home-tool-card .tool-icon {
    font-size: 26px;
}
/* カードのデザイン改善 */
.home-tool-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
}

.home-tool-card:hover {
    transform: translateY(-3px);
    border-color: #2563eb;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.12);
}

.home-tool-card .tool-description {
    color: #475569;
    font-size: 14px;
}
/* スマホ表示の最適化 */
@media screen and (max-width: 600px) {

    .menu-category .menu-grid {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 12px;
}

    .home-tool-card {
        padding: 16px;
    }

    .home-tool-card strong {
        font-size: 17px;
    }

    .home-tool-card .tool-description {
        font-size: 14px;
    }

    .home-intro {
        padding: 20px 15px;
    }

    .category-title {
        font-size: 17px;
    }
}
/* フッターのデザイン */
footer {
    text-align: center;
    padding: 25px 15px;
    margin-top: 40px;
    background-color: #f1f5f9;
    color: #64748b;
    font-size: 13px;
    line-height: 2;
}

footer a {
    color: #475569;
    text-decoration: none;
    display: inline-block;
    margin: 4px 6px;
}

footer a:hover {
    color: #2563eb;
    text-decoration: underline;
}
/* 金額のクイック入力ボタン */
.quick-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
    margin-bottom: 16px;
}

.quick-buttons button {
    width: 100%;
    padding: 10px 2px;
    margin: 0;
    font-size: 13px;
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    cursor: pointer;
}

.quick-buttons button:hover {
    background: #dbeafe;
}

.quick-buttons button:last-child {
    background: #f1f5f9;
    color: #64748b;
    border-color: #cbd5e1;
}
.money-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0 16px;
}

.money-buttons button {
    flex: 1;
    width: auto;
    min-width: 65px;
    margin: 0;
    padding: 8px 4px;
    font-size: 13px;
    background: #e8efff;
    color: #2563eb;
    border: 1px solid #c7d7fe;
    border-radius: 6px;
}

.money-buttons button:hover {
    background: #dbeafe;
}