header { text-align: center; margin-bottom: 20px; }
header h1 { margin: 0; font-size: 2.5em; color: var(--primary-color); }
footer { text-align: center; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border-color); color: #888; }
/* 固定広告バナーのスタイル */
.fixed-ad-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 10px;
    text-align: center;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.fixed-ad-banner.hidden {
    transform: translateY(100%);
}

.ad-close-btn {
    position: absolute;
    top: 5px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.ad-close-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.rakuten-ad-container { 
    margin: 0 auto; 
    max-width: 520px; 
    overflow-x: auto; 
}
.rakuten-ad-container table { 
    margin: 0 auto; 
}

/* メインコンテンツに下部余白を追加（広告バナー分） */
body {
    padding-bottom: 120px;
}

@media (max-width: 600px) {
    .rakuten-ad-container { 
        transform: scale(0.7); 
        transform-origin: center; 
    }
    
    body {
        padding-bottom: 100px;
    }
}
footer a { color: #555; text-decoration: none; }
footer a:hover { text-decoration: underline; }
/* コントロールボタンのレイアウト */
.control-buttons { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 15px; 
    flex-wrap: wrap;
    gap: 10px;
}
.lang-switcher { }
.theme-switcher { 
    display: flex; 
    gap: 8px; 
}
#lang-toggle-btn { background-color: #555; color: white; border: none; padding: 8px 16px; border-radius: 5px; cursor: pointer; font-weight: bold; }
#theme-toggle-btn, #dark-mode-btn { 
    background-color: #f8f9fa; 
    color: #495057; 
    border: 1px solid #dee2e6; 
    padding: 8px 12px; 
    border-radius: 5px; 
    cursor: pointer; 
    transition: all 0.2s ease;
}
#theme-toggle-btn:hover, #dark-mode-btn:hover { 
    background-color: #e9ecef; 
    color: #212529; 
}
.cta { background-color: #e8eaf6; border: 2px dashed #c5cae9; padding: 20px; border-radius: 8px; text-align: center; margin-bottom: 30px; }

/* ▼▼▼ [修正] フィルターコントロールのレイアウト ▼▼▼ */
.filter-controls { 
    margin-bottom: 30px; 
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}
.sort-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}
.sort-controls label {
    font-size: 1.5em;
    color: var(--primary-color);
}
#sort-select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    background-color: white;
}

/* 日付フィルターのスタイル */
.date-filter-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}
.date-input-group {
    display: flex;
    align-items: center;
    gap: 5px;
}
.date-input-group label {
    font-size: 1.2em;
    color: var(--primary-color);
}
.date-input-group input[type="date"] {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9em;
    background-color: white;
}
.date-separator {
    color: #666;
    font-weight: bold;
    margin: 0 5px;
}
#clear-dates {
    background: none;
    border: none;
    color: #666;
    font-size: 1.2em;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease;
}
#clear-dates:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
}

.search-box {
    flex-grow: 1; /* 残りの幅をすべて使う */
}
.search-box input { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 5px; font-size: 1em; box-sizing: border-box; }
/* ▲▲▲ ここまで ▲▲▲ */

#anniversary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; }
.anniversary-card { background-color: var(--card-bg-color); border-radius: 10px; box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; justify-content: space-between; border-top: 4px solid var(--primary-color); }
.card-main-content { position: relative; flex-grow: 1; display: flex; flex-direction: column; }
.card-main-content.clickable { cursor: pointer; }
.card-main-content.clickable:hover { box-shadow: inset 0 0 40px rgba(0,0,0,0.05); border-radius: 5px; }
.card-details-prompt { position: absolute; bottom: 0; right: 0; background-color: var(--primary-color); color: white; font-size: 0.8em; font-weight: bold; padding: 3px 8px; border-radius: 5px 0 5px 0; opacity: 0; transition: opacity 0.2s ease; }
.card-main-content.clickable:hover .card-details-prompt { opacity: 1; }
.card-title { font-size: 1.25em; font-weight: bold; margin: 0 0 15px 0; min-height: 3em; }
.days-passed { font-size: 2em; font-weight: bold; color: var(--accent-color); text-align: center; margin: 15px 0; }
.card-footer { border-top: 1px solid var(--border-color); padding-top: 15px; margin-top: auto; }
.start-date { text-align: right; color: #777; font-size: 0.9em; }
.card-tags-container { display: flex; flex-wrap: wrap; gap: 6px; min-height: 25px; margin-bottom: 10px; }
.item-tag { background-color: #eee; color: #555; font-size: 0.8em; padding: 4px 8px; border-radius: 10px; }
.card-quick-links { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-color); }
.quick-link-item { display: flex; align-items: center; text-decoration: none; color: var(--primary-color); font-size: 0.9em; padding: 4px; border-radius: 5px; }
.quick-link-item:hover { background-color: #f1f3f5; color: var(--accent-color); }
.quick-link-item i { margin-right: 6px; }