/* ===== 収支入力パネル（v2: コンパクト中央ポップアップ） ===== */
.entry-panel {
    background: var(--bg-cream, #FFFDF8);
    width: 88%;
    max-width: 400px;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    z-index: 2001;
    overflow: hidden;
}
.entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: var(--primary-dark, #5B8C6A);
    color: #fff;
}
.entry-header-title { font-weight: 800; font-size: 1rem; }
.entry-close-btn {
    background: none; border: none; color: #fff; font-size: 1.2rem;
    cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.entry-close-btn:hover { background: rgba(255,255,255,0.15); }

/* タブ */
.entry-tab-bar {
    display: flex; gap: 0; background: var(--primary-dark, #5B8C6A); padding: 0 18px 12px;
}
.entry-tab {
    flex: 1; padding: 10px; border: none; border-radius: 10px;
    font-weight: 800; font-size: 0.95rem; cursor: pointer;
    background: transparent; color: rgba(255,255,255,0.6); transition: background 0.2s, color 0.2s;
}
.entry-tab.active {
    background: #fff; color: var(--text-main, #2C2A26);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* フォーム本体 */
.entry-body {
    padding: 18px; flex: 1; overflow-y: auto; overflow-x: hidden;
}
.entry-field { margin-bottom: 16px; overflow: hidden; }
.entry-label {
    display: block; font-size: 0.8rem; font-weight: 700;
    color: var(--text-muted); margin-bottom: 6px;
}
.entry-amount-row {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-warm); border-radius: 14px;
    padding: 12px 14px; border: 1.5px solid var(--border);
    min-height: 48px; overflow: hidden;
}
.entry-yen { font-size: 18px; font-weight: 800; color: var(--text-light); margin-right: 4px; }
.entry-amount-input {
    flex: 1; min-width: 0; border: none; background: transparent;
    font-size: clamp(18px, 5vw, 26px); font-weight: 900; color: var(--text-dark);
    font-family: 'M PLUS Rounded 1c', sans-serif;
    text-align: right; cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.entry-amount-input:focus { outline: none; }
.entry-amount-input.calculating {
    font-size: 18px; color: var(--text-mid);
}
.entry-amount-input::placeholder { color: var(--beige-dark, #C4B9A8); font-weight: 400; font-size: clamp(16px, 4vw, 22px); }
.entry-amount-row.focus { border-color: var(--primary-dark, #5B8C6A); }
.entry-category-row {
    display: flex; align-items: center; gap: 8px;
}
.entry-select {
    flex: 1; min-width: 0; padding: 12px 14px; border-radius: 14px;
    border: 1.5px solid var(--border); background: var(--bg-warm);
    font-size: 15px; font-family: inherit; color: var(--text-main);
    height: 48px; box-sizing: border-box;
}
.entry-cat-add-btn {
    width: 44px; height: 44px; border-radius: 14px;
    border: 1.5px solid var(--border); background: var(--bg-warm);
    font-size: 1.2rem; color: var(--primary-dark); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.entry-text-input {
    width: 100%; max-width: 100%; padding: 12px 14px; border-radius: 14px;
    border: 1.5px solid var(--border); background: var(--bg-warm);
    font-size: 15px; font-family: inherit; color: var(--text-main);
    height: 48px; box-sizing: border-box;
    -webkit-appearance: none; appearance: none;
}
.entry-text-input:focus, .entry-select:focus {
    outline: none; border-color: var(--primary-dark); background: #fff;
}
.entry-save-btn {
    width: 100%; padding: 14px; border: none; border-radius: 16px;
    background: var(--primary-dark, #5B8C6A); color: #fff;
    font-size: 1.05rem; font-weight: 800; cursor: pointer;
    margin-top: 8px; transition: opacity 0.2s;
}
.entry-save-btn:hover { opacity: 0.9; }

/* ===== キーパッド（v2: テンキー/電卓 切替式） ===== */
.kp {
    background: #ECEBE8;
    border-top: 1px solid var(--beige, #E8E0D4);
    flex-shrink: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    padding: 0 10px;
}
.kp.show {
    max-height: 320px;
    padding: 6px 10px 20px;
}
.kp-head {
    display: flex;
    justify-content: space-between;
    padding: 2px 2px 6px;
}
.kp-head button {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent, #5B8C6A);
    background: var(--bg-cream, #FFFDF8);
    border: 1px solid var(--beige, #E8E0D4);
    border-radius: 14px;
    padding: 3px 14px;
    cursor: pointer;
}
.kp-grid {
    display: grid;
    gap: 5px;
}
.kp-grid.mode-num {
    grid-template-columns: repeat(3, 1fr);
}
.kp-grid.mode-calc {
    grid-template-columns: repeat(4, 1fr);
}
.k {
    min-height: 44px;
    padding: 11px 0;
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    background: #fff;
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 8px;
    color: var(--text-dark, #2C2A26);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.1s;
}
.k:active { background: #EDF5EF; }
.k.fn {
    background: #E6E5E2;
    color: var(--text-mid, #6B665C);
    font-size: 18px;
}
.k.op {
    background: #EDF5EF;
    color: var(--accent, #5B8C6A);
    font-size: 19px;
    font-weight: 800;
    border-color: rgba(91, 140, 106, 0.12);
}
.k.op:active {
    background: var(--accent, #5B8C6A);
    color: #fff;
}
.k.eq {
    grid-column: span 4;
    background: var(--accent, #5B8C6A);
    color: #fff;
    font-weight: 900;
    font-size: 18px;
}
.k.eq:active { background: var(--accent-deep, #4A7A59); }
.k.blank { visibility: hidden; }

/* モーダル内成功メッセージ */
#entry-modal-success {
    text-align: center; padding: 10px; margin-top: 8px;
    border-radius: 12px; background: #edf5ef;
    color: var(--primary-dark); font-weight: 700; font-size: 0.9rem;
    transition: opacity 0.3s;
}

/* 旧モーダルスタイル（他モーダル用に残す） */
.modal .modal-content {
    background: white;
    border-radius: 30px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-hover);
}
.modal .modal-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px;
}
.modal .modal-header h2, .modal .modal-header h3 {
    font-family: 'Zen Kaku Gothic New', sans-serif; font-size: 1.5rem;
    color: var(--primary-dark); margin: 0;
}
.modal .close-btn {
    width: 44px; height: 44px; border-radius: 12px; border: none;
    background: var(--bg-warm); cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: background 0.3s ease, color 0.3s ease;
}
.modal .close-btn:hover { background: var(--primary-light); }
.modal .form-group { margin-bottom: 20px; }
.modal .form-group label {
    display: block; font-size: 0.85rem; font-weight: 800;
    color: var(--text-muted); margin-bottom: 10px;
}
.modal .form-group input, .modal .form-group select {
    width: 100%; padding: 15px; border-radius: 18px; border: 2px solid var(--border);
    font-size: 1rem; font-family: inherit; transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.modal .form-group input:focus, .modal .form-group select:focus {
    outline: none; border-color: var(--primary-dark); background: var(--bg-warm);
}

/* --- みんなの声（掲示板） --- */
.voice-board {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
}
.voice-board::-webkit-scrollbar { width: 6px; }
.voice-board::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }

.voice-card {
    transition: transform 0.15s, box-shadow 0.15s;
}
.voice-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.voice-like-btn:hover {
    border-color: var(--primary-dark) !important;
    color: var(--primary-dark) !important;
}

@media (max-width: 768px) {
    .dashboard-main-grid {
        grid-template-columns: 1fr !important;
    }
}

/* --- FP CTA（1人表示） --- */
.fp-cta-card {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 28px 30px;
}
.fp-cta-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.fp-cta-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid white;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-light), var(--bg-warm));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.12);
}
.fp-cta-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.fp-cta-photo span {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary-dark);
}
.fp-cta-fp-name {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--primary-dark);
    white-space: nowrap;
}
.fp-cta-fp-spec {
    font-size: 0.6rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.fp-cta-body {
    flex: 1;
}
.fp-cta-body h3 {
    margin-bottom: 10px;
}
.fp-cta-body p {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.fp-cta-btn {
    border-radius: 30px;
    padding: 15px 36px;
    font-weight: 800;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .fp-cta-card {
        flex-direction: column;
        text-align: center;
        gap: 16px;
        padding: 24px 20px;
    }
    .fp-cta-btn {
        width: 100%;
        padding: 14px;
    }
}

/* ===== オンボーディングモーダル ===== */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10002;
    overscroll-behavior: contain;
    opacity: 0;
    transition: opacity 0.4s ease;
    padding: 20px;
}
.onboarding-overlay.show {
    opacity: 1;
}

.onboarding-card {
    background: white;
    border-radius: 28px;
    padding: 32px 28px;
    max-width: 420px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(93, 74, 74, 0.2);
    transform: scale(0.85) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.onboarding-overlay.show .onboarding-card {
    transform: scale(1) translateY(0);
}

.onboarding-features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.onboarding-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 14px 8px;
    border-radius: 16px;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    min-height: 100px;
    box-sizing: border-box;
}

.onboarding-feature-icon {
    font-size: 1.6rem;
    margin-bottom: 6px;
}
.onboarding-feature-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}
.onboarding-feature-desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.onboarding-tip {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f5f0e6 0%, #f2ede3 100%);
    border: 1px solid #e8dcc8;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--text-main);
}

.onboarding-start-btn {
    width: 100%;
    border-radius: 30px !important;
    padding: 16px 20px !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
}

/* ===== カレンダーヒントバナー ===== */
.calendar-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: linear-gradient(135deg, #edf5ef 0%, #f0ede8 100%);
    border: 1px solid #c4dbc9;
    border-radius: 12px;
    padding: 12px 16px;
    margin-top: 14px;
    font-size: 0.85rem;
    color: var(--text-main);
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.calendar-hint.calendar-hint-show {
    opacity: 1;
    transform: translateY(0);
}
.calendar-hint.calendar-hint-dismiss {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.calendar-hint-ok {
    background: white;
    border: 1px solid #c4dbc9;
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}
.calendar-hint-ok:hover {
    background: #edf5ef;
}

/* ===== 消えない通知カードシステム ===== */

.notif-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 360px;
    pointer-events: none;
}

.notif-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px 14px;
    border-radius: 16px;
    background: white;
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    pointer-events: auto;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    flex-wrap: wrap;
}
.notif-card.notif-show {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.notif-card.notif-dismiss {
    opacity: 0;
    transform: translateY(-10px) scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 光が走るエフェクト */
.notif-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: notif-shine 2s ease-in-out 0.5s;
    pointer-events: none;
}
@keyframes notif-shine {
    0% { left: -100%; }
    100% { left: 100%; }
}

.notif-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.notif-body {
    flex: 1;
}
.notif-title {
    font-weight: 900;
    font-size: 0.85rem;
    color: var(--text-main);
    margin-bottom: 3px;
}
.notif-message {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.notif-confirm {
    width: 100%;
    margin-top: 8px;
    padding: 8px 0;
    background: var(--bg-warm);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-main);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
    font-family: 'M PLUS Rounded 1c', sans-serif;
}
.notif-confirm:hover {
    background: var(--primary-light);
    color: white;
}
.notif-confirm:active {
    transform: scale(0.97);
}

/* 通知タイプ別スタイル */
.notif-gold {
    background: linear-gradient(135deg, #f5f0e6 0%, #f2ede3 100%);
    border-color: #C4A265;
}
.notif-rank {
    background: linear-gradient(135deg, #edf5ef 0%, #fff 100%);
    border-color: var(--primary);
}
.notif-treasure {
    background: linear-gradient(135deg, #edf5ef 0%, #fff 100%);
    border-color: var(--success);
}
.notif-cooking {
    background: linear-gradient(135deg, #f5f0e6 0%, #edf5ef 100%);
    border-color: var(--warning);
}

/* 夢のマイホーム旗（ライフマップ） */
.lmh-node.lmh-dream .lmh-pin {
    border: 3px solid var(--success);
    animation: lmh-dream-glow 2.5s ease-in-out infinite;
}
.lmh-node.lmh-dream .lmh-node-card {
    background: linear-gradient(135deg, #edf5ef, #fff) !important;
    border: 1px solid rgba(91, 140, 106, 0.3);
}
.lmh-node.lmh-dream .lmh-node-title {
    color: var(--primary-dark);
}
@keyframes lmh-dream-glow {
    0%, 100% { box-shadow: 0 4px 12px rgba(91, 140, 106, 0.2); }
    50% { box-shadow: 0 6px 24px rgba(91, 140, 106, 0.5); }
}

/* --- Toggle Switch --- */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--border);
    border-radius: 28px;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.toggle-slider:before {
    content: "";
    position: absolute;
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* ===== モードタブ ===== */
.mode-tabs-wrapper {
    position: relative;
}
.mode-tabs-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 32px;
    background: linear-gradient(to right, transparent, var(--bg-warm));
    pointer-events: none;
    z-index: 1;
}
.mode-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0;
}
.mode-tabs::-webkit-scrollbar { display: none; }

.mode-tab-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    min-height: 44px;
    border-radius: 20px;
    border: 1.5px solid var(--border);
    background: var(--card-bg, #fff);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    flex-shrink: 0;
}
.mode-tab-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.mode-tab-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(91, 140, 106, 0.2);
}

/* ===== Day Detail Modal (Section 3) ===== */
#day-detail-area:not(:empty) {
    background: var(--bg-cream);
    border-radius: 16px;
    padding: 0;
    margin-top: 16px;
}

.detail-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--beige);
}
.detail-modal-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-dark);
}
.detail-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.detail-rows {
    padding: 0 16px;
}

.detail-row {
    padding: 12px 0;
    border-bottom: 1px solid var(--beige);
}
.detail-row-editable {
    cursor: pointer;
    transition: background 0.15s;
    border-radius: 8px;
    margin: 0 -8px;
    padding: 12px 8px;
}
.detail-row-editable:hover {
    background: rgba(91, 140, 106, 0.05);
}
.detail-row-editing {
    background: rgba(91, 140, 106, 0.05);
}

.detail-row-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.detail-row-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.detail-cat {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-dark);
}
.detail-memo {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.detail-amt {
    font-weight: 800;
    font-size: 0.95rem;
    white-space: nowrap;
    margin-left: 12px;
}

/* 編集フォーム */
.detail-edit-form {
    margin-top: 10px;
    padding: 14px;
    background: white;
    border-radius: 12px;
    border: 1px solid var(--beige);
}
.detail-edit-title {
    font-weight: 800;
    font-size: 0.85rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}
.detail-edit-field {
    margin-bottom: 10px;
}
.detail-edit-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.detail-edit-field input,
.detail-edit-field select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--beige);
    border-radius: 8px;
    font-size: 0.9rem;
    background: var(--bg-cream);
    color: var(--text-dark);
    font-family: inherit;
}
.detail-edit-field input:focus,
.detail-edit-field select:focus {
    outline: none;
    border-color: var(--accent);
}
.detail-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}
.edit-cancel-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--beige);
    border-radius: 8px;
    background: white;
    color: var(--text-light);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
}
.edit-delete-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: #D4897A;
    color: white;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
}
.edit-save-btn {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: white;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
}

/* 合計エリア */
.detail-summary {
    padding: 12px 16px;
    border-top: 1px solid var(--beige);
    background: rgba(91, 140, 106, 0.04);
}
.detail-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 3px 0;
}
.detail-summary-row span:first-child {
    color: var(--text-muted);
}

/* 明細追加ボタン */
.detail-add-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    color: var(--accent);
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    text-align: center;
    border-top: 1px solid var(--beige);
    font-family: inherit;
}
.detail-add-btn:hover {
    background: rgba(91, 140, 106, 0.05);
}

/* ===== Calendar Mode Tabs (Section 4) ===== */
.cal-mode {
    font-size: 12px;
    padding: 6px 16px;
    border-radius: 16px;
    border: 1px solid var(--beige);
    background: none;
    color: var(--text-light);
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}
.cal-mode.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 800;
}

/* ===== 体験先行オンボーディング ===== */
#onboarding-overlay.onboarding-overlay {
    position: fixed; inset: 0; z-index: 1500;
    background: linear-gradient(180deg, var(--bg-warm, #F6F3EE), #fff);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 24px;
    opacity: 1; backdrop-filter: none; transition: none; transform: none;
}
#onboarding-overlay.onboarding-overlay.hidden { display: none; }
.onboarding-step-card {
    background: white; border-radius: 28px; padding: 40px 28px;
    max-width: 400px; width: 100%; text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.06);
}
.onboarding-badge {
    display: inline-block; background: var(--primary-dark, #5B8C6A); color: #fff;
    font-size: 0.75rem; font-weight: 700; padding: 4px 14px; border-radius: 12px; margin-bottom: 16px;
}
.onboarding-step-emoji { font-size: 3rem; margin-bottom: 12px; }
.onboarding-step-title {
    font-family: 'Zen Kaku Gothic New', sans-serif; font-size: 1.3rem;
    font-weight: 900; color: var(--primary-dark, #5B8C6A); margin-bottom: 8px;
}
.onboarding-step-subtitle {
    font-size: 0.9rem; color: var(--text-main, #2C2A26); margin-bottom: 12px; line-height: 1.7;
}
.onboarding-step-examples {
    font-size: 0.78rem; color: var(--text-muted, #8A8578); margin-bottom: 24px;
}
.onboarding-step-btn {
    display: inline-block; background: var(--primary-dark, #5B8C6A); color: white;
    font-size: 1.1rem; font-weight: 800; padding: 16px 48px; border-radius: 35px;
    border: none; cursor: pointer; box-shadow: 0 6px 20px rgba(91,140,106,0.25);
    transition: transform 0.2s, box-shadow 0.2s;
}
.onboarding-step-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(91,140,106,0.35); }
.onboarding-step-card { position: relative; }
.onboarding-skip-btn {
    position: absolute; top: 12px; right: 14px;
    background: none; border: none; font-size: 1.5rem; color: var(--text-muted, #8A8578);
    cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 50%;
    transition: background 0.2s;
}
.onboarding-skip-btn:hover { background: var(--bg-warm, #F7F5F0); }
.onboarding-login-link {
    display: inline-block; margin-top: 24px; font-size: 0.9rem; font-weight: 600;
    color: var(--primary-dark, #5B8C6A); text-decoration: none;
    cursor: pointer; padding: 10px 20px; border: 1.5px solid var(--primary-dark, #5B8C6A);
    border-radius: 20px; transition: background 0.2s, color 0.2s;
}
.onboarding-login-link:hover { color: #fff; background: var(--primary-dark, #5B8C6A); }
.onboarding-progress { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.onboarding-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border, #E0DDD8); transition: background 0.3s, transform 0.3s; }
.onboarding-dot.active { background: var(--primary-dark, #5B8C6A); transform: scale(1.3); }
.onboarding-dot.completed { background: var(--primary-dark, #5B8C6A); }

/* ===== 登録モーダル ===== */
.registration-overlay {
    position: fixed; inset: 0; z-index: 2500;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 20px;
    opacity: 0; transition: opacity 0.3s ease; pointer-events: none;
}
.registration-overlay.show { opacity: 1; pointer-events: auto; }
.registration-overlay.hidden { display: none; }
.registration-card {
    background: white; border-radius: 28px; padding: 36px 28px;
    max-width: 440px; width: 100%; box-shadow: 0 12px 48px rgba(0,0,0,0.12);
    max-height: 90vh; overflow-y: auto;
}
.reg-title {
    font-family: 'Zen Kaku Gothic New', sans-serif; font-size: 1.2rem;
    font-weight: 900; color: var(--text-main); text-align: center; line-height: 1.5; margin-bottom: 4px;
}
.reg-subtitle { text-align: center; font-size: 0.82rem; color: var(--text-muted); margin-bottom: 16px; }
.reg-benefits {
    background: var(--bg-warm, #F6F3EE); border-radius: 14px; padding: 12px 16px; margin-bottom: 20px;
}
.reg-benefit-item {
    display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-main); padding: 5px 0;
}
.reg-check { color: var(--primary-dark, #5B8C6A); font-weight: 900; }
.reg-label { display: block; font-size: 0.75rem; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }
.reg-input {
    width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px;
    font-size: 0.95rem; color: var(--text-main); margin-bottom: 12px;
    box-sizing: border-box;
}
.reg-input:focus { outline: none; border-color: var(--primary-dark); }
.reg-btn {
    width: 100%; padding: 14px; border: none; border-radius: 14px; font-size: 0.95rem;
    font-weight: 700; cursor: pointer; margin-bottom: 8px;
}
.reg-btn-primary { background: var(--primary-dark, #5B8C6A); color: #fff; }
.reg-separator {
    text-align: center; font-size: 0.78rem; color: var(--text-muted); margin: 14px 0;
    position: relative;
}
.reg-separator::before, .reg-separator::after {
    content: ''; position: absolute; top: 50%; width: 30%; height: 1px; background: var(--border);
}
.reg-separator::before { left: 0; }
.reg-separator::after { right: 0; }
.reg-btn-google {
    background: #fff; border: 1.5px solid var(--border); color: var(--text-main);
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.reg-later-btn {
    width: 100%; background: none; border: none; font-size: 0.82rem;
    color: var(--text-muted); cursor: pointer; text-align: center; padding: 10px;
    text-decoration: underline; margin-top: 4px;
}
.reg-warn { text-align: center; font-size: 0.72rem; color: #D4897A; margin-top: 8px; line-height: 1.5; }

/* ===== ゲスト登録バナー ===== */
#guest-registration-banner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 18px; background: linear-gradient(135deg, #edf5ef, #fff);
    border: 1.5px solid var(--primary-dark, #5B8C6A); border-radius: 14px;
    margin-bottom: 16px; font-size: 0.82rem; font-weight: 700; color: var(--primary-dark);
}
#guest-registration-banner button {
    background: var(--primary-dark, #5B8C6A); color: white; border: none;
    padding: 8px 18px; border-radius: 20px; font-weight: 800; font-size: 0.8rem; cursor: pointer;
}

/* ===== カルテ 2タブバー ===== */
.carte-tab-bar {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: var(--bg-warm);
    border-radius: 14px;
    padding: 4px;
}
.carte-tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 11px;
    background: transparent;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    font-family: inherit;
}
.carte-tab-btn.active {
    background: white;
    color: var(--text-main);
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
/* ============================================================
   体験モーダル (Experience Modal) - 7画面フロー
   ============================================================ */
.experience-overlay {
    position: fixed; inset: 0; z-index: 10001;
    background: linear-gradient(180deg, var(--bg-warm, #F6F3EE) 0%, #F0EDE4 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 24px 20px;
    overflow-y: auto;
}
.experience-overlay.hidden { display: none; }

.experience-bg {
    display: flex; align-items: center; justify-content: center;
    width: 100%; max-width: 420px;
}
.experience-bg-circle {
    position: fixed; border-radius: 50%; pointer-events: none;
}
.experience-bg-circle-1 {
    top: -100px; right: -100px; width: 300px; height: 300px;
    background: radial-gradient(circle, var(--primary-light, #EDF5EF) 0%, transparent 70%); opacity: 0.5;
}
.experience-bg-circle-2 {
    bottom: -80px; left: -80px; width: 250px; height: 250px;
    background: radial-gradient(circle, #F5E6D5 0%, transparent 70%); opacity: 0.4;
}

.experience-card {
    background: white; border-radius: 20px; padding: 36px 28px;
    max-width: 380px; width: 100%;
    box-shadow: 0 4px 24px rgba(91, 140, 106, 0.08);
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1; transform: translateY(0);
}
.experience-card.fade-out { opacity: 0; transform: translateY(12px); }
.experience-card.fade-in { opacity: 1; transform: translateY(0); }

/* Logo mark */
.exp-logo-mark {
    text-align: center; margin-bottom: 20px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.exp-logo-mark {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 14px; margin: 0 auto 20px;
    background: var(--primary-light, #EDF5EF); border-radius: 20px;
    font-size: 13px; font-weight: 600; color: var(--primary-dark, #5B8C6A);
}
.exp-logo-icon { font-size: 16px; }

/* Progress dots */
.exp-progress-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 28px; }
.exp-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--border, #E0DDD8); transition: background 0.3s, width 0.3s; }
.exp-dot.active { width: 24px; background: var(--primary-dark, #5B8C6A); }
.exp-dot.completed { background: var(--primary-dark, #5B8C6A); }

/* Typography */
.exp-heading {
    font-size: 22px; font-weight: 700; color: var(--text-main, #2C2A26);
    line-height: 1.5; text-align: center; margin-bottom: 24px;
}
.exp-subtext {
    font-size: 14px; color: var(--text-muted, #6B6B6B);
    text-align: center; line-height: 1.7; margin-bottom: 24px;
}
.exp-accent-text { color: var(--danger, #C4793D); }
.exp-olive-text { color: var(--primary-dark, #5B8C6A); }

/* Trust badges */
.exp-trust-badges {
    background: var(--bg-warm, #F6F3EE); border-radius: 12px;
    padding: 16px; margin-bottom: 24px;
    display: flex; justify-content: space-around; text-align: center;
}
.exp-trust-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.exp-trust-icon { font-size: 24px; }
.exp-trust-label { font-size: 11px; color: var(--text-muted, #6B6B6B); }

/* Input */
.exp-input {
    width: 100%; padding: 14px 16px; font-size: 16px;
    border: 2px solid var(--border, #E0DDD8); border-radius: 12px;
    background: var(--bg-warm, #F6F3EE);
    color: var(--text-main, #2C2A26); box-sizing: border-box; transition: border-color 0.2s;
}
.exp-input:focus { outline: none; border-color: var(--primary-dark, #5B8C6A); }

/* Option buttons */
.exp-options { margin-bottom: 8px; }
.exp-option-btn {
    width: 100%; padding: 14px 16px; font-size: 15px; font-weight: 400;
    color: var(--text-main, #2C2A26); background: var(--bg-warm, #F6F3EE);
    border: 2px solid var(--border, #E0DDD8); border-radius: 12px;
    cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; text-align: left; margin-bottom: 8px;
}
.exp-option-btn.selected {
    font-weight: 600; color: var(--primary-dark, #5B8C6A);
    background: var(--primary-light, #EDF5EF); border-color: var(--primary-dark, #5B8C6A);
}

/* Primary button */
.exp-primary-btn {
    width: 100%; padding: 16px; font-size: 16px; font-weight: 600;
    color: white; background: var(--primary-dark, #5B8C6A);
    border: none; border-radius: 12px; cursor: pointer;
    transition: opacity 0.2s; margin-top: 16px;
}
.exp-primary-btn:hover { opacity: 0.9; }
.exp-primary-btn.disabled { opacity: 0.4; pointer-events: none; }
.exp-primary-btn.accent { background: var(--danger, #C4793D); }

/* Secondary button */
.exp-secondary-btn {
    width: 100%; padding: 12px; font-size: 14px; font-weight: 500;
    color: var(--text-muted, #6B6B6B); background: transparent;
    border: 1px solid var(--border, #E0DDD8); border-radius: 12px;
    cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; margin-top: 8px;
}

/* LINE button */
.exp-line-btn { background: #06C755; margin-top: 16px; }

/* Result screen */
.exp-result-label { text-align: center; font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.exp-result-main { text-align: center; padding: 24px 0; margin-bottom: 16px; }
.exp-result-prefix { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.exp-amount {
    font-size: 0; font-weight: 800; color: var(--danger, #C4793D);
    transition: font-size 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1); opacity: 0; line-height: 1.2;
}
.exp-amount.reveal { font-size: 48px; opacity: 1; }
.exp-result-suffix {
    font-size: 14px; color: var(--text-muted); margin-top: 8px;
    opacity: 0; transition: opacity 0.4s 0.4s;
}
.exp-result-suffix.reveal { opacity: 1; }

/* Breakdown */
.exp-breakdown {
    background: var(--bg-warm, #F6F3EE); border-radius: 12px;
    padding: 16px; margin-bottom: 16px;
    opacity: 0; transition: opacity 0.4s 0.6s;
}
.exp-breakdown.reveal { opacity: 1; }
.exp-breakdown-row {
    display: flex; justify-content: space-between; margin-bottom: 8px;
    font-size: 13px; color: var(--text-muted);
}
.exp-breakdown-val { font-weight: 600; color: var(--text-main); }
.exp-breakdown-val.accent { font-size: 14px; font-weight: 700; color: var(--danger, #C4793D); }
.exp-breakdown-total {
    border-top: 1px solid var(--border); padding-top: 8px; margin-bottom: 0;
}

/* Metabo badge */
.exp-metabo-badge {
    border-radius: 12px; padding: 16px; text-align: center; margin-bottom: 20px;
    opacity: 0; transition: opacity 0.4s 0.8s;
}
.exp-metabo-badge.reveal { opacity: 1; }
.exp-metabo-danger { background: #FFF0EF; }
.exp-metabo-warning { background: #F5E6D5; }
.exp-metabo-good { background: var(--primary-light, #EDF5EF); }
.exp-metabo-emoji { font-size: 20px; margin-bottom: 4px; }
.exp-metabo-label { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.exp-metabo-danger .exp-metabo-label { color: var(--danger); }
.exp-metabo-warning .exp-metabo-label { color: var(--warning, #C4793D); }
.exp-metabo-good .exp-metabo-label { color: var(--primary-dark); }
.exp-metabo-ratio { font-size: 12px; color: var(--text-muted); }

/* Commit screen */
.exp-commit-box {
    background: var(--bg-warm, #F6F3EE); border-radius: 12px;
    padding: 20px; text-align: center; margin-bottom: 24px;
}
.exp-commit-prefix { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.exp-commit-amount { font-size: 28px; font-weight: 800; color: var(--danger, #C4793D); margin-bottom: 8px; }
.exp-commit-question { font-size: 16px; font-weight: 600; color: var(--text-main); }

/* CTA features */
.exp-features-box {
    background: var(--primary-light, #EDF5EF); border-radius: 12px;
    padding: 16px; margin-bottom: 24px;
}
.exp-features-title { font-size: 13px; color: var(--primary-dark); font-weight: 600; margin-bottom: 12px; }
.exp-feature-item { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.exp-feature-item:last-child { margin-bottom: 0; }
.exp-feature-check {
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--primary-dark); color: white;
    font-size: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.exp-feature-item span { font-size: 13px; color: var(--text-main); }

/* CTA sections */
.exp-cta-section { margin-bottom: 4px; }
.exp-cta-label { font-size: 12px; font-weight: 700; color: var(--text-main); margin-bottom: 8px; }
.exp-cta-desc { font-size: 11px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; text-align: center; }
.exp-cta-divider { display: flex; align-items: center; gap: 12px; margin: 16px 0; }
.exp-cta-divider::before, .exp-cta-divider::after { content: ''; flex: 1; height: 1px; background: var(--border-light, #e0dbd4); }
.exp-cta-divider span { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.exp-cta-achievement { font-size: 11px; font-weight: 700; color: #E8734A; margin-bottom: 10px; }
.exp-line-btn {
    background: #06C755; color: #fff; border: none; border-radius: 10px;
    padding: 14px; font-size: 14px; font-weight: 700; cursor: pointer;
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px;
    box-shadow: 0 4px 14px rgba(6,199,85,0.3); font-family: inherit;
}
.exp-cta-note { text-align: center; margin-top: 16px; font-size: 11px; color: var(--text-muted); }

/* Scare screen (not committed) */
.exp-scare-box {
    background: var(--bg-warm); border-radius: 12px;
    padding: 20px; text-align: center; margin-bottom: 16px;
}
.exp-scare-text { font-size: 14px; color: var(--text-muted); line-height: 1.8; }
.exp-scare-amount { font-size: 22px; font-weight: 800; color: var(--danger); display: inline; }
.exp-scare-total { font-size: 32px; font-weight: 800; color: var(--danger); margin-top: 12px; }
.exp-scare-note { font-size: 12px; color: var(--text-muted); margin-top: 4px; }


/* ============================================================
   入力タブ - セクション & 折りたたみ
   ============================================================ */
.input-section { margin-bottom: 16px; }
.input-section-header {
    font-size: 1rem; font-weight: 900; color: var(--primary-dark, #5B8C6A);
    margin-bottom: 14px; display: flex; align-items: center; gap: 8px;
}
.collapsible-header {
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.collapsible-body { max-height: 3000px; overflow: hidden; transition: max-height 0.35s ease; }
.collapsible-body.collapsed { max-height: 0; }
.collapse-icon { transition: transform 0.3s; width: 20px; height: 20px; color: var(--text-muted); }

/* ===== スケルトンローダー ===== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-warm) 25%, #ede9e3 50%, var(--bg-warm) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { height: 1em; margin-bottom: 8px; }
.skeleton-chart { height: 200px; }
.skeleton-card { height: 120px; margin-bottom: 12px; }

