/* ===================================
   ストーリーページ用スタイル
   Emily's Story - 15分で変わる、二つの顔
   =================================== */

/* ストーリーメインコンテナ */
.story-main {
    min-height: 100vh;
    background: linear-gradient(135deg, #fef9f3 0%, #fef6ed 100%);
}

/* ストーリーヒーローセクション */
.story-hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 80px 20px 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.story-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

.story-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.story-category {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    letter-spacing: 1px;
}

.story-title {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.3;
}

.story-subtitle {
    font-size: 18px;
    font-weight: 300;
    opacity: 0.95;
}

/* ストーリーコンテナ */
.story-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
}

/* イントロダクションセクション */
.story-intro {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 60px;
}

.intro-profile {
    display: flex;
    align-items: center;
    gap: 25px;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f5f5f5;
}

.profile-image {
    font-size: 80px;
    color: var(--primary-color);
}

.profile-info h3 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.profile-detail {
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
}

.profile-location {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
}

.profile-location i {
    margin-right: 6px;
}

.intro-quote {
    font-size: 18px;
    font-style: italic;
    color: #555;
    background: #fef9f3;
    padding: 20px 25px;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    margin-bottom: 20px;
    line-height: 1.8;
}

.intro-text p {
    font-size: 16px;
    line-height: 1.9;
    color: #444;
}

/* タイムラインセクション */
.story-timeline {
    position: relative;
    margin-bottom: 60px;
}

.timeline-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 60px;
    position: relative;
}

.timeline-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    margin: 20px auto 0;
    border-radius: 2px;
}

/* タイムラインアイテム */
.timeline-item {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 30px;
    margin-bottom: 50px;
    position: relative;
}

/* 左側の縦ライン */
.timeline-item::before {
    content: '';
    position: absolute;
    left: 60px;
    top: 50px;
    bottom: -50px;
    width: 2px;
    background: linear-gradient(180deg, var(--primary-light) 0%, rgba(255, 138, 0, 0.2) 100%);
}

.timeline-item:last-child::before {
    display: none;
}

/* ハイライト表示 */
.timeline-item.highlight {
    background: linear-gradient(135deg, #fff9f0 0%, #fef5ea 100%);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(255, 138, 0, 0.15);
    border: 2px solid rgba(255, 138, 0, 0.2);
}

.timeline-item.highlight::before {
    left: 90px;
}

/* タイムスタンプ */
.timeline-time {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.time-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.time-icon.morning {
    background: linear-gradient(135deg, #ffd89b 0%, #ffb347 100%);
}

.time-icon.afternoon {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
}

.time-icon.evening {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.time-icon.nature {
    background: linear-gradient(135deg, #81c784 0%, #66bb6a 100%);
}

.time-text {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* タイムラインコンテンツ */
.timeline-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.timeline-content h3 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.timeline-distance {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff0e0 100%);
    color: var(--primary-dark);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 15px;
}

.timeline-distance i {
    margin-right: 6px;
}

.timeline-image {
    background: linear-gradient(135deg, #f5f5f5 0%, #eeeeee 100%);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    margin: 20px 0;
    border: 2px solid #e0e0e0;
}

.timeline-image.nature {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #81c784;
}

.timeline-image i {
    font-size: 48px;
    color: #999;
    margin-bottom: 12px;
    display: block;
}

.timeline-image.nature i {
    color: #66bb6a;
}

.timeline-image span {
    display: block;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.timeline-content p {
    font-size: 16px;
    line-height: 1.9;
    color: #444;
    margin-bottom: 15px;
}

.detail-text {
    font-size: 15px;
    color: #555;
    font-style: italic;
}

/* 引用文 */
.timeline-content blockquote {
    background: #fef9f3;
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    margin: 20px 0;
    font-size: 16px;
    font-style: italic;
    color: #555;
    border-radius: 6px;
}

.highlight-quote {
    background: linear-gradient(135deg, #fff9ed 0%, #fef0d9 100%);
    border-left: 4px solid #ff8a00;
    font-size: 17px;
    font-weight: 500;
    color: #333;
}

/* まとめセクション */
.story-conclusion {
    margin-bottom: 50px;
}

.conclusion-box {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.conclusion-box h2 {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
    text-align: center;
}

.main-quote {
    font-size: 20px;
    font-style: italic;
    color: var(--primary-dark);
    background: linear-gradient(135deg, #fef9f3 0%, #fff0e0 100%);
    padding: 30px;
    border-left: 5px solid var(--primary-color);
    border-radius: 10px;
    margin-bottom: 25px;
    line-height: 1.8;
    text-align: center;
}

.conclusion-text {
    font-size: 18px;
    line-height: 1.9;
    color: #444;
    text-align: center;
}

.conclusion-text strong {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 20px;
}

/* キーポイント */
.key-points {
    background: white;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.key-points h3 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.points-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.point-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 20px;
    background: #fefefe;
    border-radius: 10px;
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
}

.point-item:hover {
    border-color: var(--primary-light);
    background: #fef9f3;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 138, 0, 0.1);
}

.point-item i {
    font-size: 28px;
    color: var(--accent-color);
    flex-shrink: 0;
}

.point-item h4 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

.point-item p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

/* CTAセクション */
.story-cta {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: 20px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(255, 138, 0, 0.3);
}

.story-cta h2 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 20px;
}

.story-cta p {
    font-size: 16px;
    line-height: 1.9;
    margin-bottom: 35px;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn-cta-primary,
.btn-cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 35px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-cta-primary {
    background: white;
    color: var(--primary-color);
}

.btn-cta-primary:hover {
    background: #f5f5f5;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.btn-cta-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.btn-cta-secondary:hover {
    background: white;
    color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* ヘッダー調整 */
.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: var(--primary-color);
    padding: 10px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.btn-back-home:hover {
    background: var(--primary-light);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* ===================================
   比較ボックス・グラフ・テーブル
   =================================== */

/* 住宅比較ボックス */
.comparison-box {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    margin: 30px 0;
    align-items: center;
}

.comparison-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.comparison-header {
    padding: 15px;
    color: white;
    font-weight: 600;
    text-align: center;
    font-size: 16px;
}

.comparison-header.tokyo {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.comparison-header.nagoya {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

.comparison-body {
    padding: 25px;
}

.floor-plan {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.plan-icon {
    font-size: 48px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.plan-icon.sad {
    background: #fee;
    color: #e74c3c;
}

.plan-icon.happy {
    background: #e8f5e9;
    color: #52B788;
}

.plan-details {
    flex: 1;
}

.plan-type {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.plan-size {
    font-size: 18px;
    color: #666;
    margin-bottom: 5px;
}

.plan-rent {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
}

.plan-features {
    list-style: none;
    padding: 0;
}

.plan-features li {
    padding: 8px 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.plan-features i {
    font-size: 18px;
}

.plan-features .fa-times-circle {
    color: #e74c3c;
}

.plan-features .fa-check-circle {
    color: #52B788;
}

.comparison-arrow {
    font-size: 36px;
    color: var(--primary-color);
}

/* 節約ハイライト */
.savings-highlight {
    background: linear-gradient(135deg, #fff9e6, #ffe6b3);
    border-left: 5px solid #FFD700;
    padding: 20px 25px;
    border-radius: 10px;
    margin: 25px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.savings-highlight i {
    font-size: 32px;
    color: #FFA500;
}

.savings-highlight strong {
    color: #E67E22;
    font-size: 22px;
}

/* 価格比較テーブル */
.price-comparison-table {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin: 25px 0;
}

.price-comparison-table h4 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-comparison-table table {
    width: 100%;
    border-collapse: collapse;
}

.price-comparison-table th,
.price-comparison-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.price-comparison-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.tokyo-col {
    color: #7f8c8d;
}

.nagoya-col {
    color: var(--primary-color);
    font-weight: 600;
}

.diff-col {
    color: #52B788;
    font-weight: 700;
}

/* 月額節約バー */
.monthly-savings {
    margin: 30px 0;
}

.savings-bar {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.bar-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.bar-tokyo,
.bar-nagoya {
    margin-bottom: 15px;
    position: relative;
}

.bar-text {
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.bar-fill {
    height: 40px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: white;
    font-weight: 600;
    transition: width 1s ease;
}

.bar-tokyo .bar-fill {
    background: linear-gradient(90deg, #95a5a6, #7f8c8d);
}

.bar-nagoya .bar-fill {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.savings-result {
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #52B788;
    margin-top: 20px;
}

.savings-result i {
    font-size: 24px;
}

/* 外食比較 */
.dining-comparison {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 25px 0;
}

.dining-item {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.dining-type {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dining-prices {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dining-prices .price {
    padding: 10px 15px;
    border-radius: 8px;
    font-weight: 600;
}

.dining-prices .price.tokyo {
    background: #f0f0f0;
    color: #7f8c8d;
}

.dining-prices .price.nagoya {
    background: #fff9e6;
    color: var(--primary-color);
}

.dining-prices .price-diff {
    background: #e8f5e9;
    color: #52B788;
    padding: 12px 15px;
    border-radius: 8px;
    font-weight: 700;
    text-align: center;
}

/* 子育て費用比較 */
.childcare-comparison {
    margin: 30px 0;
}

.childcare-comparison h4 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cost-tables {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin-bottom: 25px;
}

.cost-table-wrapper {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.cost-table-header {
    padding: 15px;
    color: white;
    font-weight: 600;
    text-align: center;
    font-size: 16px;
}

.cost-table-header.tokyo {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.cost-table-header.nagoya {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

.cost-table {
    width: 100%;
    border-collapse: collapse;
}

.cost-table tr {
    border-bottom: 1px solid #f0f0f0;
}

.cost-table td {
    padding: 12px 20px;
}

.cost-table td:first-child {
    color: #666;
}

.cost-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: #333;
}

.cost-table .subtotal td {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.cost-table .total td {
    background: #ffe6b3;
    font-weight: 700;
    color: #E67E22;
    font-size: 18px;
}

/* 総節約ボックス */
.total-savings-box {
    background: linear-gradient(135deg, #fff9e6, #ffe6b3);
    border-radius: 16px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 8px 30px rgba(255, 138, 0, 0.15);
}

.total-savings-box h4 {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.savings-breakdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.savings-item {
    background: white;
    border-radius: 10px;
    padding: 20px 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.savings-item i {
    font-size: 32px;
    color: var(--primary-color);
}

.savings-item .item-label {
    font-size: 14px;
    color: #666;
}

.savings-item .item-value {
    font-size: 20px;
    font-weight: 700;
    color: #E67E22;
}

.total-savings {
    background: white;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.total-savings .total-label {
    font-size: 18px;
    font-weight: 600;
    color: #666;
}

.total-savings .total-value {
    font-size: 42px;
    font-weight: 700;
    color: #E67E22;
}

.total-savings .yearly-value {
    font-size: 20px;
    font-weight: 600;
    color: #52B788;
}

/* お金の使い道 */
.money-allocation {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.money-allocation h4 {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.allocation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.allocation-item {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.allocation-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.allocation-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    flex-shrink: 0;
}

.allocation-icon.education {
    background: linear-gradient(135deg, #4A90E2, #7BB3F0);
}

.allocation-icon.travel {
    background: linear-gradient(135deg, #FFB884, #FF9A56);
}

.allocation-icon.investment {
    background: linear-gradient(135deg, #52B788, #66bb6a);
}

.allocation-icon.leisure {
    background: linear-gradient(135deg, #F4A261, #E67E22);
}

.allocation-icon.emergency {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
}

.allocation-details h5 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.allocation-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 3px;
}

.allocation-percent {
    font-size: 14px;
    color: #999;
}

/* 将来予測 */
.future-projection {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border-radius: 16px;
    padding: 30px;
    margin: 30px 0;
    border: 2px solid #52B788;
}

.future-projection h4 {
    font-size: 22px;
    font-weight: 700;
    color: #2e7d32;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.projection-content {
    background: white;
    border-radius: 12px;
    padding: 25px;
}

.projection-calc {
    margin-bottom: 20px;
}

.projection-calc .calc-line {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
}

.projection-calc strong {
    font-size: 24px;
    color: #2e7d32;
    font-weight: 700;
}

.projection-result {
    background: #e8f5e9;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #2e7d32;
}

.projection-result i {
    font-size: 28px;
}

/* 最終比較テーブル */
.final-comparison {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin: 30px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.final-comparison h4 {
    font-size: 22px;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.final-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
}

.final-table th,
.final-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.final-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.final-table .total-row {
    background: #ffe6b3;
}

.final-table .total-row td {
    font-weight: 700;
    font-size: 18px;
    color: #E67E22;
}

.final-savings {
    background: linear-gradient(135deg, #fff9e6, #ffe6b3);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    color: #E67E22;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.final-savings i {
    font-size: 32px;
    color: #52B788;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .story-title {
        font-size: 28px;
    }

    .story-subtitle {
        font-size: 16px;
    }

    .story-container {
        padding: 40px 15px;
    }

    .story-intro {
        padding: 25px;
    }

    .intro-profile {
        flex-direction: column;
        text-align: center;
    }

    .profile-image {
        font-size: 60px;
    }

    .timeline-title {
        font-size: 24px;
        margin-bottom: 40px;
    }

    /* タイムラインを縦一列に */
    .timeline-item {
        grid-template-columns: 1fr;
        gap: 20px;
        padding-left: 0;
    }

    .timeline-item::before {
        display: none;
    }

    .timeline-item.highlight {
        padding: 20px;
    }

    .timeline-time {
        flex-direction: row;
        justify-content: center;
        margin-bottom: 15px;
    }

    .time-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .time-text {
        font-size: 16px;
        padding: 6px 14px;
    }

    .timeline-content {
        padding: 20px;
    }

    .timeline-content h3 {
        font-size: 18px;
    }

    .timeline-image {
        padding: 20px;
    }

    .timeline-image i {
        font-size: 36px;
    }

    .points-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .conclusion-box {
        padding: 25px;
    }

    .conclusion-box h2 {
        font-size: 22px;
    }

    .main-quote {
        font-size: 17px;
        padding: 20px;
    }

    .story-cta {
        padding: 35px 25px;
    }

    .story-cta h2 {
        font-size: 24px;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 15px;
    }

    .btn-cta-primary,
    .btn-cta-secondary {
        width: 100%;
        justify-content: center;
    }

    /* 比較ボックス */
    .comparison-box {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .comparison-arrow {
        transform: rotate(90deg);
        margin: 10px 0;
    }

    .floor-plan {
        flex-direction: column;
        text-align: center;
    }

    /* 価格比較テーブル */
    .price-comparison-table {
        padding: 20px;
        overflow-x: auto;
    }

    .price-comparison-table table {
        font-size: 14px;
    }

    .price-comparison-table th,
    .price-comparison-table td {
        padding: 10px 8px;
    }

    /* 外食比較 */
    .dining-comparison {
        grid-template-columns: 1fr;
    }

    /* 子育て費用 */
    .cost-tables {
        grid-template-columns: 1fr;
    }

    /* 節約内訳 */
    .savings-breakdown {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .savings-item {
        padding: 15px 10px;
    }

    .savings-item i {
        font-size: 24px;
    }

    .savings-item .item-value {
        font-size: 18px;
    }

    .total-savings .total-value {
        font-size: 32px;
    }

    .total-savings .yearly-value {
        font-size: 18px;
    }

    /* お金の使い道 */
    .allocation-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .allocation-item {
        padding: 20px;
    }

    /* 将来予測 */
    .future-projection {
        padding: 20px;
    }

    .projection-calc .calc-line {
        font-size: 16px;
    }

    .projection-calc strong {
        font-size: 20px;
    }

    .projection-result {
        font-size: 18px;
    }

    /* 最終比較 */
    .final-comparison {
        padding: 20px;
        overflow-x: auto;
    }

    .final-table {
        font-size: 14px;
    }

    .final-table th,
    .final-table td {
        padding: 10px 8px;
    }

    .final-savings {
        font-size: 16px;
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .story-hero {
        padding: 60px 15px 40px;
    }

    .story-title {
        font-size: 24px;
    }

    .story-subtitle {
        font-size: 14px;
    }

    .intro-quote {
        font-size: 16px;
        padding: 15px 18px;
    }

    .timeline-content h3 {
        font-size: 17px;
    }

    .timeline-content p {
        font-size: 15px;
    }

    .timeline-content blockquote {
        font-size: 15px;
        padding: 12px 15px;
    }

    .point-item h4 {
        font-size: 16px;
    }

    .point-item p {
        font-size: 13px;
    }
}

/* ===================================
   スクロールアニメーション
   =================================== */

/* 基本的なフェードイン・スライドイン */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* スタッガードアニメーション */
.stagger-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.stagger-item.stagger-animated {
    opacity: 1;
    transform: translateY(0);
}

/* バーグラフのアニメーション */
.bar-fill {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.5s ease-out;
}

.bar-fill.bar-animated,
.bar-tokyo.bar-animated .bar-fill,
.bar-nagoya.bar-animated .bar-fill {
    transform: scaleX(1);
}

/* 数字のハイライト効果 */
.savings-highlight strong,
.total-value,
.yearly-value,
.savings-result,
.final-savings {
    transition: transform 0.3s ease, color 0.3s ease;
}

.savings-highlight strong.counted,
.total-value.counted,
.yearly-value.counted,
.savings-result.counted,
.final-savings.counted {
    animation: pulse-glow 0.6s ease-in-out;
}

@keyframes pulse-glow {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 0 rgba(230, 126, 34, 0);
    }
    50% {
        transform: scale(1.05);
        text-shadow: 0 0 20px rgba(230, 126, 34, 0.5);
    }
}

/* タイムラインアイテムの個別アニメーション */
.timeline-item {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.timeline-item:nth-child(even) {
    transform: translateX(30px);
}

.timeline-item.animated {
    opacity: 1;
    transform: translateX(0);
}

/* 比較ボックスのアニメーション */
.comparison-box {
    perspective: 1000px;
}

.comparison-item {
    opacity: 0;
    transform: rotateY(-15deg);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.comparison-box.animated .comparison-item:first-child {
    transition-delay: 0.2s;
}

.comparison-box.animated .comparison-item:last-child {
    transition-delay: 0.4s;
}

.comparison-box.animated .comparison-item {
    opacity: 1;
    transform: rotateY(0);
}

/* 比較矢印のアニメーション */
.comparison-arrow {
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.6s ease 0.3s, transform 0.6s ease 0.3s;
}

.comparison-box.animated .comparison-arrow {
    opacity: 1;
    transform: scale(1);
}

/* アロケーションアイテムのホバーアニメーション */
.allocation-item {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.allocation-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
}

.allocation-icon {
    transition: transform 0.3s ease;
}

.allocation-item:hover .allocation-icon {
    transform: rotate(360deg) scale(1.1);
}

/* プロジェクション結果の脈動アニメーション */
.projection-result {
    animation: gentle-pulse 2s ease-in-out infinite;
}

@keyframes gentle-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* セービングハイライトの波打ちアニメーション */
.savings-highlight {
    position: relative;
    overflow: hidden;
}

.savings-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.8s ease;
}

.savings-highlight:hover::before,
.savings-highlight.animated::before {
    left: 100%;
}

/* フロアプランアイコンのアニメーション */
.plan-icon {
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.comparison-box.animated .plan-icon {
    transform: scale(1);
    animation: bounce-in 0.8s ease;
}

@keyframes bounce-in {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* テーブル行のスタッガードアニメーション */
.price-comparison-table tr,
.cost-table tr,
.final-table tr {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.price-comparison-table.animated tr:nth-child(1),
.cost-table-wrapper.animated .cost-table tr:nth-child(1),
.final-comparison.animated .final-table tr:nth-child(1) {
    transition-delay: 0.1s;
}

.price-comparison-table.animated tr:nth-child(2),
.cost-table-wrapper.animated .cost-table tr:nth-child(2),
.final-comparison.animated .final-table tr:nth-child(2) {
    transition-delay: 0.2s;
}

.price-comparison-table.animated tr:nth-child(3),
.cost-table-wrapper.animated .cost-table tr:nth-child(3),
.final-comparison.animated .final-table tr:nth-child(3) {
    transition-delay: 0.3s;
}

.price-comparison-table.animated tr:nth-child(4),
.cost-table-wrapper.animated .cost-table tr:nth-child(4),
.final-comparison.animated .final-table tr:nth-child(4) {
    transition-delay: 0.4s;
}

.price-comparison-table.animated tr:nth-child(5),
.cost-table-wrapper.animated .cost-table tr:nth-child(5),
.final-comparison.animated .final-table tr:nth-child(5) {
    transition-delay: 0.5s;
}

.price-comparison-table.animated tr,
.cost-table-wrapper.animated .cost-table tr,
.final-comparison.animated .final-table tr {
    opacity: 1;
    transform: translateX(0);
}

/* ダイニング比較のアニメーション */
.dining-item {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.dining-comparison.animated .dining-item:first-child {
    transition-delay: 0.2s;
}

.dining-comparison.animated .dining-item:last-child {
    transition-delay: 0.4s;
}

.dining-comparison.animated .dining-item {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* イントロテキストのアニメーション */
.intro-text p {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.intro-text.animated p:first-child {
    transition-delay: 0.2s;
}

.intro-text.animated p:nth-child(2) {
    transition-delay: 0.4s;
}

.intro-text.animated p {
    opacity: 1;
    transform: translateY(0);
}

/* 引用文のアニメーション */
blockquote {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    border-left: 4px solid var(--primary-color);
}

.timeline-item.animated blockquote,
.intro-text.animated blockquote,
.story-conclusion.animated blockquote {
    opacity: 1;
    transform: translateX(0);
}

/* パフォーマンス最適化 */
@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll,
    .stagger-item,
    .timeline-item,
    .comparison-item,
    .dining-item,
    .intro-text p,
    blockquote,
    .bar-fill,
    .allocation-item,
    .plan-icon {
        opacity: 1;
        transform: none;
        transition: none;
        animation: none;
    }
}
