:root {
    --primary-color: #8D6E63; --accent-color: #D4AF37; --accent-dark: #B8860B;
    --bg-paper: #F5F1E6; --text-ink: #3E2723; --text-light: #5D4037;
    --success-color: #2E7D32; --danger-color: #C62828;
    --shadow-soft: 0 4px 15px rgba(62, 39, 35, 0.15);
}

body {
    font-family: 'Lora', serif; margin: 0; background-color: var(--bg-paper);
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
    color: var(--text-ink); min-height: 100vh; padding-bottom: 130px;
}

.header {
    background: linear-gradient(to bottom, #5D4037, #3E2723); color: var(--accent-color);
    padding: 15px; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 2px solid var(--accent-color); box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.header-text h1 { margin: 0; font-family: 'Cormorant Garamond', serif; font-size: 24px; font-weight: 700; letter-spacing: 1px; text-shadow: 1px 1px 2px rgba(0,0,0,0.5); }
.header-text p { margin: 2px 0 0; font-size: 11px; opacity: 0.8; font-style: italic; }

.header-btn {
    background: rgba(255,255,255,0.1); border: 1px solid var(--accent-color);
    color: var(--accent-color); padding: 8px 12px; border-radius: 20px;
    font-size: 12px; cursor: pointer; transition: 0.3s; text-decoration: none;
    display: flex; align-items: center; gap: 5px; font-weight: 600;
}
.header-btn:hover { background: var(--accent-color); color: #3E2723; }

.tabs-container {
    display: flex; overflow-x: auto; background: rgba(255,255,255,0.5);
    border-bottom: 1px solid #D7CCC8; position: sticky; top: 0; z-index: 100;
}
.tab {
    flex: 1 0 auto; padding: 15px 10px; text-align: center; cursor: pointer;
    border-bottom: 2px solid transparent; transition: 0.3s; font-size: 13px;
    font-weight: 600; color: var(--text-light); white-space: nowrap;
}
.tab { flex-direction: column; align-items: center; gap: 4px; }
.tab svg { width: 18px; height: 18px; opacity: 0.55; transition: 0.3s; }
.tab.active svg { opacity: 1; color: var(--accent-dark); }
.tab.active { color: var(--primary-color); border-bottom-color: var(--accent-color); background: rgba(255,255,255,0.8); }

.container { max-width: 700px; margin: 0 auto; padding: 20px 15px; }
.empty-state { text-align: center; margin-top: 50px; color: #8D6E63; font-style: italic; }
.empty-icon { font-size: 50px; opacity: 0.3; margin-bottom: 10px; }
.empty-title { font-family: "Cormorant Garamond", serif; font-size: 20px; font-weight: 700; font-style: normal; color: var(--text-light); margin-top: 10px; }
.empty-desc { font-size: 13.5px; max-width: 320px; margin: 8px auto 0; }

.card {
    background: rgba(255,255,255,0.9); margin-bottom: 15px; border-radius: 4px;
    border-left: 4px solid var(--accent-color); box-shadow: var(--shadow-soft);
    position: relative; transition: transform 0.2s;
}
.card:hover { transform: translateY(-2px); }
.card-body { padding: 15px; }
.card-title { font-family: 'Cormorant Garamond', serif; font-size: 18px; font-weight: 700; color: var(--text-ink); margin-bottom: 5px; border-bottom: 1px dashed #D7CCC8; padding-bottom: 5px; }
.card-text { font-size: 14px; line-height: 1.5; color: var(--text-light); }
.card-meta { font-size: 12px; margin-top: 10px; color: var(--accent-dark); font-style: italic; display: flex; align-items: center; gap: 5px; }
.card-actions { display: flex; gap: 10px; margin-top: 12px; border-top: 1px solid #EFEBE9; padding-top: 12px; flex-wrap: wrap; }

.goal-progress { height: 6px; background: #EFEBE9; border-radius: 3px; margin: 10px 0 8px; overflow: hidden; position: relative; }
.goal-progress .fill-done { position: absolute; left: 0; top: 0; bottom: 0; background: #A5D6A7; transition: width 0.5s ease; }
.goal-progress .fill-harvest { position: absolute; left: 0; top: 0; bottom: 0; background: var(--success-color); transition: width 0.5s ease; }

.counters-container { display: flex; gap: 10px; margin-bottom: 5px; }
.counter-badge {
    display: inline-flex; align-items: center; gap: 5px;
    background: #EFEBE9; padding: 5px 10px; border-radius: 20px;
    font-size: 12px; font-weight: bold; color: var(--text-light);
    cursor: pointer; border: 1px solid transparent; transition: 0.2s;
}
.counter-badge:hover { background: #fff; border-color: var(--accent-color); color: var(--text-ink); }
.counter-badge.done { color: var(--success-color); }
.counter-badge.zero { opacity: 0.5; pointer-events: none; }

.btn {
    border: none; padding: 8px 15px; border-radius: 3px; cursor: pointer;
    font-family: 'Lora', serif; font-size: 13px; transition: 0.2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    flex: 1;
}
.btn-primary { background: transparent; border: 1px solid var(--primary-color); color: var(--primary-color); }
.btn-success { background: transparent; border: 1px solid var(--success-color); color: var(--success-color); }
.btn-warning { background: transparent; border: 1px solid #F57F17; color: #F57F17; }
.btn-danger { background: transparent; border: 1px solid #BDBDBD; color: #757575; }

.btn-delete-confirm { background: var(--danger-color); border-color: var(--danger-color); color: white; animation: pulse 1s infinite; }
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.7; } 100% { opacity: 1; } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
input.invalid { border-color: var(--danger-color); animation: shake 0.3s ease; }
@keyframes cardIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.card { animation: cardIn 0.4s ease both; }


.fab {
    position: fixed; bottom: max(75px, calc(20px + env(safe-area-inset-bottom)));
    right: 20px; width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    color: white; border-radius: 50%; border: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); font-size: 24px; cursor: pointer; z-index: 50;
}
.meditation-btn {
    position: fixed; bottom: max(75px, calc(20px + env(safe-area-inset-bottom)));
    left: 20px; right: 90px;
    background: linear-gradient(to right, #5D4037, #3E2723); color: var(--accent-color);
    padding: 15px; border-radius: 30px; text-align: center;
    box-shadow: var(--shadow-soft); font-weight: 600; border: 1px solid var(--accent-color);
    z-index: 50; font-size: 14px;
}

input, select, textarea {
    width: 100%; padding: 12px; margin: 5px 0 15px; border: 1px solid #D7CCC8;
    border-radius: 3px; background: #FBFBFB; font-family: 'Lora', serif;
    font-size: 16px; color: var(--text-ink); box-sizing: border-box;
}
input:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2); }
label { font-size: 13px; font-weight: 600; color: var(--text-light); }

/* --- Модальные окна --- */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(62, 39, 35, 0.7); z-index: 200; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.modal.active { display: flex; }
.modal-content { background: var(--bg-paper); border-radius: 5px; width: 90%; max-width: 450px; position: relative; border: 1px solid var(--accent-color); box-shadow: 0 10px 30px rgba(0,0,0,0.3); max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-header { padding: 20px 25px 15px 25px; border-bottom: 1px solid #D7CCC8; position: relative; flex-shrink: 0; background: var(--bg-paper); }
.modal-header h3 { margin: 0; font-family: 'Cormorant Garamond', serif; color: var(--text-ink); font-size: 20px; padding-right: 30px; }
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 28px; cursor: pointer; color: var(--primary-color); line-height: 1; background: none; border: none; }
.modal-body { padding: 20px 25px; overflow-y: auto; flex-grow: 1; }

.info-text { text-align: left; font-size: 14px; line-height: 1.6; color: var(--text-ink); }
.info-text h2 { font-family: 'Cormorant Garamond', serif; color: var(--primary-color); border-bottom: 1px solid #D7CCC8; padding-bottom: 10px; margin-top: 25px; font-size: 20px; }
.info-text h2:first-child { margin-top: 0; }
.info-text h3 { color: var(--accent-dark); font-size: 17px; margin-top: 15px; margin-bottom: 8px; }
.info-text p { margin-bottom: 12px; }
.info-text ul { padding-left: 20px; margin-bottom: 15px; }
.info-text li { margin-bottom: 8px; }
.instruction-step { background: rgba(255,255,255,0.6); padding: 15px; border-radius: 5px; margin-bottom: 15px; border-left: 3px solid var(--accent-color); }
.instruction-step h3 { margin-top: 0; color: var(--accent-dark); font-size: 16px; margin-bottom: 10px; }
.highlight { color: var(--primary-color); font-weight: bold; }
.warning-box { background: rgba(198, 40, 40, 0.05); border-left: 3px solid var(--danger-color); padding: 15px; border-radius: 5px; margin: 15px 0; }
.success-box { background: rgba(46, 125, 50, 0.08); border-left: 3px solid var(--success-color); padding: 15px; border-radius: 5px; margin: 15px 0; }
.dev-warning { font-size: 12px; color: var(--danger-color); margin-top: 10px; font-style: italic; }

.info-menu-btn { display: block; width: 100%; padding: 20px; margin-bottom: 10px; background: rgba(255,255,255,0.5); border: 1px solid #D7CCC8; text-align: left; font-family: 'Lora', serif; font-size: 16px; color: var(--text-ink); border-radius: 5px; cursor: pointer; transition: 0.2s; }
.info-menu-btn:hover { background: #fff; border-color: var(--accent-color); }
.info-menu-btn span { font-size: 20px; margin-right: 10px; vertical-align: middle; }

.seed-list-item { background: rgba(255,255,255,0.6); border-left: 3px solid var(--accent-color); padding: 10px; margin-bottom: 8px; font-size: 14px; }
.seed-list-item.done-item { border-left-color: var(--success-color); background: rgba(46, 125, 50, 0.05); }

.settings-group { background: rgba(255,255,255,0.5); padding: 15px; border-radius: 5px; margin-bottom: 20px; border: 1px solid #D7CCC8; }
.toggle-switch { position: relative; display: inline-block; width: 50px; height: 28px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 28px; }
.slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--success-color); }
input:checked + .slider:before { transform: translateX(22px); }

.btn-action { width: 100%; padding: 15px; font-size: 16px; font-weight: 600; background: linear-gradient(to right, #5D4037, #3E2723); color: var(--accent-color); border: 1px solid var(--accent-color); border-radius: 5px; margin-bottom: 10px; cursor: pointer; font-family: 'Lora', serif; }
.btn-action:hover { opacity: 0.9; }
.btn-action.import { background: transparent; color: var(--text-ink); border: 1px solid #D7CCC8; }
.btn-action.secondary { background: transparent; color: var(--text-light); border: 1px solid #D7CCC8; }
.btn-action.update { background: linear-gradient(to right, var(--success-color), #1B5E20); border-color: var(--success-color); color: white; }
.btn-action.danger { background: transparent; color: var(--danger-color); border: 1px solid var(--danger-color); }
.btn-action.danger:hover { background: var(--danger-color); color: white; }

.version-box { background: rgba(255,255,255,0.7); border: 1px solid #D7CCC8; border-radius: 8px; padding: 15px; margin-bottom: 15px; text-align: center; }
.version-number { font-family: 'Cormorant Garamond', serif; font-size: 28px; font-weight: 700; color: var(--primary-color); }
.version-label { font-size: 12px; color: var(--text-light); margin-bottom: 5px; }
.version-status { font-size: 14px; margin-top: 10px; padding: 8px; border-radius: 5px; }
.version-status.checking { background: #FFF3E0; color: #E65100; }
.version-status.updated { background: #E8F5E9; color: var(--success-color); }
.version-status.available { background: #FFF8E1; color: #F57F17; }
.version-status.error { background: #FFEBEE; color: var(--danger-color); }

.update-info { font-size: 13px; color: var(--text-light); margin-top: 10px; padding: 10px; background: rgba(255,255,255,0.5); border-radius: 5px; }

/* Плашка обновления */
#update-notification { display: none; position: fixed; bottom: 80px; left: 20px; right: 20px; background: var(--accent-color); color: #3E2723; padding: 15px; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 1000; text-align: center; font-weight: bold; border: 2px solid #fff; }
#update-notification .update-note { font-size: 12px; font-weight: normal; margin-top: 8px; opacity: 0.85; }

/* --- Тост-уведомления --- */
#toast-container { position: fixed; bottom: max(80px, calc(25px + env(safe-area-inset-bottom))); left: 20px; right: 20px; z-index: 1500; pointer-events: none; }
.toast {
    background: #3E2723; color: #F5F1E6; padding: 14px 16px; border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3); display: flex; align-items: center; justify-content: space-between; gap: 12px;
    transform: translateY(80px); opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease; pointer-events: auto;
}
.toast-visible { transform: translateY(0); opacity: 1; }
.toast-message { flex: 1; font-size: 14px; }
.toast-action { background: var(--accent-color); color: #3E2723; border: none; padding: 6px 16px; border-radius: 4px; font-weight: bold; cursor: pointer; font-family: 'Lora', serif; font-size: 13px; white-space: nowrap; }

/* --- Таймлайн урожая --- */
.harvest-card { cursor: pointer; }
.harvest-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(46,125,50,0.2); }
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: #D7CCC8; }
.timeline-item { position: relative; margin-bottom: 16px; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-dot { position: absolute; left: -24px; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: #EFEBE9; border: 2px solid #D7CCC8; }
.timeline-dot.planned { background: #FFF176; border-color: var(--accent-color); }
.timeline-dot.done { background: #A5D6A7; border-color: var(--success-color); }
.timeline-dot.harvested { background: var(--success-color); border-color: #1B5E20; }
.timeline-content { font-size: 13px; line-height: 1.5; }
