:root {
    --primary: #f8c8c8;
    --primary-light: #fbe6e6;
    --primary-dark: #e59a9a;
    --accent: #9dc08b;
    --accent-light: #f0f7ec;
    --bg-warm: #fff9f9;
    --text-main: #5d4a4a;
    --text-muted: #a39393;
    --border: #f4ecee;
    --danger: #ffb4b4;
    --success: #b4e4b4;
    --shadow: 0 12px 40px rgba(189, 150, 150, 0.12);
    --shadow-hover: 0 20px 50px rgba(189, 150, 150, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'M PLUS Rounded 1c', sans-serif;
}

body {
    background-color: var(--bg-warm);
    background-image:
        radial-gradient(at 0% 0%, rgba(248, 200, 200, 0.25) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(157, 192, 139, 0.15) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    padding-top: 80px;
    scroll-behavior: smooth;
}

/* Nav */
.glass-nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 70px;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.85);
    border-bottom: 2px solid var(--border);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-content {
    max-width: 1100px;
    margin: 0 auto;
    width: 90%;
    display: flex;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.accent-text {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    padding: 10px;
    border-radius: 12px;
}

.nav-links a.active {
    color: var(--text-main);
    background: var(--primary-light);
}

/* Layout */
.content {
    max-width: 1100px;
    margin: 0 auto;
    width: 90%;
    padding: 20px 0;
}

.dashboard-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
}

.header-right {
    display: flex;
    justify-content: flex-end;
}

.dashboard-header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.status-ok {
    color: var(--accent);
    font-weight: 800;
}

/* Cards */
.glass-card {
    background: white;
    border-radius: 32px;
    padding: 30px;
    box-shadow: var(--shadow);
    border: 1px solid white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.stat-card:hover {
    transform: translateY(-8px);
}

.card-title {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    font-weight: 600;
}

.card-value {
    font-size: 2.2rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

.expense-text {
    color: var(--primary-dark);
}

.recurring-text {
    color: #887BB0;
}

.card-footer {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Calendar */
.calendar-section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.calendar-day {
    aspect-ratio: 1;
    background: #fffcfd;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.calendar-day:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(189, 150, 150, 0.15);
    background: white;
    border-color: var(--primary-light);
}

.calendar-day:active {
    transform: translateY(0);
}

.calendar-day.today {
    border: 2px solid var(--primary);
    background: var(--primary-light);
}

.day-num {
    font-size: 0.85rem;
    font-weight: 600;
}

.day-val {
    font-size: 0.75rem;
    text-align: right;
    font-weight: 700;
    color: var(--primary-dark);
}

/* Mortgage Tool */
.mortgage-tool {
    background: linear-gradient(135deg, #ffffff 0%, #fff5f5 100%);
    border: 2px solid var(--primary-light);
}

.tool-header .badge {
    background: var(--primary-dark);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    display: inline-block;
    margin-bottom: 10px;
}

.simulator-layout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 40px;
    margin-top: 30px;
}

.input-group {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-group input {
    border: none;
    font-size: 1.4rem;
    font-weight: 700;
    width: 80%;
    background: transparent;
    color: var(--text-main);
}

.input-group .unit {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.result-box {
    background: white;
    border-radius: 24px;
    padding: 25px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.02);
    text-align: center;
    margin-bottom: 20px;
}

.result-box .label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.result-box .value {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--primary-dark);
    font-family: 'Outfit';
    margin: 10px 0;
}

.simulation-cta {
    background: var(--primary-light);
    padding: 25px;
    border-radius: 20px;
    text-align: center;
}

.simulation-cta p {
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.6;
    font-weight: 600;
}

/* Buttons */
.btn {
    border: none;
    padding: 14px 24px;
    border-radius: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap !important;
}

.btn:active {
    transform: scale(0.96);
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.1rem;
    border-radius: 35px;
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: var(--primary-dark);
    color: white;
    box-shadow: 0 8px 20px rgba(229, 154, 154, 0.3);
}

.btn-primary:hover {
    background: #df8a8a;
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(229, 154, 154, 0.4);
}

.btn-secondary {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.btn-accent {
    background: var(--accent);
    color: white;
    box-shadow: 0 8px 20px rgba(157, 192, 139, 0.3);
}

.btn-accent:hover {
    background: #89ae77;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary-dark);
    color: var(--primary-dark);
    background: white;
}

/* User Menu Dropdown */
.user-menu-container {
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-light);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-main);
}

.user-profile:hover {
    background: var(--primary);
    color: white;
}

.avatar {
    width: 28px;
    height: 28px;
    background: white;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 800;
}

.dropdown-menu {
    position: absolute;
    top: 55px;
    right: 0;
    width: max-content;
    min-width: 220px;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 10px;
    z-index: 2000;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.dropdown-menu a {
    text-decoration: none;
    color: var(--text-main);
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: 0.2s;
    white-space: nowrap !important;
}

.dropdown-menu a:hover {
    background: var(--bg-warm);
    color: var(--primary-dark);
}

.dropdown-menu i {
    width: 16px;
}

.menu-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(93, 74, 74, 0.4);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.hidden {
    display: none;
}

/* Modal & Form Refinement */
.modal-content {
    background: white;
    border-radius: 40px;
    padding: 40px;
    box-shadow: 0 30px 60px rgba(93, 74, 74, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.8);
    position: relative;
    max-width: 90%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--text-main);
    font-weight: 800;
}

.close-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.3s;
    color: var(--text-muted);
}

.close-btn:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
    transform: rotate(90deg);
}

.tab-container {
    display: flex;
    background: var(--bg-warm);
    padding: 6px;
    border-radius: 20px;
    margin-bottom: 25px;
}

.tab-btn {
    flex: 1;
    border: none;
    padding: 10px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.9rem;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.3s;
}

.tab-btn.active {
    background: white;
    color: var(--primary-dark);
    box-shadow: 0 4px 12px rgba(248, 200, 200, 0.2);
    white-space: nowrap !important;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 8px;
    margin-left: 5px;
}

.input-with-icon {
    display: flex;
    align-items: center;
    background: var(--bg-warm);
    border-radius: 18px;
    padding: 5px 15px;
    border: 2px solid transparent;
    transition: 0.3s;
}

.input-with-icon:focus-within {
    border-color: var(--primary-light);
    background: white;
    box-shadow: 0 0 0 4px rgba(248, 200, 200, 0.1);
}

.input-with-icon i {
    color: var(--text-muted);
    width: 18px;
    margin-right: 12px;
}

.input-with-icon input,
.input-with-icon select {
    border: none;
    background: transparent;
    width: 100%;
    padding: 10px 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    outline: none;
}

.input-with-icon input::placeholder {
    color: #d1c8c8;
}

.category-add-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.btn-icon {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.btn-icon:hover {
    background: var(--primary-dark);
    color: white;
    transform: scale(1.05);
}

.btn-icon-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}

.btn-icon-sm:hover {
    background: var(--primary-dark);
    color: white;
    transform: scale(1.1);
}

.btn-icon-sm svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 800px) {
    .simulator-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Landing Page Specific */
.hero-section {
    padding: 50px 0 30px;
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr;
    text-align: center;
    gap: 30px;
}

.hero-text {
    max-width: 700px;
    margin: 0 auto;
}

.hero-text h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 24px;
    font-family: 'Kiwi Maru', serif;
}

.highlight {
    color: var(--primary-dark);
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 0;
    width: 100%;
    height: 12px;
    background: var(--primary-light);
    z-index: -1;
    opacity: 0.6;
}

.hero-text p {
    font-size: 1.05rem;
    color: var(--text-muted);
    margin-bottom: 30px;
    line-height: 1.8;
}

.hero-ctas {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
}

.section-title h2 {
    font-size: 2.2rem;
    margin-bottom: 12px;
    font-family: 'Kiwi Maru', serif;
}

.features-section {
    padding: 50px 0 70px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.f-card {
    padding: 40px 30px;
    text-align: center;
    transition: 0.4s;
    background: white;
    border-radius: 25px;
    box-shadow: var(--shadow);
}

.f-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.f-icon {
    width: 50px;
    height: 50px;
    color: var(--primary-dark);
    margin-bottom: 20px;
}

/* App Showcase Responsive */
@media (max-width: 700px) {
    .hero-text h1 {
        font-size: 2rem;
    }

    .lp-mock-dashboard {
        grid-template-columns: 1fr !important;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* Auth Modal Styles */
.auth-content {
    max-width: 450px !important;
}

.auth-divider {
    margin: 25px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    padding: 0 15px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===== Dashboard Styles ===== */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
}

#dashboard-view .dashboard-header {
    margin-bottom: 40px;
}

#dashboard-view .dashboard-header h1 {
    font-family: 'Kiwi Maru', serif;
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

#dashboard-view .dashboard-header .subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* サマリーカード */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.summary-card {
    background: white;
    border-radius: 30px;
    padding: 30px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-light), var(--primary-dark));
}

.summary-card.income::before {
    background: linear-gradient(90deg, #81C784, #4CAF50);
}

.summary-card.expense::before {
    background: linear-gradient(90deg, #FFB74D, #FF9800);
}

.summary-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.summary-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-warm);
}

.summary-card-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--primary-dark);
    font-family: 'Outfit', sans-serif;
}

.summary-card.income .summary-card-value {
    color: #4CAF50;
}

.summary-card.expense .summary-card-value {
    color: #FF9800;
}

/* カレンダーセクション */
.calendar-section {
    background: white;
    border-radius: 30px;
    padding: 35px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.calendar-header h2 {
    font-family: 'Kiwi Maru', serif;
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin: 0;
}

.calendar-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.calendar-controls button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 2px solid var(--border);
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.calendar-controls button:hover {
    background: var(--bg-warm);
    border-color: var(--primary-light);
}

.calendar-month {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary-dark);
}

/* カレンダーグリッド */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.calendar-day-name {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 10px;
}

.calendar-day {
    min-height: 90px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 12px 8px 8px 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
}

.calendar-day:hover {
    background: var(--bg-warm);
    border-color: var(--primary-light);
    transform: scale(1.05);
}

.calendar-day.today {
    background: var(--primary-light);
    border-color: var(--primary-dark);
    color: var(--primary-dark);
    font-weight: 900;
}

.calendar-day.has-data {
    border-color: var(--primary-dark);
}

.calendar-day.other-month {
    color: var(--text-muted);
    opacity: 0.5;
}

.calendar-day-number {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.calendar-day-expense {
    font-size: 0.7rem;
    color: #FF6B6B;
    margin-top: 2px;
    font-weight: 600;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.calendar-day-income {
    font-size: 0.7rem;
    color: #4CAF50;
    margin-top: 2px;
    font-weight: 600;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* クイックアクション */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.quick-action-btn {
    background: white;
    border: 2px solid var(--border);
    border-radius: 25px;
    padding: 20px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    font-weight: 800;
    font-size: 1rem;
    color: var(--primary-dark);
}

.quick-action-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.quick-action-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--bg-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-dark);
}

/* 収支入力モーダル（Claudeモデルの .modal + .hidden で制御） */

.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: 'Kiwi Maru', serif;
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin: 0;
}

.modal .close-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: none;
    background: var(--bg-warm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal .close-btn:hover {
    background: var(--primary-light);
}

.modal .tab-container {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    background: var(--bg-warm);
    border-radius: 18px;
    padding: 6px;
}

.modal .tab-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-weight: 800;
    font-size: 1rem;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.modal .tab-btn.active {
    background: white;
    color: var(--primary-dark);
    box-shadow: var(--shadow);
}

.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: all 0.3s ease;
}

.modal .form-group input:focus,
.modal .form-group select:focus {
    outline: none;
    border-color: var(--primary-dark);
    background: var(--bg-warm);
}

/* --- FP家計ランクバッジ --- */
.fp-score-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fp-score-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.fp-rank-badge {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.fp-rank-letter {
    font-size: 2rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-family: 'Outfit', sans-serif;
}

/* --- 家計改善証明書モーダル --- */
.certificate-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.certificate-overlay.show {
    opacity: 1;
}

.certificate-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transform: scale(0.8);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.certificate-overlay.show .certificate-card {
    transform: scale(1);
}

.certificate-border {
    background: linear-gradient(135deg, #FFD700 0%, #FFA000 25%, #FFD700 50%, #FFA000 75%, #FFD700 100%);
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(255, 215, 0, 0.3);
}

.certificate-inner {
    background: linear-gradient(180deg, #fffef5 0%, #fff8e1 100%);
    padding: 50px 60px;
    border-radius: 8px;
    min-width: 520px;
    max-width: 600px;
}

.certificate-title {
    text-align: center;
    font-size: 1.8rem;
    font-weight: 900;
    color: #5d4a4a;
    letter-spacing: 6px;
}

.certificate-subtitle {
    text-align: center;
    font-size: 0.75rem;
    color: #b0a090;
    letter-spacing: 3px;
    margin-top: 6px;
    font-family: 'Outfit', serif;
}

.certificate-divider {
    margin: 20px auto;
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FFD700, transparent);
}

.certificate-body {
    text-align: center;
    font-size: 0.95rem;
    color: #5d4a4a;
}

.certificate-close {
    border-radius: 30px;
    padding: 12px 40px;
    font-weight: 800;
}

/* ===== 未来への航路（ライフマップ） ===== */

/* クリアリティバー */
.lm-clarity-bar {
    height: 10px;
    background: var(--bg-warm);
    border-radius: 10px;
    overflow: hidden;
}
.lm-clarity-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #e59a9a, #f7d060, #4CAF50);
    transition: width 1.5s ease;
}

/* タイムライン中央の航路 */
.lm-timeline-track {
    position: absolute;
    left: 50%;
    top: 60px;
    bottom: 60px;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-light), var(--border) 60%, rgba(200,200,200,0.2));
    transform: translateX(-50%);
    border-radius: 4px;
    overflow: hidden;
}

.lm-path-glow {
    width: 100%;
    background: linear-gradient(180deg, #f7d060, var(--accent), transparent);
    border-radius: 4px;
    opacity: 0.7;
    transition: height 2s ease;
}

/* 起点ドット */
.lm-origin {
    position: relative;
    text-align: center;
    margin-bottom: 20px;
    z-index: 2;
}
.lm-origin-dot {
    width: 18px;
    height: 18px;
    background: var(--accent);
    border: 3px solid white;
    border-radius: 50%;
    margin: 0 auto 8px;
    box-shadow: 0 0 12px rgba(157, 192, 139, 0.6);
    animation: lm-pulse 2s ease-in-out infinite;
}
.lm-origin span {
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--text-main);
}

@keyframes lm-pulse {
    0%, 100% { box-shadow: 0 0 12px rgba(157, 192, 139, 0.4); transform: scale(1); }
    50% { box-shadow: 0 0 24px rgba(157, 192, 139, 0.8); transform: scale(1.15); }
}

/* タイムラインノード配置 */
.lm-timeline-nodes {
    position: relative;
}

/* 年マーカー（5年刻み） */
.lm-year-marker {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}
.lm-year-marker span {
    display: inline-block;
    background: var(--bg-warm);
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* マイルストーンノード */
.lm-node {
    position: absolute;
    width: 45%;
    z-index: 3;
}
.lm-node-left {
    left: 2%;
}
.lm-node-right {
    right: 2%;
}

.lm-node-connector {
    position: absolute;
    top: 50%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-light), var(--border));
    z-index: 1;
}
.lm-node-left .lm-node-connector {
    right: -8%;
    width: 8%;
}
.lm-node-right .lm-node-connector {
    left: -8%;
    width: 8%;
}

.lm-node-card {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-radius: 18px;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.lm-node-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.lm-node-icon {
    font-size: 2rem;
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.lm-node-title {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--text-main);
}
.lm-node-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* 達成済み */
.lm-achieved {
    border-left: 4px solid var(--accent);
    background: linear-gradient(135deg, #f0f7ec 0%, white 100%);
}
.lm-achieved .lm-node-title::after {
    content: ' ✅';
}

/* 近い未来（5年以内） */
.lm-near {
    border-left: 4px solid #f7d060;
}
.lm-near .lm-node-icon {
    animation: lm-near-glow 3s ease-in-out infinite;
}

@keyframes lm-near-glow {
    0%, 100% { box-shadow: 0 4px 12px rgba(247, 208, 96, 0.2); }
    50% { box-shadow: 0 4px 20px rgba(247, 208, 96, 0.5); }
}

/* (old-age card removed) */

/* --- 労いメッセージ --- */
.praise-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3e0 100%);
    border-radius: 14px;
    border-left: 4px solid #f7d060;
}
.praise-message.cooking-bonus {
    background: linear-gradient(135deg, #e8f5e9 0%, #fff8e1 100%);
    border-left-color: #4CAF50;
    animation: praise-glow 2s ease-in-out;
}
@keyframes praise-glow {
    0% { box-shadow: 0 0 0 rgba(76, 175, 80, 0); }
    50% { box-shadow: 0 0 20px rgba(76, 175, 80, 0.2); }
    100% { box-shadow: 0 0 0 rgba(76, 175, 80, 0); }
}
.praise-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.praise-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.6;
}
.praise-text strong {
    color: var(--text-main);
    font-weight: 800;
}

/* --- ライフステージバッジ（ホーム） --- */
.life-stage-badge {
    transition: transform 0.2s ease;
}
.life-stage-badge:hover {
    transform: translateX(4px);
}

/* --- 家族イベントノード（ライフマップ） --- */
.lm-family {
    border-left: 4px solid #e91e8c;
    background: linear-gradient(135deg, #fce4ec 0%, white 100%);
}
.lm-family .lm-node-title {
    color: #c2185b;
}

/* (READY_TO_BUY card removed) */

/* --- 自炊メッセージ中間・低ティア --- */
.praise-message.cooking-mid {
    background: linear-gradient(135deg, #e3f2fd 0%, #fff8e1 100%);
    border-left-color: #2196F3;
}
.praise-message.cooking-low {
    background: linear-gradient(135deg, #fff3e0 0%, #fbe9e7 100%);
    border-left-color: #FF9800;
}

/* --- 家賃 vs 住宅ローン＋団信 比較 --- */
.lmh-compare-section {
    padding: 28px;
    border-radius: 20px;
    background: #fff;
    border: 1px solid var(--border);
    letter-spacing: 0.3px;
}
.lmh-compare-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}
.lmh-compare-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.lmh-compare-title {
    font-family: 'Kiwi Maru', serif;
    font-weight: 900;
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 6px;
}
.lmh-compare-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.7;
}
.lmh-compare-subtitle strong {
    color: #2e7d32;
    background: linear-gradient(transparent 60%, rgba(76, 175, 80, 0.15) 60%);
    padding: 0 2px;
}
.lmh-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.lmh-compare-card {
    padding: 24px 20px;
    border-radius: 18px;
    text-align: center;
}
.lmh-compare-card-label {
    font-size: 0.7rem;
    font-weight: 800;
    margin-bottom: 14px;
    letter-spacing: 0.3px;
}
.lmh-compare-card-title {
    font-size: 0.85rem;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.5;
}
.lmh-compare-amount {
    font-size: 1.6rem;
    font-weight: 900;
    margin: 12px 0;
    transition: color 0.3s ease;
}
.lmh-compare-amount-rent { color: #bf360c; }
.lmh-compare-amount-loan { color: #1b5e20; }
.lmh-compare-breakdown {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.lmh-compare-card-desc {
    font-size: 0.75rem;
    line-height: 1.6;
    padding-top: 12px;
    border-top: 1px dashed rgba(0,0,0,0.08);
}
/* 賃貸側: シェルピンク */
.lmh-compare-rent {
    background: linear-gradient(135deg, #fff0f2, #ffe8ec);
    border: 1px solid rgba(255, 183, 197, 0.3);
}
.lmh-compare-rent .lmh-compare-card-label { color: #bf360c; }
.lmh-compare-rent .lmh-compare-card-title { color: #6d4c41; }
.lmh-compare-rent .lmh-compare-card-desc { color: #8d6e63; }
/* 住宅ローン側: ピスタチオグリーン + やわらかい光 */
.lmh-compare-loan {
    background: linear-gradient(145deg, #f0f8ec 0%, #e0f2f1 60%, rgba(255,255,255,0.85) 100%);
    border: 1px solid rgba(157, 192, 139, 0.3);
    box-shadow: 0 0 20px rgba(157, 192, 139, 0.15);
    animation: compare-loan-glow 3s ease-in-out infinite;
}
.lmh-compare-loan .lmh-compare-card-label { color: #2e7d32; }
.lmh-compare-loan .lmh-compare-card-title { color: #1b5e20; }
.lmh-compare-loan .lmh-compare-card-desc { color: #388e3c; font-weight: 600; }
@keyframes compare-loan-glow {
    0%, 100% { box-shadow: 0 0 20px rgba(157, 192, 139, 0.12); }
    50% { box-shadow: 0 0 35px rgba(157, 192, 139, 0.25); }
}
.lmh-compare-meyasu {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-left: 4px;
    letter-spacing: 0;
}
/* 団信説明フッター */
.lmh-compare-footer {
    margin-top: 18px;
    padding: 12px 16px;
    background: rgba(76, 175, 80, 0.06);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* --- CTAセクション（ミライの地図ページ） --- */
.lmh-cta-section {
    margin-top: 30px;
    text-align: center;
    padding: 45px 30px;
    background: linear-gradient(135deg, #fff 0%, #fff0f5 40%, #e0f2f1 100%);
    border-radius: 20px;
    border: 1px solid var(--border);
    letter-spacing: 0.5px;
}
.lmh-cta-text {
    font-family: 'Kiwi Maru', serif;
    font-size: 1rem;
    line-height: 2.2;
    color: var(--text-main);
    margin-bottom: 30px;
}
.lmh-cta-btn-wrapper {
    position: relative;
    display: inline-block;
}
.lmh-cta-btn {
    background: linear-gradient(135deg, var(--primary-dark), #d4817f);
    color: white;
    border: none;
    padding: 18px 45px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', sans-serif;
    cursor: pointer;
    box-shadow: 0 6px 0 #c47a7a, 0 12px 25px rgba(229, 154, 154, 0.35);
    transition: all 0.15s ease;
    letter-spacing: 1px;
}
.lmh-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #c47a7a, 0 16px 30px rgba(229, 154, 154, 0.45);
}
.lmh-cta-btn:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #c47a7a, 0 6px 15px rgba(229, 154, 154, 0.25);
}
.lmh-cta-badge {
    position: absolute;
    top: -14px;
    right: -18px;
    background: white;
    border: 2px solid var(--primary-light);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--primary-dark);
    transform: rotate(6deg);
    font-family: 'Kiwi Maru', serif;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    white-space: nowrap;
}
.lmh-cta-hint {
    margin-top: 20px;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* ===== 横軸ロードマップ（ミライの地図） ===== */

.lmh-wrapper {
    padding: 30px 20px 20px;
    position: relative;
    overflow: hidden;
}

/* --- 年齢並走エリア --- */
.lmh-age-area {
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}
.lmh-age-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}
.lmh-age-label {
    width: 80px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-main);
    flex-shrink: 0;
    white-space: nowrap;
}
.lmh-age-track {
    flex: 1;
    position: relative;
    height: 22px;
    background: var(--bg-warm);
    border-radius: 11px;
}
.lmh-age-tick {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

/* --- メインタイムライン --- */
.lmh-timeline-area {
    position: relative;
    height: 460px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 0 40px;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-light) transparent;
}
.lmh-timeline-area::-webkit-scrollbar {
    height: 6px;
}
.lmh-timeline-area::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

/* トラック背景線 */
.lmh-track-bg {
    position: absolute;
    top: 140px;
    left: 40px;
    right: 40px;
    height: 4px;
    z-index: 1;
}
.lmh-track-line {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--border) 60%, rgba(200,200,200,0.2));
    border-radius: 4px;
}
.lmh-track-glow {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, #f7d060, var(--accent), transparent);
    border-radius: 4px;
    opacity: 0.7;
    transition: width 2s ease;
}

/* 起点ドット */
.lmh-origin {
    position: absolute;
    left: 10px;
    top: 124px;
    text-align: center;
    z-index: 5;
}
.lmh-origin-dot {
    width: 16px;
    height: 16px;
    background: var(--accent);
    border: 3px solid white;
    border-radius: 50%;
    margin: 0 auto 6px;
    box-shadow: 0 0 12px rgba(157, 192, 139, 0.6);
    animation: lm-pulse 2s ease-in-out infinite;
}
.lmh-origin span {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
}

/* 終点 */
.lmh-destination {
    position: absolute;
    right: 10px;
    top: 124px;
    text-align: center;
    z-index: 5;
}
.lmh-destination span {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

/* 年マーカー（横） */
.lmh-year-marker {
    position: absolute;
    top: 148px;
    transform: translateX(-50%);
    z-index: 2;
}
.lmh-year-marker span {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-warm);
    padding: 1px 6px;
    border-radius: 8px;
    border: 1px solid var(--border);
}

/* --- たからもの（ノード） --- */
.lmh-node {
    position: absolute;
    transform: translateX(-50%);
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    cursor: default;
    transition: filter 1s ease, opacity 1s ease;
}

/* ママレーン (lane-0) 上段 ＋千鳥配置 */
.lmh-lane-0 {
    top: 5px;
}
.lmh-lane-0.lmh-chidori-1 {
    top: 42px;
}

/* 子供レーン1 (lane-1) 下段 ＋千鳥配置 */
.lmh-lane-1 {
    top: 165px;
}
.lmh-lane-1.lmh-chidori-1 {
    top: 192px;
}

/* 子供レーン2 (lane-2) さらに下段 ＋千鳥配置 */
.lmh-lane-2 {
    top: 280px;
}
.lmh-lane-2.lmh-chidori-1 {
    top: 307px;
}

/* 子供レーンはコンパクト表示 */
.lmh-lane-1 .lmh-pin,
.lmh-lane-2 .lmh-pin {
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
}
.lmh-lane-1 .lmh-node-line,
.lmh-lane-2 .lmh-node-line {
    height: 22px;
}
.lmh-lane-1 .lmh-node-card,
.lmh-lane-2 .lmh-node-card {
    padding: 5px 8px;
    min-width: 80px;
    max-width: 120px;
}
.lmh-lane-1 .lmh-node-title,
.lmh-lane-2 .lmh-node-title {
    font-size: 0.62rem;
}
.lmh-lane-1 .lmh-node-meta,
.lmh-lane-2 .lmh-node-meta {
    font-size: 0.55rem;
}

/* 子供レーン区切り線 */
.lmh-child-track {
    position: absolute;
    left: 40px;
    right: 40px;
    height: 1px;
    background: linear-gradient(90deg, rgba(233, 30, 140, 0.3), rgba(233, 30, 140, 0.1) 60%, transparent);
    z-index: 2;
}
.lmh-child-track-label {
    position: absolute;
    left: 0;
    top: -14px;
    font-size: 0.6rem;
    font-weight: 700;
    color: #c2185b;
    white-space: nowrap;
}

.lmh-pin {
    font-size: 1.6rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 3;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.lmh-node:hover .lmh-pin {
    transform: scale(1.15);
    box-shadow: 0 6px 25px rgba(0,0,0,0.18);
}
.lmh-node-line {
    width: 2px;
    height: 60px;
    background: linear-gradient(180deg, var(--border), transparent);
    margin: 0 auto;
}
.lmh-node-card {
    padding: 8px 10px;
    border-radius: 12px;
    text-align: center;
    min-width: 100px;
    max-width: 140px;
    transition: transform 0.3s ease;
}
.lmh-node:hover .lmh-node-card {
    transform: translateY(-3px);
}
.lmh-node-title {
    font-weight: 800;
    font-size: 0.7rem;
    color: var(--text-main);
    line-height: 1.3;
    word-break: keep-all;
}
.lmh-node-meta {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 3px;
}

/* たからもの状態 */
.lmh-achieved .lmh-pin {
    border: 3px solid var(--accent);
}
.lmh-achieved .lmh-node-title::after {
    content: ' ✅';
}
.lmh-near .lmh-pin {
    border: 3px solid #f7d060;
    animation: lm-near-glow 3s ease-in-out infinite;
}
.lmh-family .lmh-pin {
    border: 3px solid #e91e8c;
}
.lmh-family .lmh-node-title {
    color: #c2185b;
}
.lmh-family .lmh-node-line {
    background: linear-gradient(180deg, #e91e8c, transparent);
}
/* --- 密集おまとめ（クラスタ） --- */
.lmh-cluster {
    position: absolute;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: filter 1s ease, opacity 1s ease;
}
.lmh-cluster.lmh-lane-0 {
    top: 15px;
}
.lmh-cluster.lmh-lane-1 {
    top: 165px;
}
.lmh-cluster.lmh-lane-2 {
    top: 280px;
}
.lmh-cluster-icons {
    display: flex;
    gap: 3px;
    background: white;
    padding: 8px 12px;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    font-size: 1.2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.lmh-cluster:hover .lmh-cluster-icons {
    transform: scale(1.08);
    box-shadow: 0 6px 25px rgba(0,0,0,0.18);
}
.lmh-cluster-count {
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--text-muted);
    margin-top: 4px;
    white-space: nowrap;
}
.lmh-cluster .lmh-node-line {
    height: 30px;
}
.lmh-cluster-popup {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    min-width: 210px;
    max-width: 280px;
    padding: 14px 16px;
    border-radius: 14px;
    background: white;
    border: 1px solid var(--border);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    z-index: 20;
}
.lmh-cluster:hover .lmh-cluster-popup {
    display: block;
}
.lmh-cluster-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.lmh-cluster-item:last-child {
    border-bottom: none;
}
.lmh-cluster-item-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}
.lmh-cluster-item-title {
    font-weight: 800;
    font-size: 0.72rem;
    color: var(--text-main);
}
.lmh-cluster-item-meta {
    font-size: 0.6rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- 霧オーバーレイ --- */
.lmh-fog {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,253,248,0.4) 30%, rgba(255,253,248,0.85) 70%, rgba(255,253,248,0.95) 100%);
    pointer-events: none;
    z-index: 6;
    transition: opacity 2.5s ease;
}

/* ===== 消えない通知カードシステム ===== */

.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.5s ease, transform 0.5s 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, #fff8e1 0%, #fff3e0 100%);
    border-color: #f7d060;
}
.notif-rank {
    background: linear-gradient(135deg, #fce4ec 0%, #fff 100%);
    border-color: #e91e8c;
}
.notif-treasure {
    background: linear-gradient(135deg, #e8f5e9 0%, #fff 100%);
    border-color: #4CAF50;
}
.notif-cooking {
    background: linear-gradient(135deg, #fff8e1 0%, #fce4ec 100%);
    border-color: #ffb74d;
}

/* 自炊頻度・常設ボタン */
.cooking-choice-btn {
    position: relative;
    overflow: hidden;
}
.cooking-choice-btn:hover {
    border-color: #ffb74d !important;
    background: #fff8e1 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 183, 77, 0.3);
}
.cooking-choice-btn:active {
    transform: scale(0.97);
}
.cooking-choice-btn.cooking-active {
    border-color: #ffb74d !important;
    background: #fff8e1 !important;
    box-shadow: 0 2px 10px rgba(255, 183, 77, 0.35);
    position: relative;
}
.cooking-choice-btn.cooking-active::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 0.6rem;
    color: #e65100;
    font-weight: 900;
}

/* 夢のマイホーム旗（ライフマップ） */
.lmh-node.lmh-dream .lmh-pin {
    border: 3px solid #4CAF50;
    animation: lmh-dream-glow 2.5s ease-in-out infinite;
}
.lmh-node.lmh-dream .lmh-node-card {
    background: linear-gradient(135deg, #e8f5e9, #fff) !important;
    border: 1px solid rgba(76, 175, 80, 0.3);
}
.lmh-node.lmh-dream .lmh-node-title {
    color: #2e7d32;
}
@keyframes lmh-dream-glow {
    0%, 100% { box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2); }
    50% { box-shadow: 0 6px 24px rgba(76, 175, 80, 0.5); }
}

/* ===== ハンバーガーメニュー（デスクトップ非表示） ===== */

.hamburger-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
    flex-direction: column;
    gap: 5px;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 3px;
    background: var(--text-main);
    border-radius: 3px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger-btn.is-open .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger-btn.is-open .hamburger-line:nth-child(2) {
    opacity: 0;
}
.hamburger-btn.is-open .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.mobile-nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(93, 74, 74, 0.3);
    z-index: 999;
}
.mobile-nav-overlay.is-visible {
    display: block;
}

/* ===== モバイルレスポンシブ（480px以下） ===== */

@media (max-width: 480px) {

    /* --- ナビバー --- */
    .hamburger-btn {
        display: flex;
    }

    .glass-nav {
        height: 60px;
    }

    .nav-content {
        width: 95%;
        align-items: center;
    }

    body {
        padding-top: 68px;
    }

    .logo {
        font-size: 1.1rem;
        gap: 6px;
    }

    /* ナビリンク → スライドダウンパネル */
    .nav-links {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(20px);
        flex-direction: column;
        padding: 15px 20px;
        gap: 5px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
        border-bottom: 2px solid var(--border);
        z-index: 1000;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }

    .nav-links.mobile-open {
        display: flex;
    }

    .nav-links a {
        padding: 14px 16px;
        font-size: 1rem;
        border-radius: 14px;
        width: 100%;
    }

    .nav-links a.active {
        background: var(--primary-light);
    }

    /* ユーザーメニュー */
    .user-menu-container {
        margin-left: auto;
    }

    .user-profile {
        padding: 4px 8px;
        font-size: 0.8rem;
    }

    #nav-username {
        display: none;
    }

    .dropdown-menu {
        position: fixed;
        top: 60px;
        right: 10px;
        width: calc(100% - 20px);
        max-width: 300px;
    }

    /* --- ランディングページ --- */
    .hero-text h1 {
        font-size: 1.7rem !important;
    }

    .hero-text p {
        font-size: 0.9rem !important;
    }

    .btn-lg {
        padding: 14px 28px !important;
        font-size: 0.95rem !important;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .f-card {
        padding: 28px 22px;
    }

    .section-title h2 {
        font-size: 1.5rem;
    }

    .lp-mock-dashboard {
        grid-template-columns: 1fr !important;
    }

    footer {
        padding: 30px 5% 20px !important;
    }

    /* --- ダッシュボード --- */
    .content {
        width: 95%;
        padding: 15px 0;
    }

    .dashboard-header {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        text-align: center;
    }

    #dashboard-view .dashboard-header h1 {
        font-size: 1.3rem;
    }

    /* サマリーカード */
    .summary-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .summary-card {
        padding: 22px;
        border-radius: 22px;
    }

    .summary-card-value {
        font-size: 1.8rem;
    }

    /* カレンダー */
    .calendar-section {
        padding: 20px 12px;
        border-radius: 20px;
    }

    .calendar-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        margin-bottom: 20px;
    }

    .calendar-grid {
        gap: 4px;
    }

    .calendar-day {
        min-height: 55px;
        padding: 6px 3px 4px;
        border-radius: 8px;
        font-size: 0.75rem;
    }

    .calendar-day-number {
        font-size: 0.75rem;
    }

    .calendar-day-expense,
    .calendar-day-income {
        font-size: 0.55rem;
    }

    .calendar-day-name {
        font-size: 0.65rem;
        padding: 6px 2px;
    }

    .calendar-controls button {
        width: 34px;
        height: 34px;
    }

    /* glass-card */
    .glass-card {
        border-radius: 20px;
        padding: 20px;
    }

    /* クイックアクション */
    .quick-actions {
        grid-template-columns: 1fr;
    }

    .quick-action-btn {
        padding: 16px 20px;
        font-size: 0.9rem;
    }

    /* --- シミュレーション --- */
    .simulator-layout {
        grid-template-columns: 1fr;
    }

    /* --- レポート --- */
    .tab-container {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .tab-btn {
        font-size: 0.8rem;
        padding: 10px 8px;
        white-space: nowrap;
    }

    /* stats-grid */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* --- モーダル --- */
    .modal .modal-content {
        max-width: 95% !important;
        padding: 25px 18px !important;
        border-radius: 24px !important;
    }

    .modal .modal-header h2,
    .modal .modal-header h3 {
        font-size: 1.2rem;
    }

    /* --- 認証画面 --- */
    #auth-view {
        padding: 20px 10px !important;
    }

    #auth-modal {
        padding: 30px 20px !important;
        border-radius: 28px !important;
    }

    /* --- 証明書モーダル --- */
    .certificate-inner {
        min-width: auto;
        max-width: 95vw;
        padding: 30px 20px;
    }

    .certificate-title {
        font-size: 1.3rem;
        letter-spacing: 3px;
    }

    /* --- 通知 --- */
    .notif-container {
        right: 10px;
        left: 10px;
        max-width: none;
    }

    .notif-card {
        padding: 12px 14px 10px;
    }

    /* --- ライフマップ --- */
    .lmh-timeline-area {
        height: 380px;
        padding: 0 15px;
    }

    .lmh-compare-grid {
        grid-template-columns: 1fr;
    }

    .lmh-compare-card {
        padding: 20px 16px;
    }

    .lmh-cta-section {
        padding: 30px 15px;
    }

    .lmh-cta-btn {
        padding: 14px 30px;
        font-size: 0.95rem;
    }

    /* --- FPスコアカード --- */
    .fp-score-card {
        flex-direction: column !important;
        text-align: center;
        align-items: center !important;
    }

    /* --- ライフステージバッジ --- */
    .life-stage-badge {
        flex-direction: column;
        text-align: center;
    }

    /* --- 自炊頻度ボタン 2列化 --- */
    .cooking-permanent [style*="grid-template-columns:1fr 1fr 1fr 1fr"] {
        grid-template-columns: 1fr 1fr !important;
    }
}