/* Custom Design Style - はぽにすた (style.css) */

:root {
    /* Font family */
    --font-main: 'Outfit', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Colors (Light Theme Default) */
    --bg-app: #f4f7f4;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-surface-solid: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    
    --text-primary: #121812;
    --text-secondary: #5f6e5f;
    --text-disabled: #9eb09e;
    
    --color-primary: #1b5e20;
    --color-primary-rgb: 27, 94, 32;
    --color-accent: #4caf50;
    --color-accent-light: rgba(76, 175, 80, 0.1);
    --color-urgent: #d32f2f;
    --color-urgent-light: rgba(211, 47, 47, 0.1);
    --color-purple: #673ab7;
    --color-purple-light: rgba(103, 58, 183, 0.1);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
    
    --blur-backdrop: blur(12px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-top: env(safe-area-inset-top, 0px);
}

/* Dark Theme Variables */
@media (prefers-color-scheme: dark) {
    .theme-system {
        --bg-app: #121412;
        --bg-surface: rgba(30, 34, 30, 0.8);
        --bg-surface-solid: #1e221e;
        --border-color: rgba(255, 255, 255, 0.08);
        
        --text-primary: #f5f8f5;
        --text-secondary: #a0ada0;
        --text-disabled: #586358;
        
        --color-primary: #81c784;
        --color-primary-rgb: 129, 199, 132;
        --color-accent: #4caf50;
        --color-accent-light: rgba(76, 175, 80, 0.2);
        --color-urgent: #e57373;
        --color-urgent-light: rgba(229, 115, 115, 0.2);
        --color-purple: #b39ddb;
        --color-purple-light: rgba(179, 157, 219, 0.2);
        
        --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
        --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
        --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
    }
}

.theme-light {
    --bg-app: #f4f7f4;
    --bg-surface: rgba(255, 255, 255, 0.85);
    --bg-surface-solid: #ffffff;
    --border-color: rgba(0, 0, 0, 0.08);
    
    --text-primary: #121812;
    --text-secondary: #5f6e5f;
    --text-disabled: #9eb09e;
    
    --color-primary: #1b5e20;
    --color-primary-rgb: 27, 94, 32;
    --color-accent: #4caf50;
    --color-accent-light: rgba(76, 175, 80, 0.1);
    --color-urgent: #d32f2f;
    --color-urgent-light: rgba(211, 47, 47, 0.1);
    --color-purple: #673ab7;
    --color-purple-light: rgba(103, 58, 183, 0.1);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.12);
}

.theme-dark {
    --bg-app: #121412;
    --bg-surface: rgba(30, 34, 30, 0.8);
    --bg-surface-solid: #1e221e;
    --border-color: rgba(255, 255, 255, 0.08);
    
    --text-primary: #f5f8f5;
    --text-secondary: #a0ada0;
    --text-disabled: #586358;
    
    --color-primary: #81c784;
    --color-primary-rgb: 129, 199, 132;
    --color-accent: #4caf50;
    --color-accent-light: rgba(76, 175, 80, 0.2);
    --color-urgent: #e57373;
    --color-urgent-light: rgba(229, 115, 115, 0.2);
    --color-purple: #b39ddb;
    --color-purple-light: rgba(179, 157, 219, 0.2);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.4);
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent; /* Remove tap overlay on mobile */
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    height: 100vh;
    height: -webkit-fill-available; /* mobile viewport height fix */
}

#app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh; /* dynamic viewport height */
    position: relative;
    max-width: 600px; /* Mobile width constraint on desktop (Overridden in Media Query) */
    margin: 0 auto;
    background-color: var(--bg-app);
    box-shadow: 0 0 32px rgba(0, 0, 0, 0.15);
}

/* Header */
#app-header {
    background-color: var(--bg-surface);
    backdrop-filter: var(--blur-backdrop);
    -webkit-backdrop-filter: var(--blur-backdrop);
    border-bottom: 1px solid var(--border-color);
    padding: calc(16px + var(--safe-area-top)) 20px 12px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

#header-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: 0.5px;
}

/* Main Content Area */
#main-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 0 100px 0; /* Bottom navigation space */
    position: relative;
}

.app-section {
    display: none;
    padding: 16px;
    animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.app-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Weather Widget */
#weather-widget {
    background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.08), rgba(var(--color-primary-rgb), 0.02));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px 16px;
    margin-bottom: 14px;
    min-height: 52px;
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

#weather-widget.loading {
    justify-content: center;
}

.weather-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(var(--color-primary-rgb), 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.weather-layout {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
}

.weather-icon-img {
    width: 38px;
    height: 38px;
}

.weather-info {
    display: flex;
    flex-direction: column;
}

.weather-city-desc {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.weather-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 2px;
}

.weather-temp {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-primary);
}

.weather-humidity, .weather-pop {
    display: flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    gap: 2px;
}

.weather-humidity .material-icons-round {
    color: var(--color-accent);
    font-size: 14px;
}

.weather-pop .material-icons-round {
    color: #2196f3;
    font-size: 14px;
}

.weather-error-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-urgent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
}

.weather-error-btn .material-icons-round {
    font-size: 18px;
}

/* Search Container */
.search-container {
    position: relative;
    margin-bottom: 16px;
}

#search-input {
    width: 100%;
    height: 48px;
    background-color: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0 40px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#search-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.1);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-primary);
    pointer-events: none;
}

.search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-disabled);
    cursor: pointer;
}

/* Sub Tabs (Active / Completed & Graphs) */
.sub-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    margin-bottom: 16px;
}

.sub-tab-btn {
    flex: 1;
    background: none;
    border: none;
    padding: 12px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s ease;
}

.sub-tab-btn.active {
    color: var(--color-primary);
    font-weight: 800;
}

.sub-tab-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50%;
    height: 3px;
    background-color: var(--color-primary);
    border-radius: 3px 3px 0 0;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Plant Card */
.plant-card {
    background-color: var(--bg-surface-solid);
    border-radius: 20px;
    padding: 18px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.plant-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.plant-card:active {
    transform: scale(0.98);
}

.card-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.card-photo-container {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background-color: var(--color-accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.card-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-photo-icon {
    font-size: 26px;
    color: var(--color-primary);
}

.card-meta {
    flex: 1;
    min-width: 0; /* truncate text child safety */
}

.plant-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: text-overflow;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.water-left-days {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary);
}

.water-left-days.urgent {
    color: var(--color-urgent);
}

.prediction-badge {
    text-align: right;
    flex-shrink: 0;
}

.prediction-label {
    display: inline-block;
    font-size: 9px;
    font-weight: 800;
    background-color: var(--color-purple-light);
    color: var(--color-purple);
    padding: 2px 6px;
    border-radius: 6px;
    margin-bottom: 2px;
}

.prediction-days {
    font-size: 15px;
    font-weight: 900;
    color: var(--color-purple);
}

.banju-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 800;
    background-color: rgba(var(--color-primary-rgb), 0.08);
    color: var(--color-primary);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    border-radius: 10px;
    border: none;
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    gap: 4px;
}

.btn:active {
    transform: scale(0.97);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    flex: 1;
}

.btn-outline:hover {
    background-color: var(--border-color);
}

.btn-primary {
    background-color: var(--color-primary);
    color: #ffffff;
    flex: 1.3;
}

.btn-primary:hover {
    filter: brightness(1.15);
}

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

.btn-block {
    width: 100%;
    height: 48px;
    font-size: 14px;
    border-radius: 14px;
}

.btn-text {
    background: none;
    color: var(--text-secondary);
}

.btn-text:hover {
    color: var(--text-primary);
}

.btn-danger-text {
    background: none;
    color: var(--color-urgent);
}

.btn-danger-text:hover {
    background-color: var(--color-urgent-light);
}

/* PC Sidebar Add Button (Mobile hidden by default) */
.sidebar-add-btn {
    display: none;
}

/* Floating Action Button */
.fab-btn {
    display: none; /* Hidden by default; visible only on plants tab */
    position: fixed;
    right: 20px;
    bottom: calc(80px + var(--safe-area-bottom));
    height: 52px;
    padding: 0 20px;
    border-radius: 26px;
    background: linear-gradient(135deg, var(--color-primary), #4caf50);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 16px rgba(var(--color-primary-rgb), 0.3);
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    z-index: 99; /* Ensure it floats above bottom navigation and sheet overlays */
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.fab-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(var(--color-primary-rgb), 0.2);
}

.fab-btn .material-icons-round {
    font-size: 22px;
}

.fab-btn .fab-label {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* Show floating action button only when on plant list page (section-home active) */
#section-home.active ~ .fab-btn {
    display: flex;
}

/* Bottom Navigation Bar / PC Sidebar */
#bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    height: calc(64px + var(--safe-area-bottom));
    background-color: var(--bg-surface);
    backdrop-filter: var(--blur-backdrop);
    -webkit-backdrop-filter: var(--blur-backdrop);
    border-top: 1px solid var(--border-color);
    display: flex;
    z-index: 9;
    padding-bottom: var(--safe-area-bottom);
}

.sidebar-logo {
    display: none; /* Hidden on mobile */
}

.nav-item {
    flex: 1;
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease, background-color 0.2s ease;
    padding-top: 4px;
}

.nav-item .icon-selected {
    display: none;
    color: var(--color-primary);
}

.nav-item.active {
    color: var(--color-primary);
}

.nav-item.active .icon-selected {
    display: inline-block;
}

.nav-item.active .icon-unselected {
    display: none;
}

.nav-label {
    font-size: 10px;
    font-weight: 700;
    margin-top: 4px;
}

/* Settings Styles */
.settings-content {
    padding: 8px 4px;
}

.settings-group h3 {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 20px 0;
}

.theme-chips {
    display: flex;
    gap: 10px;
}

.chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background-color: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    gap: 4px;
}

.chip.active {
    background-color: var(--color-accent-light);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.chip-check {
    font-size: 16px;
}

.setting-item-row {
    margin-bottom: 14px;
}

.setting-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.setting-col label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.switch-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.switch-row input[type="range"] {
    flex: 1;
    accent-color: var(--color-primary);
}

.val-label {
    font-size: 13px;
    font-weight: 800;
    width: 36px;
    text-align: right;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.checkbox-row label {
    font-size: 14px;
    font-weight: 700;
}

.btn-grid {
    display: flex;
    gap: 12px;
}

.btn-grid .btn {
    flex: 1;
    height: 44px;
    border-radius: 12px;
}

.terms-card {
    background-color: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
}

.theme-dark .terms-card {
    background-color: rgba(255, 255, 255, 0.02);
}

.terms-card h4 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.terms-card ul {
    list-style: none;
}

.terms-card li {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Modals Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--bg-surface-solid);
    border-radius: 24px;
    width: 100%;
    max-width: 420px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.modal-card.scrollable {
    overflow-y: auto;
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.modal-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.input-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.input-field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.required {
    color: var(--color-urgent);
}

.input-field input[type="text"],
.input-field input[type="password"],
.input-field input[type="number"],
.input-field input[type="date"] {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-app);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0 12px;
    font-family: var(--font-main);
    font-size: 16px;
    font-weight: 600;
    outline: none;
}

.input-field input:focus {
    border-color: var(--color-primary);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .input-field {
    flex: 1;
    min-width: 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.flex-spacer {
    flex: 1;
}

/* Add/Edit timeline items in dialog */
.form-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 16px 0;
}

.form-section-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.edit-timeline-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.timeline-row-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.row-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 700;
}

.timeline-row-info input[type="date"] {
    width: 100%;
    border: none;
    background: none;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    outline: none;
    margin-top: 2px;
}

.photo-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background-color: var(--bg-app);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.photo-icon-btn.has-photo {
    background-color: var(--color-accent-light);
    color: var(--color-primary);
}

/* Quick dialog custom rows */
.date-photo-row {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 16px;
}

.date-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.date-col label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.date-col input[type="date"] {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-app);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0 12px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    outline: none;
}

.photo-col {
    width: 100px;
}

.photo-btn {
    width: 100px;
    height: 60px;
    border-radius: 10px;
    border: 1px dashed var(--border-color);
    background-color: var(--bg-app);
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 10px;
    font-weight: 700;
    gap: 4px;
}

.photo-btn.has-photo {
    background-color: var(--color-accent-light);
    border-color: var(--color-primary);
    color: var(--color-primary);
    border-style: solid;
}

.photo-btn .material-icons-round {
    font-size: 20px;
}

/* Bottom Sheet Style Modal */
.bottom-sheet-overlay {
    align-items: flex-end;
    padding: 0;
}

.bottom-sheet {
    background-color: var(--bg-surface-solid);
    border-radius: 28px 28px 0 0;
    width: 100%;
    max-height: 86vh;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.12);
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding-bottom: var(--safe-area-bottom);
}

.bottom-sheet-overlay.active .bottom-sheet {
    transform: translateY(0);
}

.sheet-drag-handle {
    width: 36px;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    margin: 10px auto;
    flex-shrink: 0;
}

.sheet-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px 20px;
}

.scrollable::-webkit-scrollbar {
    width: 4px;
}
.scrollable::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 2px;
}

/* Detail page styling */
.detail-header {
    margin-bottom: 16px;
}

.title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

#detail-plant-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-primary);
    flex: 1;
    word-break: break-all;
}

.badge {
    font-size: 11px;
    font-weight: 800;
    background-color: var(--color-accent-light);
    color: var(--color-primary);
    padding: 4px 10px;
    border-radius: 12px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--color-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-chips-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.info-chip {
    flex: 1;
    background-color: var(--bg-app);
    border-radius: 14px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-color);
}

.chip-icon {
    font-size: 20px;
}

.text-primary {
    color: var(--color-primary);
}

.chip-data {
    display: flex;
    flex-direction: column;
}

.chip-label {
    font-size: 9px;
    color: var(--text-secondary);
    font-weight: 700;
}

.chip-value {
    font-size: 13px;
    font-weight: 800;
}

.prediction-card {
    background: linear-gradient(135deg, rgba(103, 58, 183, 0.08), rgba(103, 58, 183, 0.02));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.prediction-icon {
    color: var(--color-purple);
    font-size: 24px;
}

.prediction-text {
    display: flex;
    flex-direction: column;
}

.prediction-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--color-purple);
}

.prediction-desc {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1px;
}

.detail-section-title {
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 12px;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 28px;
    margin-bottom: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 6px;
    bottom: 6px;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -28px;
    top: 2px;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    background-color: var(--color-accent-light);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.timeline-dot .material-icons-round {
    font-size: 13px;
}

.timeline-content {
    background-color: var(--bg-app);
    border-radius: 16px;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    position: relative;
}

.timeline-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.timeline-event-info {
    display: flex;
    flex-direction: column;
}

.timeline-event-name {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 700;
}

.timeline-event-date {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 1px;
}

.timeline-event-actions {
    display: flex;
    gap: 4px;
}

.timeline-action-btn {
    background: none;
    border: none;
    color: var(--text-disabled);
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timeline-action-btn:hover {
    color: var(--text-secondary);
}

.timeline-photo {
    margin-top: 8px;
    border-radius: 10px;
    overflow: hidden;
    height: 130px;
    width: 100%;
    position: relative;
}

.timeline-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pin-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.pin-btn.active {
    background-color: var(--color-primary);
}

.pin-btn .material-icons-round {
    font-size: 14px;
}

/* Analytics Tab custom views */
.analytics-content-wrapper {
    position: relative;
}

.analytics-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 16px;
}

.analytics-card {
    background-color: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.analytics-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.analytics-card:active {
    transform: scale(0.99);
}

.analytics-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
}

.summary-badge {
    background-color: var(--color-primary);
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.summary-badge .material-icons-round {
    font-size: 11px;
}

.analytics-card-title {
    font-size: 17px;
    font-weight: 800;
    flex: 1;
}

.analytics-count-badge {
    background-color: rgba(var(--color-primary-rgb), 0.06);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 12px;
}

.analysis-bar-group {
    margin-bottom: 12px;
}

.analysis-bar-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.analysis-bar-val {
    font-weight: 800;
}

.analysis-bar-val.green { color: var(--color-accent); }
.analysis-bar-val.purple { color: var(--color-purple); }
.analysis-bar-val.orange { color: #ffa000; }

.analysis-bar-bg {
    height: 8px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.theme-dark .analysis-bar-bg {
    background-color: rgba(255, 255, 255, 0.05);
}

.analysis-bar-fill {
    height: 100%;
    border-radius: 4px;
    width: 0;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.analysis-bar-fill.green { background: linear-gradient(90deg, rgba(76,175,80,0.6), #4caf50); }
.analysis-bar-fill.purple { background: linear-gradient(90deg, rgba(103,58,183,0.6), #673ab7); }
.analysis-bar-fill.orange { background: linear-gradient(90deg, rgba(255,160,0,0.6), #ffa000); }

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    margin-top: 14px;
}

.grid-col {
    display: flex;
    flex-direction: column;
}

.grid-col-header {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 9px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.grid-col-header .material-icons-round {
    font-size: 11px;
}

.grid-col-val {
    font-size: 13px;
    font-weight: 900;
    color: var(--color-primary);
}

/* Trash screen settings */
.trash-card-row {
    background-color: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.trash-plant-name {
    font-weight: 700;
    font-size: 14px;
}

.trash-actions {
    display: flex;
    gap: 4px;
}

.empty-trash-msg, .empty-state {
    text-align: center;
    color: var(--text-disabled);
    padding: 30px 10px;
    font-size: 13px;
    font-weight: 700;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.empty-icon {
    font-size: 40px;
    color: rgba(var(--color-primary-rgb), 0.15);
}

/* Global Loader Screen */
.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    gap: 12px;
}

.loader-progress-container {
    width: 80%;
    max-width: 280px;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.loader-progress-bar-bg {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.loader-progress-bar-fill {
    width: 0%;
    height: 100%;
    background-color: var(--color-primary);
    border-radius: 3px;
    transition: width 0.1s ease-out;
}

#global-loader-progress-text {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.photo-status-ok {
    font-size: 11px;
    font-weight: 800;
    background-color: var(--color-accent-light);
    color: var(--color-primary);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Monthly Detail Sheets styling */
.monthly-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-primary);
}
.monthly-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.monthly-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.monthly-row {
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.monthly-month {
    font-size: 16px;
    font-weight: 700;
}
.monthly-stats-col {
    text-align: right;
}
.monthly-weight {
    font-size: 18px;
    font-weight: 900;
    color: var(--color-primary);
}
.monthly-bags {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 1px;
}


/* ==========================================================================
   DESKTOP / WIDE SCREEN STYLING (PC表示用のモダンデザイン定義)
   ========================================================================== */

@media (min-width: 768px) {
    /* 1. 全体レイアウト：縦積みから、横並び（左メニュー・右コンテンツ）へ */
    #app-container {
        max-width: 100%;
        flex-direction: row;
        background-color: var(--bg-app);
    }

    /* モバイル専用のヘッダーバーを非表示（サイドバーにタイトルを統合するため） */
    #app-header {
        display: none !important;
    }

    /* 2. サイドメニュー（ナビゲーション）の構築 */
    #bottom-nav {
        order: -1;
        position: sticky;
        top: 0;
        bottom: 0;
        left: 0;
        width: 260px;
        height: 100vh;
        height: 100dvh;
        flex-direction: column;
        background-color: var(--bg-surface-solid);
        border-top: none;
        border-right: 1px solid var(--border-color);
        padding: 32px 16px;
        justify-content: flex-start;
        align-items: stretch;
        gap: 10px;
        box-shadow: 2px 0 16px rgba(0, 0, 0, 0.02);
    }

    /* タイトルロゴ表示 */
    .sidebar-logo {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 0 12px 32px 12px;
        color: var(--color-primary);
    }

    .sidebar-logo .material-icons-round {
        font-size: 32px;
    }

    .sidebar-logo h2 {
        font-size: 18px;
        font-weight: 900;
        letter-spacing: 0.5px;
    }

    /* メニューアイテムを横並びのモダンなリンクボタン形式へ */
    .nav-item {
        flex: initial;
        flex-direction: row;
        width: 100%;
        height: 48px;
        padding: 0 16px;
        border-radius: 12px;
        justify-content: flex-start;
        gap: 14px;
        color: var(--text-secondary);
    }

    .nav-item:hover {
        background-color: rgba(var(--color-primary-rgb), 0.04);
        color: var(--text-primary);
    }

    .nav-item.active {
        background-color: rgba(var(--color-primary-rgb), 0.08);
        color: var(--color-primary);
    }

    .nav-item.active .icon-selected {
        color: var(--color-primary);
    }

    .nav-label {
        font-size: 14px;
        font-weight: 800;
        margin-top: 0;
    }

    /* 3. 右側メインコンテンツの拡張 */
    #main-content {
        padding: 32px 40px;
        overflow-y: auto;
    }

    .app-section {
        padding: 0;
        max-width: 1000px;
        margin: 0 auto;
    }

    /* 4. 植物リスト：1列からダッシュボード風マルチグリッドへ */
    #plant-list-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
        gap: 20px;
    }

    .plant-card {
        margin-bottom: 0;
    }

    /* 検索バーの横幅最適化 */
    .search-container {
        max-width: 480px;
        margin-bottom: 24px;
    }

    /* 天気ウィジェットの最適化 */
    #weather-widget {
        max-width: 480px;
        margin-bottom: 24px;
    }

    /* 5. 周期分析：2列のグリッド配置へ */
    #analytics-data-container {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: 24px;
    }

    .analytics-section-title,
    #analytics-data-container .empty-state {
        grid-column: 1 / -1;
    }

    .analytics-card {
        margin-bottom: 0;
    }

    /* 6. 設定画面：2カラム（設定項目／バックアップなど）レイアウト */
    .settings-content {
        display: grid;
        grid-template-columns: 1.1fr 0.9fr;
        gap: 32px;
        align-items: start;
    }

    .settings-content hr.divider {
        display: none; /* グリッド表示時は水平線を隠す */
    }

    .settings-group {
        background-color: var(--bg-surface-solid);
        border: 1px solid var(--border-color);
        border-radius: 24px;
        padding: 24px;
        box-shadow: var(--shadow-sm);
        margin-bottom: 0;
    }

    /* ゴミ箱と利用規約は最下部で全幅表示 */
    .settings-group:nth-of-type(4),
    .terms-card {
        grid-column: 1 / -1;
    }

    /* 7. ダイアログ・ボトムシートのアダプティブ化 */
    /* モバイル用「ボトムシート」をPCでは中央のモーダルカードへ変換 */
    .bottom-sheet-overlay {
        align-items: center;
        justify-content: center;
        padding: 20px;
    }

    .bottom-sheet {
        border-radius: 24px;
        width: 100%;
        max-width: 580px;
        max-height: 85vh;
        box-shadow: var(--shadow-lg);
        transform: translateY(24px);
    }

    .bottom-sheet-overlay.active .bottom-sheet {
        transform: translateY(0);
    }

    /* PCではスワイプ用ハンドルを非表示 */
    .sheet-drag-handle {
        display: none;
    }

    .sheet-content {
        padding: 24px;
    }

    /* PCではフローティングボタンを非表示にし、サイドバー内の登録ボタンを表示 */
    .fab-btn {
        display: none !important;
    }

    .sidebar-add-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        height: 48px;
        margin-bottom: 20px;
        background: linear-gradient(135deg, var(--color-primary), #4caf50);
        color: #ffffff;
        border: none;
        border-radius: 12px;
        font-size: 14px;
        font-weight: 800;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.2);
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .sidebar-add-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 16px rgba(var(--color-primary-rgb), 0.3);
        background: linear-gradient(135deg, #1b5e20, #388e3c);
    }

    .sidebar-add-btn:active {
        transform: translateY(0);
        box-shadow: 0 2px 6px rgba(var(--color-primary-rgb), 0.2);
    }

    .sidebar-add-btn .material-icons-round {
        font-size: 20px;
    }
}

/* ================= LOGIN SCREEN ================= */
.login-screen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 50%, #4caf50 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.login-screen-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 28px;
    width: 100%;
    max-width: 400px;
    padding: 28px 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    margin: auto;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-screen-overlay.active .login-card {
    transform: translateY(0);
}

/* ダークモード時のログインカード調整 */
body.theme-dark .login-card {
    background: rgba(30, 40, 30, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.login-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 24px;
}

.login-logo .material-icons-round {
    font-size: 52px;
    color: #2e7d32;
    background-color: rgba(46, 125, 50, 0.15);
    padding: 14px;
    border-radius: 22px;
    margin-bottom: 12px;
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 125, 50, 0.4);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(46, 125, 50, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(46, 125, 50, 0);
    }
}

.login-logo h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.login-logo p {
    font-size: 12px;
    color: var(--text-secondary);
}

.login-tabs {
    display: flex;
    background-color: var(--bg-app);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 24px;
}

.login-tab-btn {
    flex: 1;
    height: 38px;
    border: none;
    background: none;
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.login-tab-btn.active {
    background-color: var(--bg-surface-solid);
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

.login-error-alert {
    background-color: rgba(211, 47, 47, 0.1);
    border: 1px solid rgba(211, 47, 47, 0.2);
    color: #d32f2f;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    animation: shake-error 0.35s ease;
}

@keyframes shake-error {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* スムーズテーマ切替トランジション */
body, .card, header, nav, .btn, .modal-card, .bottom-sheet, .theme-chips .chip, .sub-tab-btn, .nav-item, .plant-card {
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                color 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.2s ease;
}

/* 要水替（Urgent）のパルスアニメーション */
@keyframes pulse-urgent {
    0% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.5);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(211, 47, 47, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(211, 47, 47, 0);
    }
}
.btn-card-water.urgent {
    animation: pulse-urgent 2s infinite;
}

/* グラスモーフィズムの上書き (透過率向上とぼかしの追加) */
.card, .modal-card, .bottom-sheet, #weather-widget {
    background: var(--bg-surface) !important;
    backdrop-filter: var(--blur-backdrop) saturate(130%) !important;
    -webkit-backdrop-filter: var(--blur-backdrop) saturate(130%) !important;
    border: 1px solid var(--border-color) !important;
}

/* タイムライン メモ用カラー調整 */
.timeline-dot {
    transition: background-color 0.3s ease;
}
.timeline-item.memo .timeline-dot {
    background-color: var(--color-purple-light);
    color: var(--color-purple);
}

/* メモ入力テキストエリア */
textarea#memo-content {
    font-size: 14px;
    line-height: 1.5;
}

/* 周期分析画面用グラフコンテナのスタイル */
.analytics-chart-container {
    width: 100%;
    margin: 10px 0 20px 0;
    border-radius: 16px;
    padding: 12px;
    background: var(--bg-surface) !important;
    backdrop-filter: var(--blur-backdrop) saturate(130%) !important;
    -webkit-backdrop-filter: var(--blur-backdrop) saturate(130%) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* 周期分析カードのタップ時のインタラクションと詳細ボタン */
.analytics-card {
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.analytics-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary) !important;
}

.analytics-card.active-chart {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.15), var(--shadow-md);
}

.btn-analytics-detail {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    margin: 0;
    border-radius: 8px;
    background: var(--color-accent-light);
    color: var(--color-primary);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-analytics-detail:hover {
    background: var(--color-primary);
    color: white;
}

/* ==========================================================================
   CHAT SYSTEM STYLING
   ========================================================================== */
.app-section#section-chat {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: calc(64px + var(--safe-area-bottom));
    padding: 12px;
    display: none;
    flex-direction: column;
}

.app-section#section-chat.active {
    display: flex;
}

.chat-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

@media (min-width: 768px) {
    .app-section#section-chat {
        position: relative;
        bottom: 0;
        height: calc(100vh - 128px);
        height: calc(100dvh - 128px);
        padding: 0;
        display: none;
    }
    .app-section#section-chat.active {
        display: flex;
    }
    .chat-wrapper {
        height: 100%;
    }
}

/* チャットヘッダーバー (ニックネーム設定) */
.chat-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-bottom: 12px;
    gap: 12px;
    flex-shrink: 0;
}

.chat-room-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-room-title {
    font-size: 15px;
    font-weight: 800;
}

.chat-room-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.chat-nickname-field {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.chat-nickname-field label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

#chat-nickname-input {
    width: 100px;
    height: 32px;
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0 8px;
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

#chat-nickname-input:focus {
    border-color: var(--color-primary);
}

/* チャット履歴スクロール領域 */
.chat-messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 8px 4px 20px 4px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 12px;
}

/* メッセージアイテム共通 */
.chat-message-item {
    display: flex;
    flex-direction: column;
    max-width: 75%;
    width: fit-content;
}

/* 自分（右寄せ） */
.chat-message-item.message-self {
    align-self: flex-end;
    align-items: flex-end;
}

/* 相手（左寄せ） */
.chat-message-item.message-other {
    align-self: flex-start;
    align-items: flex-start;
}

/* メッセージの送信者名と時間 */
.message-meta {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 3px;
    font-weight: 600;
    display: flex;
    gap: 6px;
    align-items: center;
}

.message-self .message-meta {
    flex-direction: row-reverse;
}

/* 吹き出し（グラスモーフィズム対応） */
.message-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    word-break: break-all;
    box-shadow: var(--shadow-sm);
    position: relative;
}

/* 自分の吹き出し (緑系) */
.message-self .message-bubble {
    background-color: var(--color-primary) !important;
    color: #ffffff !important;
    border-bottom-right-radius: 4px;
    border: none !important;
}

/* 相手の吹き出し (グレー・白系) */
.message-other .message-bubble {
    background-color: var(--bg-surface) !important;
    backdrop-filter: var(--blur-backdrop) saturate(130%) !important;
    -webkit-backdrop-filter: var(--blur-backdrop) saturate(130%) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    border-bottom-left-radius: 4px;
}

/* 送信バー */
.chat-input-bar {
    display: flex;
    gap: 8px;
    padding: 8px;
    background-color: var(--bg-surface);
    backdrop-filter: var(--blur-backdrop) saturate(130%);
    -webkit-backdrop-filter: var(--blur-backdrop) saturate(130%);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

#chat-message-input {
    flex: 1;
    height: 40px;
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0 14px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

#chat-message-input:focus {
    border-color: var(--color-primary);
}

#btn-chat-send {
    width: 44px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
    padding: 0;
}

#btn-chat-send .material-icons-round {
    font-size: 20px;
}

/* ================= SCHEDULE CALENDAR SCREEN ================= */
#calendar-view-container {
    animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.calendar-header-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 4px 8px;
    background-color: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
}

#cal-month-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--color-primary);
}

.calendar-grid-wrapper {
    background-color: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 14px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 16px;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-secondary);
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.calendar-weekdays .sunday {
    color: var(--color-urgent);
}

.calendar-weekdays .saturday {
    color: #2196f3;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    row-gap: 4px;
}

.calendar-day-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 6px 2px 4px 2px;
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.calendar-day-cell:hover {
    background-color: rgba(var(--color-primary-rgb), 0.05);
}

.calendar-day-cell.other-month {
    opacity: 0.3;
}

.calendar-day-cell.today {
    background-color: var(--color-primary);
    color: #ffffff !important;
    font-weight: 800;
}

.calendar-day-cell.today:hover {
    background-color: var(--color-primary);
    filter: brightness(1.1);
}

.calendar-day-cell.today .cal-day-num {
    color: #ffffff;
}

.calendar-day-cell.selected {
    border-color: var(--color-primary);
    background-color: rgba(var(--color-primary-rgb), 0.08);
}

.calendar-day-cell.today.selected {
    border-color: var(--text-primary);
    background-color: var(--color-primary);
}

.cal-day-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.cal-events-dots {
    display: flex;
    justify-content: center;
    gap: 3px;
    width: 100%;
    height: 6px;
    margin-top: auto;
}

.cal-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cal-dot.dot-water {
    background-color: #2196f3;
}

.cal-dot.dot-harvest {
    background-color: var(--color-purple);
}

.calendar-events-panel {
    background-color: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.events-panel-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.events-panel-title .material-icons-round {
    color: var(--color-primary);
    font-size: 18px;
}

#calendar-events-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calendar-event-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background-color: var(--bg-app);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    border-left-width: 4px;
}

.calendar-event-item.event-water {
    border-left-color: #2196f3;
}

.calendar-event-item.event-harvest {
    border-left-color: var(--color-purple);
}

.event-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.event-plant-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-type-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.event-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.event-actions .btn {
    height: 32px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 11px;
}

#section-home .sub-tab-indicator {
    width: 33.333%;
}
#section-graph .sub-tab-indicator {
    width: 50%;
}

/* 分析セクション見出し */
.analytics-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 22px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 1.5px solid rgba(76, 175, 80, 0.15);
}

.analytics-section-title:first-of-type {
    margin-top: 8px;
}

.analytics-section-title span.material-icons-round {
    font-size: 16px;
}

/* デバッグコンソールモーダルのレイアウト */
.debug-modal-card {
    max-width: 680px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

/*.debug-tabs*/
.debug-tabs {
    display: flex;
    gap: 8px;
    margin: 15px 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
    -webkit-overflow-scrolling: touch;
}

.debug-tabs::-webkit-scrollbar {
    display: none; /* Safari/Chrome */
}

.debug-tab-btn {
    background: none;
    border: none;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.debug-tab-btn:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.debug-tab-btn.active {
    background: var(--color-primary);
    color: white;
}

.debug-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
}

.debug-tab-content.active {
    display: block;
}

/* ログイン履歴テーブル */
.debug-table-wrapper {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-surface-solid);
}

.debug-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    text-align: left;
}

.debug-table th, .debug-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.debug-table th {
    background: var(--bg-card);
    font-weight: 700;
    color: var(--text-secondary);
}

.debug-table tbody tr:last-child td {
    border-bottom: none;
}

.debug-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
}

.debug-badge.badge-success {
    background-color: rgba(76, 175, 80, 0.12);
    color: var(--color-primary);
}

.debug-badge.badge-failure {
    background-color: rgba(244, 67, 54, 0.12);
    color: var(--color-urgent);
}

/* システムエラーリスト */
.debug-errors-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.debug-error-item {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    background: var(--bg-surface-solid);
}

.debug-error-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.debug-source-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
}

.debug-source-badge.source-client {
    background-color: rgba(33, 150, 243, 0.12);
    color: #2196f3;
}

.debug-source-badge.source-server {
    background-color: rgba(255, 152, 0, 0.12);
    color: var(--color-orange);
}

.debug-error-time {
    font-size: 10px;
    color: var(--text-disabled);
}

.debug-error-message {
    font-weight: 700;
    font-size: 12px;
    color: var(--text-primary);
    margin-bottom: 6px;
    word-break: break-all;
}

.debug-error-stack {
    background: #1e1e1e !important;
    color: #f1f1f1 !important;
    padding: 10px;
    border-radius: 6px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 10px;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 6px 0 0 0;
}

/* システム情報 */
.debug-status-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.status-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.status-val {
    font-size: 12px;
    font-family: monospace;
    color: var(--color-primary);
    font-weight: bold;
}

/* 通知設定モダンデザイン */
.modern-setting-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modern-setting-card.disabled-state {
    opacity: 0.55;
}

.setting-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    transition: padding 0.3s ease;
}

.modern-setting-card.disabled-state .setting-card-header {
    padding-bottom: 0;
}

.setting-title-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.setting-icon {
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.icon-morning {
    color: #ffb300;
    background: rgba(255, 179, 0, 0.12);
}

.icon-afternoon {
    color: #5c6bc0;
    background: rgba(92, 107, 192, 0.12);
}

.icon-weekends {
    color: var(--color-primary);
    background: rgba(76, 175, 80, 0.12);
}

.setting-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.setting-desc {
    margin: 2px 0 0 0;
    font-size: 11px;
    color: var(--text-secondary);
}

/* iOS Toggle Custom Switch */
.modern-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.modern-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.modern-switch-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 34px;
}

.modern-switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.modern-switch input:checked + .modern-switch-slider {
    background-color: var(--color-primary);
}

.modern-switch input:checked + .modern-switch-slider:before {
    transform: translateX(20px);
}

/* Slide active/inactive body */
.setting-card-body {
    overflow: hidden;
    max-height: 100px;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin-top 0.3s ease;
    opacity: 1;
    margin-top: 8px;
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
}

.modern-setting-card.disabled-state .setting-card-body {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    padding-top: 0;
    border-top-color: transparent;
    pointer-events: none;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Custom Range */
.modern-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    height: 24px;
}

.modern-range:focus {
    outline: none;
}

.modern-range::-webkit-slider-runnable-track {
    background: var(--border-color);
    height: 6px;
    border-radius: 3px;
    transition: background 0.3s ease;
}

.modern-range::-moz-range-track {
    background: var(--border-color);
    height: 6px;
    border-radius: 3px;
    transition: background 0.3s ease;
}

#slider-notify-1::-webkit-slider-runnable-track {
    background: linear-gradient(90deg, var(--border-color) 40%, rgba(255, 179, 0, 0.3));
}

#slider-notify-2::-webkit-slider-runnable-track {
    background: linear-gradient(90deg, var(--border-color) 40%, rgba(92, 107, 192, 0.3));
}

.modern-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    margin-top: -6px;
    background-color: var(--color-primary);
    height: 18px;
    width: 18px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.1s ease;
}

.modern-range::-moz-range-thumb {
    border: none;
    background-color: var(--color-primary);
    height: 18px;
    width: 18px;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: transform 0.1s ease;
}

#slider-notify-1::-webkit-slider-thumb {
    background-color: #ffb300;
}
#slider-notify-1::-moz-range-thumb {
    background-color: #ffb300;
}

#slider-notify-2::-webkit-slider-thumb {
    background-color: #5c6bc0;
}
#slider-notify-2::-moz-range-thumb {
    background-color: #5c6bc0;
}

.modern-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.modern-range::-moz-range-thumb:hover {
    transform: scale(1.15);
}

/* Time badges */
.val-badge {
    display: inline-block;
    min-width: 52px;
    text-align: center;
    padding: 3px 6px;
    font-family: monospace;
    font-size: 12px;
    font-weight: 700;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.badge-morning {
    background: rgba(255, 179, 0, 0.08);
    color: #ffb300;
    border: 1px solid rgba(255, 179, 0, 0.15);
}

.badge-afternoon {
    background: rgba(92, 107, 192, 0.08);
    color: #5c6bc0;
    border: 1px solid rgba(92, 107, 192, 0.15);
}

/* 開発者用デバッグコンソールのレスポンシブスタイル */
@media (max-width: 600px) {
    .debug-modal-card {
        padding: 12px;
        width: 95%;
        max-height: 92vh;
    }
    
    .debug-tabs {
        margin: 10px 0;
        padding-bottom: 6px;
        gap: 6px;
    }
    
    .debug-tab-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
    
    .debug-table th, .debug-table td {
        padding: 8px 6px;
        font-size: 10px;
    }
    
    /* アカウント管理などのボタンの隙間とサイズ調整 */
    .debug-table td div {
        gap: 4px !important;
    }
    
    .debug-table td button {
        height: 24px !important;
        padding: 0 4px !important;
        font-size: 9px !important;
    }
    
    .debug-table td button span.material-icons-round {
        font-size: 10px !important;
    }
    
    .debug-errors-container {
        gap: 8px;
    }
    
    .debug-error-item {
        padding: 8px;
    }
    
    .debug-error-message {
        font-size: 11px;
    }
    
    .debug-error-stack {
        font-size: 9px;
        padding: 6px;
    }
    
    .debug-status-grid {
        gap: 8px;
    }
    
    .status-row {
        padding: 8px 0;
        font-size: 11px;
    }
}

/* ================= LANDING PAGE ================= */
.landing-page-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-app);
    color: var(--text-primary);
    z-index: 99990;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    font-family: var(--font-main);
    -webkit-overflow-scrolling: touch;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.landing-page-overlay.active {
    display: flex;
}

/* Background animated blurred blobs */
.landing-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.12;
    z-index: -1;
    animation: blob-float 20s infinite alternate ease-in-out;
}

.landing-blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background-color: var(--color-accent);
}

.landing-blob-2 {
    bottom: -10%;
    right: -10%;
    width: 45vw;
    height: 45vw;
    background-color: var(--color-purple);
    animation-delay: -5s;
}

.landing-blob-3 {
    top: 40%;
    left: 30%;
    width: 30vw;
    height: 30vw;
    background-color: #81c784;
    animation-delay: -10s;
}

@keyframes blob-float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.15); }
}

.landing-container {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navbar */
.landing-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 0;
    border-bottom: 1px solid var(--border-color);
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.landing-logo-icon {
    font-size: 32px;
    color: var(--color-primary);
}

.landing-logo-text {
    font-weight: 900;
    font-size: 22px;
    letter-spacing: -0.5px;
    color: var(--text-primary);
}

.landing-login-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

/* Hero Section */
.landing-hero {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 48px;
    align-items: center;
    padding: 80px 0;
}

.landing-hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.landing-badge {
    background-color: var(--color-accent-light);
    color: var(--color-primary);
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.landing-hero-title {
    font-size: 48px;
    font-weight: 900;
    line-height: 1.25;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-hero-desc {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 36px;
}

.landing-hero-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.landing-cta-btn {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-primary);
    color: white !important;
    border: none;
    box-shadow: 0 4px 16px rgba(var(--color-primary-rgb), 0.25);
    cursor: pointer;
    transition: all 0.2s ease;
}

.landing-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--color-primary-rgb), 0.35);
}

.landing-secondary-btn {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.landing-secondary-btn:hover {
    color: var(--color-primary);
}

/* Illustration Mockup */
.landing-hero-illustration {
    display: flex;
    justify-content: center;
}

.illustration-dashboard-card {
    background: var(--bg-surface);
    backdrop-filter: var(--blur-backdrop);
    -webkit-backdrop-filter: var(--blur-backdrop);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    width: 100%;
    max-width: 320px;
    box-shadow: var(--shadow-lg);
    animation: mockup-float 6s infinite ease-in-out;
}

@keyframes mockup-float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0); }
}

.illustration-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.illustration-plant-avatar {
    font-size: 28px;
    background-color: var(--color-accent-light);
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
}

.illustration-plant-name {
    font-weight: 800;
    font-size: 15px;
}

.illustration-plant-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.illustration-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.metric-item {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
}

.metric-label {
    font-size: 10px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.metric-value {
    font-size: 18px;
    font-weight: 800;
}

.metric-unit {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
}

.illustration-progress-bar {
    background: var(--border-color);
    height: 6px;
    border-radius: 100px;
    overflow: hidden;
}

.illustration-progress-fill {
    background: var(--color-accent);
    height: 100%;
    border-radius: 100px;
}

/* Features Grid */
.landing-features {
    padding: 80px 0;
    border-top: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-size: 32px;
    font-weight: 900;
    margin-bottom: 12px;
}

.section-desc {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.feature-card {
    background: var(--bg-surface);
    backdrop-filter: var(--blur-backdrop);
    -webkit-backdrop-filter: var(--blur-backdrop);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary);
}

.feature-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.feature-icon-wrapper span {
    font-size: 24px;
    color: var(--color-primary);
}

.feature-icon-wrapper.f-1 { background-color: rgba(27, 94, 32, 0.1); }
.feature-icon-wrapper.f-2 { background-color: rgba(76, 175, 80, 0.1); }
.feature-icon-wrapper.f-3 { background-color: rgba(103, 58, 183, 0.1); }
.feature-icon-wrapper.f-3 span { color: var(--color-purple); }
.feature-icon-wrapper.f-4 { background-color: rgba(33, 150, 243, 0.1); }
.feature-icon-wrapper.f-4 span { color: #2196f3; }
.feature-icon-wrapper.f-5 { background-color: rgba(255, 152, 0, 0.1); }
.feature-icon-wrapper.f-5 span { color: #ff9800; }

.feature-card h3 {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 10px;
}

.feature-card p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Footer */
.landing-footer {
    text-align: center;
    padding: 40px 0;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
}

/* Close button for login modal */
.login-close-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
    .landing-hero {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 40px 0;
    }
    
    .landing-hero-illustration {
        order: -1;
    }
    
    .landing-hero-title {
        font-size: 32px;
    }
    
    .landing-hero-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    .landing-cta-btn {
        justify-content: center;
    }
    
    .landing-secondary-btn {
        text-align: center;
        padding: 8px;
    }
    
    .section-title {
        font-size: 26px;
    }
}

/* 一括操作用の追加スタイル */
.search-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 16px;
    width: 100%;
}
.search-row .search-container {
    flex: 1;
    margin-bottom: 0;
}
#btn-toggle-select-mode {
    height: 48px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 16px;
    white-space: nowrap;
    margin: 0;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}
#btn-toggle-select-mode.active-mode {
    background-color: var(--color-urgent-light);
    border-color: var(--color-urgent);
    color: var(--color-urgent);
}

/* 植物カードの一括選択チェックボックス */
.plant-card {
    position: relative; /* カードチェックボックスの絶対配置基準 */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-checkbox-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
}
.card-checkbox {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2.5px solid var(--color-primary);
    background-color: var(--bg-surface-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
}
.card-checkbox .material-icons-round {
    font-size: 16px;
    color: white;
    font-weight: bold;
    display: none;
}
.plant-card.selected .card-checkbox {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}
.plant-card.selected .card-checkbox .material-icons-round {
    display: block;
}
.plant-card.selected {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 1px var(--color-primary), var(--shadow-md) !important;
    transform: scale(0.98);
}
.plant-card.selection-mode-card {
    cursor: pointer;
}

/* フローティング一括選択アクションバー */
#selection-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    height: calc(68px + var(--safe-area-bottom));
    background-color: var(--bg-surface);
    backdrop-filter: var(--blur-backdrop);
    -webkit-backdrop-filter: var(--blur-backdrop);
    border-top: 1px solid var(--border-color);
    display: none; /* JSでflexに切り替える */
    align-items: center;
    justify-content: space-between;
    padding: 0 16px var(--safe-area-bottom) 16px;
    z-index: 10;
    box-shadow: var(--shadow-lg);
    box-sizing: border-box;
}
.selection-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
#btn-select-all {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    margin: 0;
    height: auto;
    white-space: nowrap;
}
#txt-selected-count {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}
.selection-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.selection-actions .btn {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 8px;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    height: auto;
}
.selection-actions #btn-bulk-archive {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}
.selection-actions #btn-bulk-delete {
    background-color: var(--color-urgent);
    border-color: var(--color-urgent);
    color: white;
}
.selection-actions #btn-cancel-select {
    border-color: var(--border-color);
    color: var(--text-primary);
}

/* ゴミ箱ヘッダーと一括完全削除ボタン */
.trash-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    width: 100%;
}
.trash-header-row h3 {
    margin-bottom: 0;
}
#btn-empty-trash {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    display: none; /* JSで制御 */
    align-items: center;
    gap: 4px;
    border-radius: 8px;
    color: var(--color-urgent);
    border-color: var(--color-urgent);
    transition: all 0.2s ease;
    height: auto;
}
#btn-empty-trash:hover {
    background-color: var(--color-urgent-light);
}

