:root { --primary: #4CAF50; --accent: #FF9800; --bg: #f4f7f6; --card: #ffffff; --text: #333333; --danger: #F44336; --nutrient: #BA68C8; }

body { font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif; background-color: var(--bg); color: var(--text); margin: 0; padding: 0; padding-bottom: 80px; -webkit-tap-highlight-color: transparent; }

header { background: var(--primary); color: white; padding: 15px; text-align: center; font-weight: bold; font-size: 1.2rem; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }

.container { padding: 15px; max-width: 600px; margin: 0 auto; }

.nav-bar { position: fixed; bottom: 0; left: 0; width: 100%; background: white; display: flex; justify-content: space-around; padding: 10px 0; border-top: 1px solid #eee; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); z-index: 100;}
.nav-item { flex:1; text-align: center; font-size: 0.8rem; color: #888; cursor: pointer; }
.nav-item.active { color: var(--primary); font-weight: bold; }
.nav-icon { font-size: 1.5rem; display: block; margin-bottom: 2px; }

.view-section { display: none; }
.view-section.active { display: block; }

/* Buttons */
.button { padding: 8px 12px; border-radius: 4px; border: 1px solid #ccc; cursor: pointer; font-weight: bold; background-color: #f5f5f5; text-align: center;}
.button-primary { background-color: var(--primary); color: white; border-color: var(--primary); }
.button-danger { background-color: #ffebee; color: var(--danger); border-color: #e57373; }
.button-import { background-color: #e3f2fd; color: #1565c0; border-color: #90caf9; }
.button-snooze { background-color: #fff3e0; color: #e65100; border-color: #ffb74d; flex: 0 0 40px; }
.button-today-mini { background-color: white; border: 1px solid #ccc; font-size: 0.8rem; padding: 4px 10px; border-radius: 15px; cursor: pointer; color: #555; margin-top: 5px; }
.button-xs { padding: 4px 8px; font-size: 0.75rem; border: 1px solid #ccc; border-radius: 4px; background-color: #f0f0f0; cursor: pointer; }
.button-nav { background: none; border: 1px solid #eee; border-radius: 4px; cursor: pointer; padding: 2px 8px; color: #555; }

/* Plant Card (Today View) */
.plant-card { background: var(--card); border-radius: 12px; padding: 20px; margin-bottom: 15px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); border-left: 6px solid var(--primary); position: relative; }
.plant-name { font-size: 1.3rem; font-weight: bold; padding-right: 30px; }
.plant-info { font-size: 0.9rem; color: #666; margin-bottom: 15px; }

/* ▼▼▼ 修正: アクションエリアをグリッドレイアウトに変更しボタン配置を最適化 ▼▼▼ */
.action-area { 
    display: grid; 
    grid-template-columns: 2fr 1fr 1fr 1fr; /* 水やりボタンを大きく、他を等分 */
    gap: 8px; 
}

.btn { width: 100%; padding: 12px 0; border: none; border-radius: 8px; font-size: 1rem; font-weight: bold; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 5px; }
.btn-edit-icon { position: absolute; top: 15px; right: 15px; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #999; padding: 5px; }
.btn-icon-only { background: none; border: 1px solid #ddd; border-radius: 50%; width: 36px; height: 36px; cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; }

.btn-water { background-color: var(--primary); color: white; }
.btn-water.done { background-color: #ccc; color: #666; }

/* 日向ぼっこ・栄養ボタンの共通スタイル */
.btn-sub { background-color: white; border: 1px solid #ddd; transition: all 0.2s; font-size: 1.2rem; }

/* 日向ぼっこ */
.btn-sun { color: var(--accent); border-color: var(--accent); }
.btn-sun.active { background-color: var(--accent); color: white; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }

/* 栄養（新設） */
.btn-nutrient { color: var(--nutrient); border-color: var(--nutrient); }
.btn-nutrient.active { background-color: var(--nutrient); color: white; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }

/* 先送り */
.btn-snooze { background-color: #fff3e0; color: #e65100; border: 1px solid #ffb74d; font-size: 1.2rem; }

.note-input { margin-top: 10px; width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; font-size: 0.9rem; }

/* Calendar & Logs */
#calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; background: white; padding: 10px; border-radius: 8px; border: 1px solid #eee; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }

.log-table-title { margin-top:30px; margin-bottom:10px; }

.log-table-wrapper {
    overflow-x: auto;
    margin-top: 20px;
    border: 1px solid #eee;
    border-radius: 12px;
    background-color: #ffffff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.log-table { border-collapse: collapse; width: auto; font-size: 0.8rem; }
.log-table th, .log-table td { border: 1px solid #f0f0f0; padding: 8px; text-align: center; min-width: 40px; }
.log-table td { cursor: pointer; transition: background-color 0.2s; }
.log-table td:hover { background-color: #f9f9f9; }
.log-table th, .log-table td:first-child { cursor: default; }
.log-table th:first-child, .log-table td:first-child { text-align: left; position: sticky; left: 0; background: #fafafa; min-width: 120px; font-weight:bold; z-index: 10; border-right: 2px solid #eee; }
.log-table td.has-memo { cursor: pointer; }
.log-table th.is-today, .log-table td.is-today { background-color: #e8f5e9; border-left: 2px solid var(--primary); border-right: 2px solid var(--primary); }

/* 曜日ごとの色分け */
.weekday-sun { color: #E53935; }
.weekday-sat { color: #1E88E5; }

.future-water { opacity: 0.3; filter: grayscale(100%); pointer-events: none; transform: scale(0.8); }

/* Plant List Table (Settings View) */
#plant-list-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border: 1px solid #eee;
    overflow: hidden;
}
#plant-list-table thead tr { background-color: #fafafa; }
#plant-list-table th { padding: 12px 10px; text-align: left; color: #555; font-weight: bold; border-bottom: 2px solid #eee; }
#plant-list-table td { padding: 12px 10px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; }
#plant-list-table tr:last-child td { border-bottom: none; }
#plant-list-table td b { color: #333; font-size: 0.95rem; }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal-content { background: white; padding: 20px; border-radius: 8px; max-width: 90%; width: 400px; max-height: 90vh; overflow-y: auto; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
#action-modal .modal-content, #confirm-water-modal .modal-content { text-align: center; }
#action-modal-plant-name { margin-top: 0; margin-bottom: 25px; font-size: 1.2rem; }
.action-modal-buttons { display: flex; flex-direction: column; gap: 15px; margin-bottom: 25px; }
.action-modal-buttons .button { padding: 15px; font-size: 1.1rem; width: 100%; }
.button-cancel { background: none; border: none; color: #888; cursor: pointer; text-decoration: underline; font-size: 1rem; padding: 10px; }

/* Snooze List Modal */
.snooze-list-item { display: flex; justify-content: space-between; align-items: start; border-bottom: 1px solid #eee; padding: 10px 0; }
.snooze-date { color: #888; font-size: 0.8rem; }

/* List & Forms */
.list-buttons { margin-bottom: 15px; display:flex; gap:10px; }
.list-section-title { margin-top: 30px; margin-bottom: 10px; padding-bottom: 5px; border-bottom: 2px solid var(--primary); }
.list-buttons-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px;}
.form-body { display: flex; flex-direction: column; gap: 15px; margin-bottom: 20px; }
.form-group { display: flex; flex-direction: column; }
.form-group label { margin-bottom: 5px; font-size: 0.9rem; color: #555; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; font-size: 1rem; }
.form-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 15px; }
.form-select { width: 100%; padding: 10px; margin-bottom: 15px; border: 1px solid #ddd; border-radius: 6px; background-color: #fff; font-size: 1rem; -webkit-appearance: none; appearance: none; background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007CB2%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E'); background-repeat: no-repeat; background-position: right .7em top 50%; background-size: .65em auto; }

/* Sortable List */
.sortable-row { cursor: move; }
.sortable-row.dragging { opacity: 0.5; background: #e3f2fd; }
.drag-handle { cursor: move; color: #ccc; font-size: 1.2rem; padding-right: 5px; touch-action: none; }

/* Charts & Weather History */
.chart-container { margin-top: 30px; padding: 15px; background: #fff; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.data-summary-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 20px; }
.summary-item { background: #fff; padding: 15px; border-radius: 8px; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.summary-item-title { font-size: 0.8rem; color: #666; }
.summary-item-value { font-size: 1.5rem; font-weight: bold; color: var(--primary); }

/* Weather History Cards */
.weather-header { display: flex; justify-content: center; align-items: center; gap: 15px; margin-bottom: 10px; font-weight: bold; color: #555; }
.weather-history-container { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin-bottom: 20px; }
.weather-card { background: #fff; border: 1px solid #eee; border-radius: 4px; text-align: center; padding: 4px 1px; display: flex; flex-direction: column; justify-content: center; align-items: center; height: auto; aspect-ratio: 0.65; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,0.03); }
.weather-card.is-today { border: 2px solid var(--accent); background-color: #fff8e1; }
.weather-date { font-weight: bold; color: #555; margin-bottom: 2px; font-size: 0.65rem; line-height: 1.2; }
.weather-icon { font-size: 1.2rem; margin: 2px 0; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", sans-serif; line-height: 1.2; }
.weather-temp { color: #f44336; font-weight: bold; font-size: 0.65rem; line-height: 1.1; }
.weather-blue { color: #2196F3; font-size: 0.6rem; line-height: 1.1; }

/* Animation Particles */
.particle { position: fixed; pointer-events: none; font-size: 1.5rem; z-index: 9999; opacity: 0; animation: particle-pop 1s forwards ease-out; }
@keyframes particle-pop { 0% { opacity: 1; transform: translate(-50%, -50%) scale(0.5); } 50% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(1.2) rotate(var(--rot)); } }

/* Calendar Modal Logs Styles */
.log-row-container { padding: 10px 0; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: flex-start; }
.log-entry-group { margin-bottom: 15px; background: #fafafa; padding: 10px; border-radius: 6px; border-left: 3px solid var(--primary); }
.log-entry-group strong { display: block; margin-bottom: 5px; }
.log-item-row { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; min-height: 24px; }
.log-actions { display: none; gap: 5px; }
#modal-logs.is-editing .log-actions { display: flex; }
.modal-section { margin-top: 15px; border-top: 1px solid #eee; padding-top: 15px; }
.modal-section-title { font-size: 0.8rem; color: #666; margin-bottom: 5px; font-weight: bold; }

/* ▼▼▼ style.css 追加・修正箇所 ▼▼▼ */

/* 予定（未実施）の水滴：薄く表示 */
.planned-water {
    opacity: 0.3;
    filter: grayscale(100%); /* 少しグレーがからせる */
    transform: scale(0.9);
}

/* 実施済みの水滴：くっきり表示（既存のスタイルがあれば上書き不要ですが念のため） */
.done-water {
    opacity: 1;
    filter: none;
    transform: scale(1.1); /* 少し大きく強調 */
}

/* モーダル内の操作パネル（今日カードと同じような見た目にする） */
.modal-control-panel {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-top: 15px;
    text-align: center;
}

.modal-control-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.modal-input-group {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}
/* ▲▲▲ 追加終わり ▲▲▲ */