html {
    overflow-x: hidden;
}

html.font-size-small {
    font-size: 85%;
}

html.font-size-medium {
    font-size: 100%;
}

html.font-size-large {
    font-size: 120%;
}

/* 変数定義... */
:root {

    --bg-color: #f7e7d0;
    /* 驍ｵ�ｺ�ｽ�ｻ驛｢�ｧ髦ｮ蜻ｻ�ｽ蜀暦ｽｸ�ｺ闕ｵ譎｢�ｼ�ｽ驍ｵ�ｺ雋�∞�ｿ�ｽ驛｢譎｢�ｽ�ｼ驛｢�ｧ�ｽ�ｸ驛｢譎｢�ｽ�･鬩堺ｼ夲ｽｽ�ｻ */
    --color-balance: #ffbc6e;
    /* 髯ｷ�ｿ陷ｿ螟懶ｽｫ�ｪ�ｽ�ｽ陞｢�ｹ郢晢ｽｱ驛｢�ｧ�ｽ�ｹ驛｢譎｢�ｿ�ｽ�取刮�ｹ�ｧ�ｽ�ｪ驛｢譎｢�ｽ�ｬ驛｢譎｢�ｽ�ｳ驛｢�ｧ�ｽ�ｸ */
    --color-expense: #f9c0c0;
    /* 髫ｰ�ｾ�ｽ�ｯ髯ｷ�ｽ�ｽ�ｺ�ｽ�ｽ陞｢�ｹ郢晢ｽｱ驛｢�ｧ�ｽ�ｹ驛｢譎｢�ｿ�ｽ�取刮�ｹ譎�ｱ抵ｾ趣ｽｦ驛｢�ｧ�ｽ�ｯ */
    --color-income: #b3dfd1;
    /* 髯ｷ�ｿ闕ｳ�ｻ�ｽ�ｽ�ｽ�ｽ陞｢�ｹ郢晢ｽｱ驛｢�ｧ�ｽ�ｹ驛｢譎｢�ｿ�ｽ�取刮�ｹ�ｧ�ｽ�ｰ驛｢譎｢�ｽ�ｪ驛｢譎｢�ｽ�ｼ驛｢譎｢�ｽ�ｳ */
    --card-bg-sub: #fff9e6;
    /* 驛｢�ｧ�ｽ�ｵ驛｢譎�§邵ｺ蜥ｲ�ｹ譎｢�ｽ�ｼ驛｢譎擾ｽｳ�ｨ�ｽ�ｽ鬨ｾ蜈ｷ�ｽ�ｽ */
    --accent-color: #ffbc6e;
    /* 驛｢�ｧ�ｽ�｢驛｢�ｧ�ｽ�ｯ驛｢�ｧ�ｽ�ｻ驛｢譎｢�ｽ�ｳ驛｢譎∬か�ｽ�ｼ陋ｹ�ｻ邵ｺ讙趣ｽｹ譎｢�ｽ�ｬ驛｢譎｢�ｽ�ｳ驛｢�ｧ�ｽ�ｸ�ｽ�ｽ�ｽ�ｽ */
    --text-color: #7a6a5e;
    /* 髫ｴ貊馴ｱ抵ｿｽ閾･�ｸ�ｺ闕ｵ譎｢�ｼ讓抵ｽｹ譎�§�主ｸｷ�ｹ�ｧ�ｽ�ｦ驛｢譎｢�ｽ�ｳ */
    --nav-active-bg: #ffbc6e;
    --font-family: 'Yomogi',
        cursive;
}

body.no-scroll {
    overflow: hidden;
    height: 100vh;
    width: 100%;
    position: fixed;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-weight: bold;
    overflow-x: hidden;
    overflow-y: auto;
    /* 菫ｮ豁｣: 蜈ｨ菴薙�繧ｹ繧ｯ繝ｭ繝ｼ繝ｫ繧堤┌蜉ｹ蛹� */
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 480px;
    /* 驛｢�ｧ�ｽ�ｹ驛｢譎�ｽｧ�ｭ�ｽ�ｽ驛｢�ｧ�ｽ�ｵ驛｢�ｧ�ｽ�､驛｢�ｧ�ｽ�ｺ髯懈圜�ｽ�ｺ髯橸ｽｳ�ｽ�ｽ */
    min-height: 100vh;
    position: relative;
    padding: 0 20px 20px;
    /* 髣包ｽｳ驕擾ｽｩ�主､ゑｽｸ�ｺ�ｽ�ｮ驛｢譏懶ｽｻ�｣郢晢ｽｧ驛｢�ｧ�ｽ�｣驛｢譎｢�ｽ�ｳ驛｢�ｧ�ｽ�ｰ驛｢�ｧ髮区ｩｸ�ｽ�｢陷会ｽｱ�ｽ�ｽ�ｸ�ｺ陷会ｽｱ遯ｶ�ｻ驛｢譎�ｽｼ譁石暮Δ�ｧ�ｽ�ｿ驛｢譎｢�ｽ�ｼ驍ｵ�ｺ�ｽ�ｨ驍ｵ�ｺ�ｽ�ｮ鬯ｩ�･鬮ｦ�ｪ遶企��ｹ�ｧ驗呻ｽｫ�ｽ蟶晢ｽｫ�ｦ�ｽ�ｲ髮趣ｿｽ�ｽ�｢ */
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 鬮｢�ｭ隴ｴ�ｧ陷搾ｽｹ驍ｵ�ｺ�ｽ�ｮ驛｢譎擾ｽｳ�ｨ郢晢ｽ｣驛｢譎乗ｲｺ雎鯉ｿｽ */
.bg-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: radial-gradient(#d3c4b1 1.5px, transparent 1.5px);
    background-size: 30px 30px;
    opacity: 0.5;
}

header {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 40px;
}

.main-title {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 15px;
    letter-spacing: 0.1em;
}

.date-badge {
    display: inline-flex;
    align-items: center;
    background: #fff9e6;
    padding: 8px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    font-size: 1.1rem;
}

.date-badge .calendar-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    fill: none;
    stroke: var(--text-color);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

main {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 5px;
    /* 髣包ｽｳ闕ｵ譏ｶ�ｽ髣厄ｽｴ陷･荳樣��Δ�ｧ陞ｳ螟ｲ�ｽ�ｿ�ｽ�ｽ髯ｷ莨夲ｽｿ�ｽ */
}

.summary-card {
    background: var(--card-bg-sub);
    border-radius: 30px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    border: 3px solid #fff9e6;
}

.main-balance {
    background-color: var(--color-balance);
    color: var(--text-color);
    padding: 30px 20px;
    border: 4px solid #fff9e6;
    transition: background-color 0.3s ease;
}

.main-balance.is-positive {
    background-color: var(--color-income);
}

.main-balance.is-negative {
    background-color: var(--color-expense);
}

.main-balance .balance-amount {
    color: var(--text-color);
}

#topScreen {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 10px);
    overflow: hidden;
    /* 修正: スクロールを無効化し、1画面に収める */
}

#topScreen .main-balance {
    margin-bottom: 20px;
}

.expense {
    background-color: #fff9e6;
    border: 3px solid var(--color-expense);
    color: var(--text-color);
}

.income {
    background-color: #fff9e6;
    border: 3px solid var(--color-income);
    color: var(--text-color);
}

.summary-card .card-label {
    color: var(--text-color);
    font-size: 1.1rem;
    margin-bottom: 10px;
    opacity: 0.8;
}

.balance-amount {
    font-size: 3.5rem;
    font-weight: bold;
}

.sub-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.sub-cards .summary-card {
    padding: 15px;
}

.sub-cards .card-label {
    font-size: 1.0rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.label-icon {
    width: 24px;
    height: 24px;
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.expense .label-icon {
    stroke: var(--color-expense);
}

.income .label-icon {
    stroke: var(--color-income);
}

.sub-cards .amount {
    font-size: 1.5rem;
}

/* 鬨ｾ蛹�ｽｽ�ｻ鬯ｮ�ｱ�ｽ�｢髯具ｽｻ�ｽ�ｽ�ｽ鬘假ｽｭ蜴�ｽｽ�ｿ驍ｵ�ｺ�ｽ�ｽ */
.screen.hidden {
    display: none;
}

.screen {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: transform 0s;
    /* スワイプ中は即時追従 */
}

.screen.smooth-transition {
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

/* 髯具ｽｻｽｽ隴ｴｵ鬨ｾ蛹ｽｽｻ鬯ｮｱｽ｢驛｢譎渉･郢晢ｽ｣驛｢謨鳴驛｢譎｢ｽｼ */
.analysis-header {
    background: #f5eadb;
    padding: 20px 15px 10px;
    position: sticky;
    top: 0;
    z-index: 100;
    margin: -20px -20px 20px -20px;
    border-bottom: 2px solid #e5d8c5;
    color: var(--text-color);
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease;
}

#screen-analysis .analysis-header {
    /* 分析画面のみ、月切替時のガタつき防止のために高さを固定 */
    min-height: 165px;
    justify-content: flex-start;
}

/* 驛｢譎｢ｿｽｽｽ驛｢譎ｽｧｭｽｽｸｺｽｨ驍ｵｺｽｮ鬮｢ｭ隴ｴｧ陷搾ｽｹ髯樊ｺｽ蛻､陝ｲｩ驍ｵｺｽｯ髯ｷ蜿ｰｼ竏晄ｱゑｿｽｽ陋ｹｻｽｽ驛｢ｧｽｿ驛｢譎｢ｽｳ驍ｵｺｽｮ驍ｵｺｽｿ驍ｵｺｽｫ驍ｵｺ陷ｷｶｽ迢暦ｽｸｺ雋∞ｽｽｿｽｽｽ */

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.btn-prev-screen {
    background: transparent;
    border: none;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-color);
    display: flex;
    flex-direction: row;
    /* 髫ｶ髮｣�ｽ�ｪ髣包ｽｳ�ｽ�ｦ驍ｵ�ｺ�ｽ�ｳ驍ｵ�ｺ�ｽ�ｫ髣厄ｽｫ�ｽ�ｮ髮趣ｿｽ�ｽ�｣ */
    align-items: center;
    gap: 2px;
    cursor: pointer;
}

.btn-prev-screen .arrow {
    font-size: 1.2rem;
    margin-bottom: 2px;
    /* 髯晢ｿｽ�ｻ�｣�ｽ�ｽ髣厄ｽｴ陷･�ｲ�ｽ�ｽ�ｽ�ｮ鬮ｫ�ｱ�ｽ�ｿ髫ｰ�ｨ�ｽ�ｴ */
}

.month-selector {
    display: flex;
    align-items: center;
    background: #fff9e6;
    padding: 5px;
    /* 鬯ｮ�ｫ陷･諠ｹ�ｿ�｣驛｢�ｧ陞ｳ螟ｲ�ｽ�ｩ�ｽ�ｰ驛｢�ｧ遶丞､ｲ�ｽ�ｽ */
    border-radius: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    flex: 1;
    overflow: hidden;
    /* 驍ｵ�ｺ�ｽ�ｯ驍ｵ�ｺ�ｽ�ｿ髯ｷ�ｽ�ｽ�ｺ驍ｵ�ｺ鬩､�ｴ闔�貅ｯ�ｱ�ｽ�ｽ�｢ */
}

.month-scroll-container {
    flex: 1;
    overflow-x: auto;
    display: flex;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    /* IE/Edge */
    scrollbar-width: none;
    /* Firefox */
    padding: 0 10px;
}

.month-scroll-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.month-scroll-wrapper {
    display: flex;
    align-items: center;
}

.month-item {
    scroll-snap-align: center;
    flex: 0 0 auto;
    width: 120px;
    /* 髯懈圜�ｽ�ｺ髯橸ｽｳ陞｢�ｼ�ｽ�ｹ�ｽ�ｽ邵ｲ螳壽割陷･�ｲ�ｽ�ｽ�ｽ�ｮ驛｢�ｧ髮区ｩｸ�ｽ�ｮ霑壼遜�ｽ�ｮ陞｢�ｹ�ｽ�ｽ�ｸ�ｺ陝ｶ蜻ｻ�ｽ�ｽ */
    text-align: center;
    font-size: 1rem;
    color: #bbb;
    padding: 5px 0;
    transition: all 0.3s;
    cursor: pointer;
}

.month-item.active {
    color: #666;
    font-weight: bold;
    font-size: 1.1rem;
}

.month-selector .arrow {
    background: transparent;
    border: none;
    color: #ffd8a8;
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0 10px;
    z-index: 10;
}

.view-toggle {
    display: flex;
    background: #c6ac9d;
    /* 髯懶ｽｨ雋�ｽｷ陟主･�ｽｿ�ｽ陞｢�ｹ郢晢ｽ｡驛｢譎｢�ｽ�ｧ驛｢�ｧ�ｽ�ｳ雎ｼ�ｶ�ｽ�ｲ */
    padding: 4px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.toggle-btn {
    background: #fff9e6;
    /* 髫ｴ蟷｢�ｽ�ｪ鬯ｩ蛹�ｽｽ�ｸ髫ｰ螢ｽ�ｩ�ｸ�ｽ�ｼ陞｢�ｹ邵ｺ�ｽ�ｹ�ｧ�ｽ�､驛｢譎�鯵�取㏍�ｹ譎｢�ｽ�ｼ */
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin: 0 2px;
}

.view-toggle-svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #7a6a5e;
    /* 驛｢�ｧ�ｽ�｢驛｢�ｧ�ｽ�､驛｢�ｧ�ｽ�ｳ驛｢譎｢�ｽ�ｳ�ｽ�ｽ陞滄宦�ｹ�ｻ雎ｼ�ｶ�ｽ�ｲ */
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.2s ease;
    opacity: 0.5;
    /* 髫ｴ蟷｢�ｽ�ｪ鬯ｩ蛹�ｽｽ�ｸ髫ｰ螢ｽ�ｨ髮�ｿｽ驍ｵ�ｺ�ｽ�ｯ髫ｰ證ｦ�ｽ�ｧ驍ｵ�ｺ陋ｹ�ｻ�ｽ竏ｫ�ｸ�ｺ�ｽ�ｫ */
}

.toggle-btn.active-list {
    background: #ffe8cc;
    /* 鬯ｩ蛹�ｽｽ�ｸ髫ｰ螢ｽ�ｨ雋ｻ�ｽ�ｸ�ｽ�ｭ�ｽ�ｽ陞滄宦豐るΔ�ｧ遶丞､ｲ�ｿ�ｽ驛｢�ｧ�ｽ�ｪ驛｢譎｢�ｽ�ｬ驛｢譎｢�ｽ�ｳ驛｢�ｧ�ｽ�ｸ */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.toggle-btn.active-list .view-toggle-svg {
    stroke: var(--text-color);
    /* 鬯ｩ蛹�ｽｽ�ｸ髫ｰ螢ｽ�ｨ髮�ｿｽ驍ｵ�ｺ�ｽ�ｯ驍ｵ�ｺ�ｽ�ｯ驍ｵ�ｺ�ｽ�｣驍ｵ�ｺ鬮ｦ�ｪ�ｽ鬘費ｽｸ�ｺ陷会ｽｱ隨ｳ�ｽ豢幢ｿｽ�ｶ雎ｼ�ｶ�ｽ�ｲ */
    stroke-width: 2.8;
    opacity: 1;
}

/* 髯具ｽｻ�ｽ�ｽ隴ｴ�ｵ鬨ｾ蛹�ｽｽ�ｻ鬯ｮ�ｱ�ｽ�｢驛｢�ｧ�ｽ�ｿ驛｢譎｢�ｿ�ｽ */
.analysis-tabs-container {
    width: 100%;
}

.analysis-tabs {
    display: flex;
    justify-content: center;
    background: rgba(255, 255, 255, 0.3);
    padding: 6px;
    border-radius: 20px;
}

.tab-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px;
    font-family: var(--font-family);
    font-size: 1.2rem;
    font-weight: bold;
    /* 髯樊ｻゑｽｽ�ｪ髫ｴ�ｽ�ｿ�ｽ�ｽ�ｭ陷会ｽｱ遶頑･｢譽秘包ｽｻ陝ｲ�ｩ */
    color: var(--text-color);
    border-radius: 18px;
    cursor: pointer;
}

.tab-btn.active {
    background: var(--accent-color);
}

.settings-label {
    font-size: 1.3rem;
    color: #7a6a5e;
}

.settings-item-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sub-text {
    background: #fff9e6;
    color: #c6ac9d;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
}

.chevron-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #d3c4b1;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tab-btn[data-filter="expense"].active {
    background-color: var(--color-expense);
    color: white;
}

.tab-btn[data-filter="income"].active {
    background-color: var(--color-income);
    color: white;
}

.tab-btn[data-filter="all"].active {
    background-color: var(--color-balance);
    color: white;
}

/* 驛｢譎渉�･郢晢ｽ｣驛｢謨鳴驛｢譎｢�ｽ�ｼ鬯ｨ�ｾ�ｽ�｣髯ｷ蟠趣ｽｼ雋ｻ�ｿ�ｽ髯ｷ�ｿ�ｽ�､驍ｵ�ｺ�ｽ�ｽ邵ｺ蟶ｷ�ｹ�ｧ�ｽ�ｿ驛｢�ｧ�ｽ�､驛｢譎｢�ｽ�ｫ驛｢�ｧ髮区ｨ抵ｽ朱ｬｮ�ｯ�ｽ�､ */

/* 鬮ｫ�ｪ�ｽ�ｭ髯橸ｽｳ陞溘ｇ諢幃ｬｮ�ｱ�ｽ�｢驍ｵ�ｺ�ｽ�ｮ驛｢�ｧ�ｽ�ｹ驛｢�ｧ�ｽ�ｿ驛｢�ｧ�ｽ�､驛｢譎｢�ｽ�ｫ */
.settings-header {
    background: #f5eadb;
    /* 髮趣ｽｼ�ｽ�ｽ�ｽ讓抵ｽｹ�ｧ�ｽ�｢驛｢�ｧ�ｽ�､驛｢譎�鯵�取㏍�ｹ譎｢�ｽ�ｼ驍ｵ�ｺ�ｽ�ｫ鬩搾ｽｨ�ｽ�ｱ髣包ｽｳ�つ */
    padding: 20px 15px 10px;
    position: sticky;
    top: 0;
    z-index: 100;
    margin: -20px -20px 20px -20px;
    border-bottom: 2px solid #e5d8c5;
    /* 髯滂ｿｽ�ｿ�ｽ鬮ｦ諞ｺ縺楢椶�ｹ�ｽ蟶晄≧�ｽ�ｽ髯ｷ莨夲ｽｿ�ｽ */
    color: var(--text-color);
    border-radius: 30px;
    /* 髯具ｽｻ�ｽ�ｽ隴ｴ�ｵ驛｢譎渉�･郢晢ｽ｣驛｢謨鳴驛｢譎｢�ｽ�ｼ驍ｵ�ｺ�ｽ�ｨ鬩搾ｽｨ�ｽ�ｱ髣包ｽｳ�つ */
}

.settings-header .btn-prev-screen {
    color: var(--text-color);
}

.settings-title {
    flex: 1;
    text-align: center;
    font-size: 1.4rem;
    color: var(--text-color);
    font-weight: bold;
    margin-right: 60px;
    /* 驛｢�ｧ郢ｧ�ｽ�ｽ驛｢�ｧ闕ｵ譎｢�ｿ�ｽ驛｢�ｧ�ｽ�ｿ驛｢譎｢�ｽ�ｳ驍ｵ�ｺ�ｽ�ｨ驍ｵ�ｺ�ｽ�ｮ驛｢譎�ｿｽ�主ｸｷ�ｹ譎｢�ｽ�ｳ驛｢�ｧ�ｽ�ｹ鬮ｫ�ｱ�ｽ�ｿ髫ｰ�ｨ�ｽ�ｴ */
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 10px 5px;
}

.settings-card {
    background: white;
    border-radius: 40px;
    /* 鬨ｾ蛹�ｽｽ�ｻ髯ｷ蜑�ｽｸ螂�ｽｿ�ｽ驛｢�ｧ陋ｹ�ｻ遶包ｽｧ驍ｵ�ｺ�ｽ�ｪ髯樊ｻゑｽｽ�ｧ驍ｵ�ｺ鬮ｦ�ｪ遶企｡悟初�ｽ�ｸ驍ｵ�ｺ�ｽ�ｿ */
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 5px;
}

.settings-card:active {
    transform: scale(0.98);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.fontsize-option.active {
    border: 3px solid var(--accent-color);
    background-color: #fffdf5;
}

.check-mark {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 1.5rem;
    transform: scaleX(-1) rotate(-45deg);
    /* L(驛｢譏ｶ�ｽ邵ｺ閾･�ｹ譎｢�ｿ�ｽ邵ｺ�ｽ)驍ｵ�ｺ�ｽ�ｮ髯ｷ�ｿ陝�雜｣�ｽ�ｻ�ｽ�｢ */
    margin-right: 10px;
}

.check-mark.hidden {
    display: none;
}

.settings-item-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.settings-icon {
    width: 28px;
    height: 28px;
    fill: none;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* 驛｢�ｧ�ｽ�ｫ驛｢譎｢�ｿ�ｽ邵ｺ荵滂ｽｹ譎｢�ｽ�ｪ鬩搾ｽｱ�ｽ�ｨ鬯ｮ�ｮ�ｽ�ｽ陋ｻ�､鬯ｮ�ｱ�ｽ�｢驍ｵ�ｺ�ｽ�ｮ驛｢�ｧ�ｽ�ｹ驛｢�ｧ�ｽ�ｿ驛｢�ｧ�ｽ�､驛｢譎｢�ｽ�ｫ */
.category-edit-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.category-item-card-wrapper {
    grid-column: span 1;
    transition: all 0.3s ease;
}

.category-item-card-wrapper.is-expanded {
    grid-column: span 2;
}

.category-item-card {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 18px;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    border: 1px solid rgba(245, 234, 219, 0.5);
    transition: all 0.3s ease;
    height: 100%;
}

.category-item-card:hover {
    border-color: #f5eadb;
}

.category-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.category-label {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 4px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
}

.category-label:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

.category-edit-input {
    font-family: var(--font-family);
    font-size: 1rem;
    padding: 4px 8px;
    border-radius: 8px;
    border: 2px solid #f5eadb;
    color: var(--text-color);
    font-weight: bold;
    width: 100%;
    outline: none;
}

.category-edit-input:focus {
    border-color: var(--accent-color);
    background: #fffdf5;
}

.btn-save-edit,
.btn-cancel-edit {
    background: white;
    border: 2px solid #f5eadb;
    cursor: pointer;
    padding: 6px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 25px;
    font-family: 'Yomogi', cursive;
    font-size: 0.9rem;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.btn-save-edit {
    color: #8dbfc4;
}

.btn-cancel-edit {
    color: #ff8fa3;
    margin-left: 4px;
}

.btn-save-edit:hover,
.btn-cancel-edit:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    background: #fdfaf5;
}

.btn-save-edit:active,
.btn-cancel-edit:active {
    transform: scale(0.95) translateY(0);
}

.category-color-dot {
    width: 28px;
    height: 28px;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.category-color-dot:hover {
    transform: scale(1.1);
}

.color-palette-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    padding: 12px;
    background: #fffdf5;
    border-radius: 18px;
    margin: 10px 0;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.03);
    border: 2px solid #f5eadb;
}

.color-palette-item {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 0;
}

.color-palette-item:hover {
    transform: scale(1.15);
}

.color-palette-item.selected::after {
    content: "L";
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transform: scaleX(-1) rotate(-45deg);
}

.hidden {
    display: none !important;
}

/* カスタムツールチップの実装 */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(122, 106, 94, 0.9);
    /* 優しい茶色の透過 */
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: var(--font-family);
    font-weight: bold;
}

[data-tooltip]::after {
    content: "";
    position: absolute;
    bottom: 110%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: rgba(122, 106, 94, 0.9) transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    pointer-events: none;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.category-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-edit-item,
.btn-delete-item {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #d3c4b1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-edit-item:hover {
    color: var(--accent-color);
}

.btn-delete-item:hover {
    color: #f9c0c0;
}

.add-category-box {
    background: #fff9e6;
    padding: 20px;
    border-radius: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

#new-category-name,
#new-currency-unit {
    width: 100%;
    padding: 12px 20px;
    border-radius: 15px;
    border: 2px solid #f5eadb;
    font-family: var(--font-family);
    font-size: 1.1rem;
    color: var(--text-color);
    font-weight: bold;
}

#new-category-name::placeholder,
#new-currency-unit::placeholder {
    font-weight: bold;
    opacity: 0.6;
}

#new-category-name:focus,
#new-currency-unit:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* 髯晢ｽｷ�ｽ�ｴ髯具ｽｻ�ｽ�･驛｢譎｢�ｽ�ｪ驛｢�ｧ�ｽ�ｹ驛｢譎冗樟邵ｺ蜥ｲ�ｹ譎｢�ｽ�ｼ驛｢譎｢�ｿ�ｽ */
.yearly-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 15px 120px;
}

.card-year-summary {
    background-color: #fff9e6;
    border-radius: 40px;
    padding: 25px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    cursor: pointer;
}

.year-badge {
    background-color: #92817a;
    /* 鬨ｾ蛹�ｽｽ�ｻ髯ｷ蜑�ｽｸ螂�ｽｿ�ｽ鬮｣諛ｶ�ｽ�ｽ驍ｵ�ｺ�ｽ�｡鬨ｾ�ｹ�つ驍ｵ�ｺ�ｽ�ｽ隨ｳ�ｽ�ｹ譎�§�主ｸｷ�ｹ�ｧ�ｽ�ｦ驛｢譎｢�ｽ�ｳ/驛｢�ｧ�ｽ�ｰ驛｢譎｢�ｽ�ｬ驛｢譎｢�ｽ�ｼ */
    color: white;
    padding: 15px 12px;
    border-radius: 18px;
    font-size: 1.2rem;
    min-width: 65px;
    text-align: center;
}

.year-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.year-label {
    font-size: 0.9rem;
    color: #bbb;
}

.year-amount {
    font-size: 1.5rem;
    color: #8dbfc4;
    /* 鬨ｾ蛹�ｽｽ�ｻ髯ｷ蜑�ｽｸ螂�ｽｿ�ｽ髮趣ｽｺ�ｽ�｡驍ｵ�ｺ�ｽ�ｽ郢晢ｽｶ驛｢譎｢�ｽ�ｫ驛｢譎｢�ｽ�ｼ/驛｢�ｧ�ｽ�ｰ驛｢譎｢�ｽ�ｪ驛｢譎｢�ｽ�ｼ驛｢譎｢�ｽ�ｳ */
    font-weight: bold;
}

.year-details {
    display: flex;
    gap: 10px;
    font-size: 0.85rem;
}

.year-income {
    color: #8dbfc4;
}

.year-expense {
    color: #f9c0c0;
}

/* 髫ｴ蟶托ｽｺ�･隰厄ｽｨ驛｢譎｢�ｽ�ｪ驛｢�ｧ�ｽ�ｹ驛｢譎冗樟邵ｺ蜥ｲ�ｹ譎｢�ｽ�ｼ驛｢譎｢�ｿ�ｽ */
.monthly-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px 15px 120px;
}

.card-month-summary {
    background-color: #fff9e6;
    border-radius: 40px;
    padding: 25px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    cursor: pointer;
}

.month-badge {
    background-color: #f2efee;
    /* 鬨ｾ蛹�ｽｽ�ｻ髯ｷ蜑�ｽｸ螂�ｽｿ�ｽ髫ｴ荳橸ｽｼ�ｱ�ｽ迢暦ｽｸ�ｺ�ｽ�ｽ邵ｺ蝣､�ｹ譎｢�ｽ�ｬ驛｢譎｢�ｽ�ｼ */
    color: #92817a;
    padding: 15px 12px;
    border-radius: 20px;
    font-size: 1.2rem;
    min-width: 65px;
    text-align: center;
}

.month-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.month-amount {
    font-size: 1.5rem;
    color: #8dbfc4;
    font-weight: bold;
}

.month-details {
    display: flex;
    gap: 10px;
    font-size: 0.85rem;
}

.month-income {
    color: #8dbfc4;
}

.month-expense {
    color: #f9c0c0;
}

.month-count-info {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #ddd;
    font-size: 0.9rem;
}

.month-count {
    margin-right: 5px;
}

.month-arrow {
    font-size: 1.2rem;
}

/* 髯具ｽｻ�ｽ�ｽ隴ｴ�ｵ驛｢譎｢�ｽ�ｪ驛｢�ｧ�ｽ�ｹ驛｢譎冗樟邵ｺ蜥ｲ�ｹ譎｢�ｽ�ｼ驛｢譎｢�ｿ�ｽ */
.analysis-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding-bottom: 120px;
}

.analysis-list.hidden {
    display: none;
}

/* 髯ｷﾂ邵ｺ蝣､�ｹ譎｢�ｽ�ｩ驛｢譎�ｿｽ�ｽ�｡�ｽ�ｨ鬩穂ｼ夲ｽｽ�ｺ驛｢�ｧ�ｽ�ｨ驛｢譎｢�ｽ�ｪ驛｢�ｧ�ｽ�｢ */
.analysis-chart-outer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.analysis-chart-outer.hidden {
    display: none;
}

.chart-canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-canvas svg {
    border-radius: 50%;
}

.chart-percentage-text {
    font-size: 22px;
    /* 隶鯉ｽｵ鬮ｯ闊娯穐邵ｺ�ｧ陞滂ｽｧ邵ｺ髦ｪ�･ */
    fill: var(--text-color) !important;
    font-weight: bold !important;
    text-anchor: middle;
}

.chart-center-hole {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.chart-total-label {
    font-size: 22px;
    color: #888;
    margin-bottom: 5px;
}

.chart-total-amount {
    font-size: 40px;
    font-weight: bold;
    color: var(--primary-color);
}

.chart-legend {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    padding: 0 10px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff9e6;
    padding: 10px 15px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
}

.legend-item:active {
    transform: scale(0.97);
    background-color: #fff0cc;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 4px;
}

.legend-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.legend-name {
    font-size: 18px;
    color: var(--text-color);
}

.legend-percent {
    font-size: 18px;
    font-weight: bold;
    color: #555;
    margin-left: 4px;
}

.legend-right {
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--text-color);
}

.analysis-card {
    background: #fff9e6;
    border-radius: 25px;
    padding: 15px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    background-image: radial-gradient(#eee 1px, transparent 1px);
    background-size: 20px 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.analysis-card-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.analysis-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-item {
    background: #fff9e6;
    padding: 10px 15px;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.95rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.detail-left {
    display: flex;
    flex-direction: column;
}

.detail-category {
    font-size: 0.8rem;
    color: #bbb;
}

.detail-amount {
    font-weight: bold;
}

.btn-delete {
    background-color: #ffdce3;
    /* 柔らかい赤系 */
    border: none;
    color: #ff8fa3;
    font-family: var(--font-family);
    font-size: 1.1rem;
    font-weight: bold;
    padding: 12px;
    cursor: pointer;
    border-radius: 20px;
    width: 100%;
    margin-top: 10px;
    text-align: center;
    transition: background-color 0.2s;
}

.btn-delete:active {
    background-color: #ffcfd9;
}

.btn-delete.hidden {
    display: none;
}

.card-date-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.day-circle {
    width: 45px;
    height: 45px;
    background: #f0f0f0;
    color: #666;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.day-summary {
    display: flex;
    flex-direction: column;
}

.day-weekday {
    font-size: 0.8rem;
    color: #bbb;
}

.day-balance-text {
    font-size: 0.9rem;
    color: #f9a4a4;
    /* 髫俶誓�ｽ�､鬩堺ｼ夲ｽｽ�ｻ */
}

.card-count {
    display: flex;
    align-items: center;
    gap: 10px;
}

.count-badge {
    background: #f5f5f5;
    color: #bbb;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
}

.arrow-gray {
    color: #ddd;
    font-size: 1.2rem;
}

/* 髯ｷ闌ｨ�ｽ�･髯ｷ迚呻ｽｸ蜻ｻ�ｿ�ｽ驛｢�ｧ�ｿ驛｢譎｢�ｽ�ｳ */
.btn-input {
    margin-top: auto;
    margin-bottom: 5px;
    /* 髣厄ｽｴ陷･荳樣��Δ�ｧ陋幢ｽｵ�ｹ�ｧ陝ｲ�ｨ遶頑･｢譽費ｽｧ驍ｵ�ｺ鬮ｦ�ｪ�･ */
    background-color: var(--accent-color);
    color: var(--text-color);
    border: none;
    border-radius: 40px;
    padding: 15px 40px;
    font-size: 1.8rem;
    font-weight: bold;
    font-family: var(--font-family);
    cursor: pointer;
    box-shadow: 0 10px 0 #e6a555;
    transition: all 0.1s;
    width: 100%;
    margin-top: 40px;
}

.btn-input:active {
    box-shadow: 0 2px 0 #e6a555;
    transform: translateY(8px);
}

.btn-input .plus {
    margin-right: 10px;
    font-weight: bold;
}

/* 驛｢譎�鯵郢晢ｽｨ驛｢譎｢�ｿ�ｽ驛｢譎会ｽｿ�ｫ郢晢ｽｳ */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: #fff9e6;
    display: flex;
    justify-content: space-around;
    padding: 10px 0 calc(15px + env(safe-area-inset-bottom));
    /* 驛｢ｧｻ驛｢譎｢ｽｼ驛｢譎ｽｼ譁絶凰驛｢譎｢ｽｪ驛｢ｧ｢驍ｵｺｫ髯晢ｽｽｾ髯滂ｽ｢隲帛･ｽｼ驍ｵｺ雋贋ｼ夲ｽｽｽ陷･荳樣 */
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.05);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    z-index: 2100;
    /* ロック画面(2000)よりも前面に配置 */
    pointer-events: auto;
    /* 驛｢ｧｳ驛｢譎｢ｽｳ驛｢譎｢ｿｽ趣ｽｦ驛｢譎｢ｿｽ閧ｲｹｧ鬮ｮ竏ｫ竏夐ｬｮｱ｢驍ｵｺｫ鬮ｯｦｨ鬩穂ｼ夲ｽｽｺ */
}

.nav-item {
    text-decoration: none;
    color: #c0b8b0;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    gap: 4px;
    cursor: pointer;
    /* タップ可能であることを明示 */
}

.nav-item.active {
    color: var(--text-color);
}

.nav-icon {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 1.4rem;
}

.nav-item.active .nav-icon {
    background-color: var(--nav-active-bg);
    color: white;
    box-shadow: 0 4px 10px rgba(255, 188, 110, 0.4);
}

/* 驛｢譎｢ｽ｢驛｢譎｢ｽｼ驛｢謨鳴驛｢譎｢ｽｫ鬯ｮ｢｢鬯ｨｾ｣ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    /* 髯ｷ闌ｨｽｨ鬨ｾ蛹ｽｽｻ鬯ｮｱ｢驛｢ｧ陞ｳ螟ｲｽｦｽ遶包ｽｧ */
    z-index: 1000;
    display: flex;
    justify-content: center;
    transition: transform 0.3s ease-out;
}

#calendarScreen {
    align-items: flex-start !important;
    padding-top: 0 !important;
    margin-top: 0 !important;
    z-index: 1560;
}

.calendar-modal-header {
    padding: 10px 20px !important;
    margin-bottom: 10px !important;
}

/* 郢晢ｽｭ郢昴￠騾包ｽｻ鬮ｱ｢邵ｺｯ郢晁ｼ斐Ε郢ｧｿ郢晢ｽｼ郢ｧ繧ｧ郢ｧ竏壺ｻ隴崢陷大涵謫ｸｺｫ髯ｦｨ驕会ｽｺ */
/* 郢晢ｽｭ郢昴￠騾包ｽｻ鬮ｱ｢邵ｺｯ郢晁ｼ斐Ε郢ｧｿ郢晢ｽｼ郢ｧ繧ｧ郢ｧ竏壺ｻ隴帚ぎ陷大涵謫ｸｺｫ髯ｦｨ驕会ｽｺ */
#screen-lock {
    z-index: 2000;
}

.modal-overlay.hidden {
    display: none !important;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    height: 100%;
    background-color: var(--bg-color);
    background-image: radial-gradient(#d3c4b1 1.5px, transparent 1.5px);
    background-size: 30px 30px;
    display: flex;
    flex-direction: column;
}

/* 郢ｧｫ郢晢ｽｬ郢晢ｽｳ郢敖郢晢ｽｼ郢晢ｽ｢郢晢ｽｼ郢敖郢晢ｽｫ騾包ｽｨ邵ｺｮ闖ｴ蜥丞項驕抵ｽｺ闖ｫ */
.full-calendar-content {
    padding-bottom: 20px !important;
}

.modal-header {
    background-color: var(--accent-color);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-color);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: bold;
}

.btn-back,
.btn-save {
    font-family: var(--font-family);
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-color);
}

.btn-save {
    background: white;
    padding: 8px 25px;
    border-radius: 20px;
}

/* 日別詳細リストの余白調整 */
.day-detail-list {
    padding-bottom: 120px;
}

.input-form {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: hidden;
    padding-bottom: 40px;
    /* 削除ボタンが見えやすいよう余白を適正化 */
}

/* 髫ｰ�ｾ�ｯ髯ｷ�ｽ�ｺ驛｢譎｢�ｽ�ｻ髯ｷ�ｿ闕ｳ�ｻ�ｽ驛｢�ｧ�ｿ驛｢譎｢�ｿ�ｽ */
.type-selector {
    display: flex;
    background: white;
    padding: 5px;
    border-radius: 20px;
    border: 3px solid white;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.type-btn-group {
    display: flex;
    gap: 10px;
    width: 100%;
}

.type-btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 15px;
    font-family: var(--font-family);
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    color: #ccc;
    transition: all 0.2s;
}

.type-btn[data-type="expense"].active {
    background-color: var(--color-expense);
    color: white;
}

.type-btn[data-type="income"].active {
    background-color: var(--color-income);
    color: white;
}

/* 髯ｷ�ｷ�ｨ�ｮ驛｢譎�ｽｼ譁青ｰ驛｢譎｢�ｽ�ｼ驛｢譎会ｽｹ�ｧ�ｰ驛｢譎｢�ｽ�ｫ驛｢譎｢�ｽ�ｼ驛｢ */
.calendar-summary {
    margin: 10px 20px;
    display: flex;
    justify-content: space-around;
    gap: 10px;
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.form-group {
    background: white;
    border-radius: 25px;
    padding: 15px 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.8rem;
    color: #ccc;
    margin-bottom: 8px;
}

.amount-group {
    padding: 25px 20px;
}

.amount-input-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.amount-input-wrapper.is-suffix {
    flex-direction: row-reverse;
}

.currency {
    font-size: 2rem;
    color: var(--text-color);
}

/* 鬯ｮ�ｮ�ｻ髯ｷ鬘倅ｾｭ邵ｺ蜀暦ｽｹ譎｢�ｽ�ｼ驛｢譏懶ｽｻ�｣郢晢ｽ｣驛｢譎｢�ｿ�ｽ */
.calculator-keypad.hidden {
    display: none;
}

.calculator-keypad {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.calc-btn {
    background: white;
    border: none;
    border-radius: 15px;
    padding: 15px;
    font-family: var(--font-family);
    font-size: 1.4rem;
    color: var(--text-color);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.1s;
}

.calc-btn:active {
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    transform: translateY(2px);
}

.calc-btn.op {
    background-color: #fff4e5;
    color: #e6a555;
}

.equal-btn {
    background-color: #ffdce3;
    /* 鬮ｦ�ｮ�ｽ讓抵ｽｹ譎�ｱ抵ｾ趣ｽｦ驛｢�ｧ�ｯ */
    color: #ff8fa3;
}

.enter-btn {
    background-color: var(--accent-color);
    color: white;
}

.chart-percentage-text {
    font-family: var(--font-family);
    font-weight: bold;
    fill: #333;
    pointer-events: none;
    font-size: 26px;
    /* 26px 縺ｫ縺輔ｉ縺ｫ諡｡螟ｧ */
}

.analysis-chart-outer {
    padding: 0 15px 120px;
    /* 120pxの下部余白を確保してボトムナビとの干渉を防止 */
    width: 100%;
}

.chart-container {
    position: relative;
    height: 680px;
    /* 隕ｪ繧ｳ繝ｳ繝�リ鬮倥＆繧�+60px諡｡螟ｧ */
    width: 100%;
    margin-bottom: 20px;
}

#analysis-chart-canvas {
    height: 100%;
    width: 100%;
}

#input-amount {
    width: 100%;
    border: none;
    font-size: 3rem;
    font-family: var(--font-family);
    text-align: right;
    color: var(--text-color);
    outline: none;
    background: transparent;
}

.row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.select-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: bold;
    min-height: 40px;
    /* 驛｢�ｧ�ｽ�ｯ驛｢譎｢�ｽ�ｪ驛｢譎｢�ｿ�ｽ邵ｺ驢搾ｽｸ�ｺ陷会ｽｱ�ｽ�ｽ�ｸ�ｺ陷ｷ�ｶ�ｽ�･鬯ｯ�ｮ陋滂ｽ･�ｽ�ｽ�ｹ�ｧ陜｣�､�ｽ�｢�ｽ�ｺ髣厄ｽｫ�ｽ�ｽ */
    cursor: pointer;
}

.modal-select-icon {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--text-color);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.8;
}

.select-wrapper input[type="date"] {
    border: none;
    font-family: var(--font-family);
    font-size: 1rem;
    width: 100%;
    outline: none;
}

.memo-group label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.memo-icon-svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: var(--text-color);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.8;
}

.memo-group textarea {
    width: 100%;
    height: 84px;
    border: none;
    font-family: var(--font-family);
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-color);
    resize: none;
    outline: none;
    margin-top: 10px;
}

/* 驛｢�ｧ�ｽ�､驛｢譎｢�ｽ�ｳ驛｢譎｢�ｽ�ｩ驛｢�ｧ�ｽ�､驛｢譎｢�ｽ�ｳ驛｢�ｧ�ｽ�ｫ驛｢譎｢�ｿ�ｽ邵ｺ荵滂ｽｹ譎｢�ｽ�ｪ驛｢譎｢�ｽ�ｪ驛｢�ｧ�ｽ�ｹ驛｢譎｢�ｿ�ｽ */
.category-list.hidden {
    display: none;
}

.category-list {
    background: #fff9e6;
    border-radius: 25px;
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 3髯具ｽｻ陷会ｽｱ遶企豪�ｸ�ｺ陷会ｽｱ遯ｶ�ｻ驛｢�ｧ�ｽ�ｳ驛｢譎｢�ｽ�ｳ驛｢譏懶ｽｻ�｣邵ｺ驢搾ｽｹ譎冗樟遶奇ｿｽ */
    gap: 10px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.category-item {
    background: #fbfbfb;
    border: 1px solid #eee;
    border-radius: 15px;
    padding: 10px 5px;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--text-color);
    cursor: pointer;
    text-align: center;
    transition: all 0.1s;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-item:active {
    background: var(--bg-color);
    transform: scale(0.95);
}

/* 驛｢�ｧ�ｽ�ｫ驛｢�ｧ�ｽ�ｹ驛｢�ｧ�ｽ�ｿ驛｢譎｢�ｿ�ｽ驛｢�ｧ�ｽ�ｫ驛｢譎｢�ｽ�ｬ驛｢譎｢�ｽ�ｳ驛｢謨鳴驛｢譎｢�ｽ�ｼ */
.calendar-picker {
    background: #fff9e6;
    border-radius: 25px;
    padding: 15px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05);
}

.calendar-picker.hidden {
    display: none;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding: 0 10px;
}

.calendar-header button {
    background: transparent;
    border: none;
    font-family: var(--font-family);
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 5px 15px;
}

#calendar-month-year {
    font-size: 1.1rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 4px;
    padding: 0 5px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    font-size: 0.8rem;
    color: #ccc;
    margin-bottom: 5px;
}

.calendar-weekdays div:nth-child(1) {
    color: #ff8fa3 !important;
    /* 髫ｴ魃会ｽｽ�･髫ｴ蛹�ｿｽ�ｽ�ｼ陞｢�ｼ�ｽ�ｰ闔会ｽ｣�ｽ�ｽ髮趣ｽｼ�ｽ�ｽ�ｽ讓抵ｽｹ�ｧ遶丞､ｲ�ｿ�ｽ驛｢譎�ｱ抵ｾ趣ｽｦ驛｢�ｧ�ｽ�ｯ */
}

.calendar-weekdays div:nth-child(7) {
    color: #5bb2ff !important;
    /* 髯懶ｽｨ雋顔§�ｱ�ｽ�ｿ�ｽ陞｢�ｹ�ｽ�ｽ驍ｵ�ｺ�ｽ�｣驍ｵ�ｺ鬮ｦ�ｪ�ｽ鬘費ｽｸ�ｺ陷会ｽｱ隨ｳ�ｽ�ｹ譎�§�取刮�ｹ譎｢�ｽ�ｼ */
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: repeat(6, 1fr);
    /* 菫ｮ豁｣: 6陦悟崋螳� */
    gap: 4px;
    padding: 0 5px;
    width: 100%;
    box-sizing: border-box;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    /* 髯晢ｿｽ�ｻ�｣�ｽ�ｽ髯樊ｻゑｽｽ�ｧ驍ｵ�ｺ鬮ｦ�ｪ�ｽ�･ */
    cursor: pointer;
    border-radius: 15px;
    /* 髣包ｽｳ�ｽ�ｸ驍ｵ�ｺ陷ｷ�ｶ驍�ｿｽ�ｸ�ｺ�ｽ�ｪ驍ｵ�ｺ�ｽ�ｽ�ｽ�ｧ陷托ｿｽ�ｽ�ｸ�ｽ�ｸ驍ｵ�ｺ�ｽ�ｫ驍ｵ�ｺ陷会ｽｱ遯ｶ�ｻ驛｢�ｧ�ｽ�ｹ驛｢譎擾ｽ｣�ｹ�ｽ�ｽ驛｢�ｧ�ｽ�ｹ鬩墓慣�ｽ�ｺ髣厄ｽｫ�ｽ�ｽ */
    transition: all 0.2s;
    position: relative;
    padding: 2px;
    color: var(--text-color);
}

.calendar-day:hover {
    background: #fbfbfb;
}

.calendar-day.selected {
    background: var(--accent-color) !important;
    color: white !important;
}

.calendar-day.selected .holiday-name {
    color: white !important;
}

.calendar-day.today {
    background: #fff4e5;
    color: var(--accent-color);
    font-weight: bold;
    border: 1px solid var(--accent-color);
}

.calendar-day.empty {
    cursor: default;
}

/* 鬨ｾ�ｾ隴趣ｿｽ�ｾ迢暦ｽｹ譎｢�ｽ�ｻ髫ｴ魃会ｽｽ�･髫ｴ蛹√鯵�ｽ�ｽ髯懶ｽｨ雋顔§�ｱ�ｽ�ｸ�ｺ�ｽ�ｮ雎ｼ�ｶ�ｽ�ｲ�ｽ�ｽ陜捺ｺｽ�ｽ髯晢ｿｽ譁｡�主､雁ｴ包ｿｽ�ｽ遶企豪�ｹ�ｧ郢ｧ莨夲ｽｽ�｢�ｽ�ｺ髯橸ｽｳ雋�ｪ�ｽ髯ｷ�ｿ髢ｧ�ｴ闕ｳ蜊�ｽｸ�ｺ髴郁ｲｻ�ｽ讙趣ｽｹ�ｧ闕ｵ譎｢�ｽ閧ｲ�ｸ�ｺ�ｽ�ｽ遶奇ｿｽ span 驛｢�ｧ郢ｧ蝓滂ｽｬ�ｽ髯橸ｽｳ陞滂ｽｲ�ｽ�ｼ�ｽ�ｽ */
.calendar-day.sunday,
.calendar-day.holiday,
.calendar-day.sunday span,
.calendar-day.holiday span {
    color: #ff8fa3 !important;
    /* 驛｢譎�ｱ抵ｾ趣ｽｦ驛｢�ｧ�ｽ�ｯ */
}

.calendar-day.saturday,
.calendar-day.saturday span {
    color: #5bb2ff !important;
    /* 驛｢譎�§�取刮�ｹ譎｢�ｽ�ｼ */
}

.holiday-name {
    font-size: 0.55rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
    position: absolute;
    bottom: 2px;
}

/* 驛｢譎�ｽｼ譁石暮Δ�ｧ�ｽ�ｿ驛｢譎｢�ｽ�ｼSVG驛｢�ｧ�ｽ�｢驛｢�ｧ�ｽ�､驛｢�ｧ�ｽ�ｳ驛｢譎｢�ｽ�ｳ驍ｵ�ｺ�ｽ�ｮ髯ｷ闌ｨ�ｽ�ｱ鬯ｨ�ｾ陞｢�ｹ邵ｺ蟶ｷ�ｹ�ｧ�ｽ�ｿ驛｢�ｧ�ｽ�､驛｢譎｢�ｽ�ｫ */
.footer-svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: #d3c4b1;
    /* 驛｢譎｢�ｿ�ｽ郢晢ｽｵ驛｢�ｧ�ｽ�ｩ驛｢譎｢�ｽ�ｫ驛｢譎冗樟�ｽ�ｽ髯晢ｿｽ�ｻ�｣�ｽ�ｽ鬮ｦ�ｮ�ｽ�ｽ�ｽ竏ｫ�ｸ�ｺ�ｽ�ｮ鬮｣魃会ｽｽ�ｶ雎ｼ�ｶ�ｽ�ｲ */
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: all 0.3s ease;
}

.nav-item.active .footer-svg {
    stroke: var(--text-color);
    /* 驛｢�ｧ�ｽ�｢驛｢�ｧ�ｽ�ｯ驛｢譎｢�ｿ�ｽ邵ｺ�ｽ�ｹ譎乗亜陷�ｽｾ驍ｵ�ｺ�ｽ�ｯ驛｢譎｢�ｽ�｡驛｢�ｧ�ｽ�､驛｢譎｢�ｽ�ｳ驍ｵ�ｺ�ｽ�ｮ鬮｣魃会ｽｽ�ｶ雎ｼ�ｶ�ｽ�ｲ */
    stroke-width: 2.8;
    /* 髯晢ｿｽ�ｻ�｣�ｽ�ｽ髯樊ｻゑｽｽ�ｪ驍ｵ�ｺ闕ｳ螂�ｽｼ�ｽ驍ｵ�ｺ�ｽ�ｦ髯滓汚�ｽ�ｷ鬮ｫ�ｱ�ｽ�ｿ */
}

/* 郢晢ｽｭ郢晢ｿｽ縺鷹包ｽｻ鬮ｱ�｢陜暦ｽｺ隴幢ｿｽ */
#passcodeScreen {
    background-color: var(--bg-color);
    background-image: radial-gradient(#d3c4b1 1.5px, transparent 1.5px);
    background-size: 30px 30px;
    z-index: 2000;
    /* 郢晢ｽ｢郢晢ｽｼ郢敖郢晢ｽｫ郢ｧ蛹ｻ�顔ｹｧ繧�√鬮ｱ�｢邵ｺ�ｫ */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    height: 100vh;
    overflow-y: auto;
}

#screen-lock.hidden {
    display: none !important;
}

.lock-content {
    background: transparent !important;
    background-image: none !important;
    /* 隕ｪ縺ｧ險ｭ螳壹＠縺ｦ縺�ｋ縺溘ａ荳崎ｦ� */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 40px;
    padding-bottom: 50px;
    overflow: hidden !important;
    /* 繧ｹ繧ｯ繝ｭ繝ｼ繝ｫ蟒�ｭ｢ */
}

.lock-header {
    text-align: center;
}

.lock-title {
    font-size: 2.2rem;
    color: var(--text-color);
    margin-bottom: 10px;
}

.lock-msg {
    font-size: 1.1rem;
    color: #a89485;
    font-weight: bold;
}

.passcode-dots {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.dot {
    width: 20px;
    height: 20px;
    border: 3px solid #d3c4b1;
    border-radius: 50%;
    transition: all 0.2s;
}

.dot.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    transform: scale(1.2);
}

.dot.error {
    background-color: #ff8fa3;
    border-color: #ff8fa3;
    animation: shake 0.3s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.lock-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 300px;
}

.lock-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    background: white;
    font-family: var(--font-family);
    font-size: 1.6rem;
    color: var(--text-color);
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s;
}

.lock-btn:active {
    transform: scale(0.9);
    background: #fff9e6;
}

.lock-btn.del-btn {
    background: transparent;
    box-shadow: none;
    font-size: 1.4rem;
    color: #bbb;
}

.empty-btn {
    width: 70px;
    height: 70px;
}

/* === 郢晁ｼ釆晉ｹｧ�ｫ郢晢ｽｬ郢晢ｽｳ郢敖郢晢ｽｼ郢晢ｽ｢郢晢ｽｼ郢敖郢晢ｽｫ === */
.full-calendar-content {
    width: 95%;
    max-width: 450px;
    height: auto;
    max-height: calc(100dvh - 20px);
    padding: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.calendar-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.calendar-modal-header h2 {
    font-size: 1.4rem;
    color: var(--text-color);
}

.month-nav-btn {
    background: #fdfaf5;
    border: 2px solid #f5eadb;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    color: #7a6a5e;
    transition: all 0.2s;
}

.month-nav-btn:hover {
    background: #fff;
    transform: scale(1.1);
}

.calendar-summary {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 15px;
}

.modal-content {
    background: #fff9f0;
    width: 92%;
    max-height: 90vh;
    border-radius: 30px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0s;
}

.modal-content.smooth-transition {
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.calendar-summary .summary-item {
    flex: 1;
    background: #fff;
    border: 2px solid #f5eadb;
    border-radius: 15px;
    padding: 10px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* スワイプ戻りインジケーター */
.swipe-indicator {
    position: fixed;
    top: 50%;
    left: 20px;
    transform: translateY(-50%) translateX(-20px);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--accent-color);
}

.swipe-indicator-icon {
    font-size: 1.8rem;
    color: var(--accent-color);
    font-weight: bold;
    font-family: var(--font-family);
    margin-right: 4px;
    /* 中央寄せの微調整 */
}

.swipe-indicator.visible {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.swipe-indicator.hidden {
    display: none;
}

.calendar-summary .label {
    font-size: 0.75rem;
    color: #998c81;
}

.calendar-summary .value {
    font-size: 0.95rem;
    font-weight: bold;
}

.calendar-summary .income .value {
    color: #8dbfc4;
}

.calendar-summary .expense .value {
    color: #ff8fa3;
}

.calendar-summary .total .value {
    color: #7a6a5e;
}

.full-calendar-grid {
    background: #fff;
    border-radius: 20px;
    padding: 10px 5px;
    border: 2px solid #f5eadb;
    flex: 1;
    /* 谿九ｊ縺ｮ繧ｹ繝壹�繧ｹ繧貞沂繧√ｋ */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.full-calendar-grid .calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    text-align: center;
    font-weight: bold;
    color: #998c81;
    margin-bottom: 10px;
    font-size: 0.85rem;
    box-sizing: border-box;
    width: 100%;
    gap: 2px;
}

.full-calendar-grid .calendar-weekdays .sun {
    color: #ff8fa3;
}

.full-calendar-grid .calendar-weekdays .sat {
    color: #5bb2ff;
}

.full-calendar-grid .calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: repeat(6, 1fr);
    /* 菫ｮ豁｣: 6陦悟崋螳� */
    gap: 2px;
    box-sizing: border-box;
    width: 100%;
}

.full-calendar-grid .calendar-day {
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 5px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    box-sizing: border-box;
}

.full-calendar-grid .calendar-day:hover {
    background: #fdfaf5;
}

.full-calendar-grid .calendar-day .day-num {
    font-size: 0.95rem;
    font-weight: bold;
}

.full-calendar-grid .calendar-day.sunday .day-num {
    color: #ff8fa3;
}

.full-calendar-grid .calendar-day.saturday .day-num {
    color: #5bb2ff;
}

.full-calendar-grid .calendar-day.holiday .day-num {
    color: #ff8fa3;
}

.full-calendar-grid .calendar-day .day-expense {
    font-size: 0.6rem;
    color: #ff8fa3;
    margin-top: 2px;
    font-weight: bold;
    word-break: break-all;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.full-calendar-grid .calendar-day.has-expense {
    background: #fff8f8;
}

.full-calendar-grid .calendar-day.today {
    background: #fffdf5;
    border: 1.5px solid #ffbc6e !important;
}

.full-calendar-grid .calendar-day.empty {
    cursor: default;
}

.full-calendar-grid .calendar-day.empty:hover {
    background: transparent;
}

.full-calendar-grid .calendar-day .day-income {
    font-size: 0.6rem;
    color: #8dbfc4;
    margin-top: 1px;
    font-weight: bold;
    word-break: break-all;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

.full-calendar-grid .calendar-day.has-income {
    background: #f8ffff;
}

.full-calendar-grid .calendar-day.has-both {
    background: #fdfdf5;
}

/* 譌･蛻･隧ｳ邏ｰ繝｢繝ｼ繝繝ｫ */
#day-detail-modal {
    z-index: 1080;
}

.day-detail-content {
    background-color: var(--bg-color) !important;
}

.day-detail-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    padding-bottom: 120px;
}

.day-detail-item {
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: transform 0.1s;
}

.day-detail-item:active {
    transform: scale(0.98);
}

.day-detail-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.day-detail-category {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 10px;
    width: fit-content;
}

.day-detail-memo {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: bold;
}

.day-detail-amount {
    font-size: 1.1rem;
    font-weight: bold;
}


/* 蝗ｺ螳夊ｲｻ荳隕ｧ縺ｮ繝ｪ繝輔Ξ繝�す繝･ */
.fixed-item-card {
    background: white;
    border-radius: 15px;
    padding: 18px 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.fixed-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
}

.fixed-item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fixed-item-type-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 6px;
    width: fit-content;
    font-weight: bold;
    margin-bottom: 2px;
    line-height: 1;
}

.fixed-item-category {
    font-size: 0.8rem;
    padding: 2px 10px;
    border-radius: 20px;
    width: fit-content;
    font-weight: bold;
}

.fixed-item-info {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: bold;
}

.fixed-item-day {
    font-size: 0.8rem;
    color: #998c81;
}

.fixed-item-right {
    text-align: right;
}

.fixed-item-amount {
    font-size: 1.1rem;
    font-weight: bold;
}

.fixed-item-period {
    font-size: 0.7rem;
    color: #bbb;
}


/* 蝗ｺ螳夊ｲｻ繝ｪ繧ｹ繝亥�縺ｮ繝懊ち繝ｳ */
.fixed-item-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-fixed-action {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.btn-fixed-edit {
    background: #fdfdf5;
    color: #7a6a5e;
    border: 1px solid #eee;
}

.btn-fixed-delete {
    background: #fff5f5;
    color: #ff8fa3;
    border: 1px solid #ffe3e3;
}

.full-calendar-grid .calendar-day.holiday .day-num {
    color: #ff8fa3;
}

.full-calendar-grid .calendar-day .day-expense {
    font-size: 0.6rem;
    color: #ff8fa3;
    margin-top: 2px;
    font-weight: bold;
    word-break: break-all;
    text-align: center;
    line-height: 1;
}

.full-calendar-grid .calendar-day.has-expense {
    background: #fff8f8;
}

.full-calendar-grid .calendar-day.today {
    background: #fffdf5;
    border: 1.5px solid #ffbc6e !important;
}

.full-calendar-grid .calendar-day.empty {
    cursor: default;
}

.full-calendar-grid .calendar-day.empty:hover {
    background: transparent;
}

.full-calendar-grid .calendar-day .day-income {
    font-size: 0.6rem;
    color: #8dbfc4;
    margin-top: 1px;
    font-weight: bold;
    word-break: break-all;
    text-align: center;
    line-height: 1;
}

.full-calendar-grid .calendar-day.has-income {
    background: #f8ffff;
}

.full-calendar-grid .calendar-day.has-both {
    background: #fdfdf5;
}

/* 譌･蛻･隧ｳ邏ｰ繝｢繝ｼ繝繝ｫ */
#day-detail-modal {
    z-index: 1080;
}

.day-detail-content {
    background-color: var(--bg-color) !important;
}

.day-detail-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    padding-bottom: 120px;
}

.day-detail-item {
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: transform 0.1s;
}

.day-detail-item:active {
    transform: scale(0.98);
}

.day-detail-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.day-detail-category {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 10px;
    width: fit-content;
}

.day-detail-memo {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: bold;
}

.day-detail-amount {
    font-size: 1.1rem;
    font-weight: bold;
}


/* 蝗ｺ螳夊ｲｻ荳隕ｧ縺ｮ繝ｪ繝輔Ξ繝す繝･ */
.fixed-item-card {
    background: white;
    border-radius: 15px;
    padding: 18px 15px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.fixed-item-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
}

.fixed-item-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fixed-item-category {
    font-size: 0.8rem;
    padding: 2px 10px;
    border-radius: 20px;
    width: fit-content;
    font-weight: bold;
}

.fixed-item-info {
    font-size: 0.95rem;
    color: var(--text-color);
    font-weight: bold;
}

.fixed-item-day {
    font-size: 0.8rem;
    color: #998c81;
}

.fixed-item-right {
    text-align: right;
}

.fixed-item-amount {
    font-size: 1.1rem;
    font-weight: bold;
}

.fixed-item-period {
    font-size: 0.7rem;
    color: #bbb;
}


/* 蝗ｺ螳夊ｲｻ繝ｪ繧ｹ繝亥縺ｮ繝懊ち繝ｳ */
.fixed-item-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.btn-fixed-action {
    font-size: 0.8rem;
    padding: 4px 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: bold;
}

.btn-fixed-edit {
    background: #fdfdf5;
    color: #7a6a5e;
    border: 1px solid #eee;
}

.btn-fixed-delete {
    background: #fff5f5;
    color: #ff8fa3;
    border: 1px solid #ffe3e3;
}

.btn-fixed-action:active {
    transform: scale(0.95);
}

.fixed-empty-msg {
    text-align: center;
    padding: 60px 20px;
    color: #bbb;
    font-size: 1rem;
    line-height: 1.6;
}

/* 1343行目に統合済み */

/* 固定費モーダルの入力欄デザイン統一 */
#fixed-cost-modal .amount-input,
#fixed-cost-modal .memo-input {
    border-radius: 14px !important;
    background-color: #fffaf4 !important;
    border: 2px solid #d8cfc4 !important;
    padding: 12px 15px !important;
    font-family: inherit;
    font-weight: bold !important;
    font-size: 1.1rem !important;
    outline: none !important;
    transition: border-color 0.2s;
    box-shadow: none !important;
    width: 100%;
    box-sizing: border-box;
    color: var(--text-color);
}

#fixed-cost-modal .amount-input:focus,
#fixed-cost-modal .memo-input:focus {
    border-color: #f4a259 !important;
}

/* スピナー（増減ボタン）削除 */
#fixed-cost-modal input::-webkit-outer-spin-button,
#fixed-cost-modal input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#fixed-cost-modal input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* 固定費カテゴリリストの表示ロジック（シンプルに再構成） */
#fixed-cost-modal #fixed-area-category {
    position: relative;
    cursor: pointer;
    outline: none;
    border-radius: 14px;
    background-color: #fffaf4;
    border: 2px solid #d8cfc4;
    padding: 12px 15px;
}

/* カテゴリリスト本体 */
#fixed-cost-modal #fixed-category-list {
    display: none !important;
    /* 初期は非表示 */
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    background: #fff9e6;
    border-radius: 20px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-top: 10px;
}

/* 親要素がフォーカスされた時だけリストを表示 */
#fixed-cost-modal #fixed-area-category:focus-within+#fixed-category-list,
#fixed-cost-modal #fixed-area-category:active+#fixed-category-list,
#fixed-cost-modal #fixed-category-list:not(.hidden) {
    display: grid !important;
}

/* JSによる強制非表示 */
#fixed-cost-modal #fixed-category-list.hidden {
    display: none !important;
}

/* アイコン：回転演出なし */
#fixed-cost-modal #fixed-area-category .arrow {
    display: inline-block;
    margin-left: 5px;
    transform: none !important;
}

/* 固定費モーダル自体の表示制御（干渉防止） */
#fixed-cost-modal.hidden {
    display: none !important;
}

/* モーダル全体のスクロール抑制 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    touch-action: none;
    transition: transform 0s;
}

.modal-overlay.smooth-transition {
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1.0);
}

.modal-content {
    background: var(--bg-color);
    width: 90%;
    max-width: 440px;
    border-radius: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    /* コンテンツのはみ出しを抑制 */
    display: flex;
    flex-direction: column;
}

#fixed-cost-modal:not(.hidden) {
    display: flex !important;
    position: fixed;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.4);
    /* 背景を少し暗くしてプレミアム感を出す */
    justify-content: center !important;
    align-items: center !important;
}

#fixed-cost-modal .modal-content {
    width: 90% !important;
    max-width: 440px !important;
    max-height: 90vh !important;
    /* 画面高の90%に制限 */
    overflow-y: auto !important;
    /* はみ出す場合にスクロール */
    background-color: var(--bg-color) !important;
    border-radius: 20px !important;
    padding-bottom: 20px !important;
    /* 下部の余白 */
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2) !important;
}

/* カスタムトースト通知 */
.toast-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 249, 230, 0.95);
    color: #8d7b68;
    padding: 15px 30px;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(141, 123, 104, 0.2);
    z-index: 10000;
    pointer-events: none;
    border: 3px solid #f4a259;
    font-weight: bold;
    font-size: 1.1rem;
    text-align: center;
    min-width: 250px;
    animation: toast-animation 2.5s ease-in-out forwards;
}

/* カスタム確認ダイアログのボタンデザイン修正 */
#confirm-modal .confirm-modal-content {
    width: 85% !important;
    max-width: 320px !important;
    height: auto !important;
    min-height: auto !important;
    background-color: #fff9e6 !important;
    border: 3px solid #f4a259 !important;
    border-radius: 30px !important;
    padding: 25px !important;
    margin: auto !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

#confirm-modal .confirm-body {
    margin: 0 0 25px 0 !important;
    text-align: center !important;
    color: #8d7b68 !important;
    font-weight: bold !important;
    font-size: 1.1rem !important;
    line-height: 1.5 !important;
}

#confirm-modal .confirm-footer {
    display: flex !important;
    gap: 12px !important;
    width: 100% !important;
}

#confirm-modal .btn-confirm {
    flex: 1 !important;
    padding: 8px 5px !important;
    border-radius: 20px !important;
    border: none !important;
    font-family: inherit !important;
    font-weight: bold !important;
    font-size: 1.1rem !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.05) !important;
}

#confirm-modal .btn-confirm:active {
    transform: translateY(2px) !important;
    box-shadow: none !important;
}

/* OKボタン */
#confirm-modal .btn-confirm.primary {
    background-color: var(--accent-color) !important;
    color: white !important;
}

/* やめるボタン */
#confirm-modal .btn-confirm.secondary {
    background-color: #f0f0f0 !important;
    color: #999 !important;
}

/* 固定費削除ボタン位置の微調整 */
#fixed-cost-modal #btn-delete-fixed {
    margin-top: 10px !important;
}

/* 入力画面の下部保存ボタンを非表示 */
#btn-save-input-footer {
    display: none !important;
}

@keyframes toast-animation {
    0% {
        opacity: 0;
        transform: translate(-50%, -100%);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }

    85% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -100%);
    }
}

/* === トグルスイッチのスタイル === */
.switch {
    position: relative;
    display: inline-block;
    width: 54px;
    height: 30px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e5d8c5;
    transition: .4s;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

input:checked+.slider {
    background-color: var(--color-income);
}

input:checked+.slider:before {
    transform: translateX(24px);
}

.slider.round {
    border-radius: 30px;
}

.slider.round:before {
    border-radius: 50%;
}

/* スマホ向け調整 */
@media (max-width: 480px) {
    .full-calendar-grid .calendar-day .day-num {
        font-size: 0.85rem;
    }

    .full-calendar-grid .calendar-day .day-expense,
    .full-calendar-grid .calendar-day .day-income {
        font-size: 0.5rem;
    }

    .full-calendar-grid {
        padding: 5px 2px;
    }
}

/* メモ入力欄の高さ調整 */
#input-memo {
    height: 60px;
    resize: none;
    font-family: inherit;
    font-size: 1rem;
    padding: 10px;
    border-radius: 10px;
    border: 1.5px solid #eee;
    color: var(--text-color);
}

/* 削除ボタンのスタイル調整 */
.btn-delete {
    background-color: #fff5f5;
    color: #ff8fa3 !important;
    border: 1.5px solid #ffe3e3;
    padding: 12px;
    border-radius: 15px;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    margin-top: 5px;
    display: block;
    width: 100%;
}

.btn-delete:active {
    transform: scale(0.98);
    background-color: #ffeaea;
}