        * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        
        /* Feedback on tap for all interactive elements */
        button, .btn, .header-btn, .header-back, .header-menu, .header-delete, .header-tokens,
        .location-card, .plant-card, .fab, .position-chip, .photo-thumb, .recognition-card, .batch-option {
            transition: transform 0.1s, opacity 0.1s;
        }
        button:active, .btn:active, .header-btn:active, .header-back:active, .header-menu:active, 
        .header-delete:active, .header-tokens:active, .fab:active, .position-chip:active,
        .recognition-card:active, .batch-option:active {
            transform: scale(0.95);
        }
        .location-card:active, .plant-card:active {
            opacity: 0.7;
        }
        .photo-thumb:active {
            transform: scale(0.9);
        }
        :root {
            --green: #4A7C59;
            --green-dark: #3d6b4a;
            --green-light: #E8F5E9;
            --gray-bg: #F5F5F5;
            --gray-text: #888888;
            --dark: #333333;
            --yellow: #F9A825;
            --red: #E74C3C;
            --safe-top: env(safe-area-inset-top);
            --safe-bottom: env(safe-area-inset-bottom);
        }
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: var(--gray-bg);
            color: var(--dark);
            min-height: 100vh;
            overflow-x: hidden;
        }
        .app {
            max-width: 500px;
            margin: 0 auto;
            background: #fff;
            min-height: 100vh;
        }
        .header {
            background: var(--green);
            color: #fff;
            padding: calc(15px + var(--safe-top)) 15px 15px;
            display: flex;
            align-items: center;
            gap: 12px;
            position: sticky;
            top: 0;
            z-index: 100;
        }
        .header-back { 
            font-size: 28px; 
            cursor: pointer; 
            padding: 5px 15px 5px 5px; 
            display: none;
            align-items: center;
            gap: 4px;
        }
        .header-back.visible { display: flex; }
        .header-back-text {
            font-size: 16px;
            font-weight: 500;
        }
        .header-back:active {
            opacity: 0.7;
        }
        .header-back-btn {
            background: rgba(255,255,255,0.2);
            border: none;
            color: #fff;
            font-size: 16px;
            font-weight: 500;
            padding: 8px 16px;
            border-radius: 12px;
            cursor: pointer;
            min-height: 44px;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .header-back-btn:active {
            background: rgba(255,255,255,0.35);
            transform: scale(0.95);
        }
        .header-title { font-size: 18px; font-weight: 600; flex: 1; }
        .breadcrumbs {
            display: flex;
            align-items: center;
            padding: 8px 16px;
            background: var(--green-light);
            gap: 4px;
            min-height: 44px;
            flex-wrap: wrap;
            position: sticky;
            top: 56px;
            z-index: 99;
        }
        .breadcrumb-back {
            background: var(--green);
            border: none;
            color: #fff;
            font-size: 18px;
            font-weight: 600;
            padding: 4px 12px;
            border-radius: 8px;
            cursor: pointer;
            min-width: 36px;
            min-height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 4px;
        }
        .breadcrumb-back:active { transform: scale(0.95); }
        .breadcrumb-item { font-size: 14px; color: var(--dark); }
        .breadcrumb-link { color: var(--green); cursor: pointer; text-decoration: underline; }
        .breadcrumb-link:active { opacity: 0.7; }
        .breadcrumb-current { font-weight: 600; }
        .breadcrumb-sep { color: var(--gray-text); font-size: 14px; }
        .breadcrumb-delete {
            margin-left: auto;
            background: #fff;
            border-radius: 50%;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            font-size: 18px;
        }
        .breadcrumb-delete:active { background: #e0e0e0; transform: scale(0.95); }
        .header-tokens {
            background: rgba(255,255,255,0.2);
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .header-tokens:active {
            background: rgba(255,255,255,0.3);
        }
        .header-btn {
            font-size: 24px;
            cursor: pointer;
            padding: 8px;
            background: rgba(255,255,255,0.2);
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .header-menu {
            font-size: 20px;
            cursor: pointer;
            padding: 8px;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .header-delete {
            font-size: 20px;
            cursor: pointer;
            padding: 8px;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #fff;
            border-radius: 50%;
        }
        .header-delete:active {
            background: #e0e0e0;
            transform: scale(0.95);
        }
        .dropdown {
            position: absolute;
            top: calc(100% + 5px);
            right: 10px;
            background: #fff;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.15);
            min-width: 200px;
            overflow: hidden;
            display: none;
            z-index: 150;
            pointer-events: none;
        }
        .dropdown.show { display: block; pointer-events: auto; }
        .dropdown-item {
            padding: 14px 18px;
            font-size: 15px;
            color: var(--dark);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .dropdown-item:active { background: var(--gray-bg); }
        .dropdown-divider { height: 1px; background: #eee; }
        .screen { display: none; padding-bottom: calc(90px + var(--safe-bottom)); }
        .screen.active { display: block; }
        .card {
            background: #fff;
            margin: 12px;
            border-radius: 16px;
            box-shadow: 0 2px 12px rgba(0,0,0,0.08);
            overflow: hidden;
            cursor: pointer;
            transition: transform 0.15s;
        }
        .card:active { transform: scale(0.98); }
        .location-card-header {
            padding: 16px;
            display: flex;
            align-items: center;
            gap: 14px;
            background: linear-gradient(135deg, var(--green-light) 0%, #fff 100%);
        }
        .location-icon {
            font-size: 36px;
            width: 56px;
            height: 56px;
            background: #fff;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        .location-info h3 { font-size: 17px; font-weight: 600; }
        .location-info p { font-size: 13px; color: var(--gray-text); margin-top: 3px; }
        .location-stats {
            padding: 12px 16px;
            display: flex;
            justify-content: space-between;
            background: #fafafa;
        }
        .location-count { font-size: 14px; color: var(--green); font-weight: 600; }
        .plant-card { display: flex; gap: 14px; padding: 14px; }
        .plant-photo {
            width: 72px;
            height: 72px;
            border-radius: 12px;
            background: var(--green-light);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 32px;
            flex-shrink: 0;
            overflow: hidden;
        }
        .plant-photo img { width: 100%; height: 100%; object-fit: cover; }
        .plant-info { flex: 1; min-width: 0; }
        .plant-info h3 { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
        .plant-badge {
            display: inline-block;
            background: var(--green-light);
            color: var(--green);
            font-size: 11px;
            font-weight: 500;
            padding: 3px 10px;
            border-radius: 12px;
            margin-bottom: 6px;
        }
        .plant-meta { font-size: 13px; color: var(--gray-text); }
        .plant-note { font-size: 12px; color: var(--yellow); margin-top: 4px; }
        .filter-bar {
            display: flex;
            gap: 8px;
            padding: 12px;
            overflow-x: auto;
            background: #fff;
            border-bottom: 1px solid #eee;
        }
        .filter-btn {
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 500;
            white-space: nowrap;
            cursor: pointer;
            background: var(--gray-bg);
            color: var(--gray-text);
            border: none;
        }
        .filter-btn.active { background: var(--green); color: #fff; }
        .detail-photo {
            width: 100%;
            height: 280px;
            background: var(--green-light);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 120px;
            position: relative;
            overflow: hidden;
        }
        .detail-photo img { width: 100%; height: 100%; object-fit: cover; }
        .detail-photo-count {
            position: absolute;
            bottom: 12px;
            right: 12px;
            background: rgba(0,0,0,0.6);
            color: #fff;
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 12px;
        }
        .detail-content { padding: 20px; }
        .detail-name { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
        .detail-section { margin-top: 24px; }
        .detail-section h4 {
            font-size: 12px;
            font-weight: 600;
            color: var(--gray-text);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 10px;
        }
        .detail-section p { font-size: 15px; line-height: 1.6; }
        .detail-note {
            background: #FFF8E1;
            padding: 14px;
            border-radius: 12px;
            border-left: 4px solid var(--yellow);
        }
        .detail-desc {
            background: var(--green-light);
            padding: 14px;
            border-radius: 12px;
            border-left: 4px solid var(--green);
        }
        .photo-grid {
            display: flex;
            gap: 8px;
            overflow-x: auto;
            padding: 4px 0;
        }
        .photo-thumb {
            width: 64px;
            height: 64px;
            border-radius: 10px;
            background: var(--green-light);
            flex-shrink: 0;
            overflow: hidden;
            position: relative;
        }
        .photo-thumb-delete {
            position: absolute;
            top: 2px;
            right: 2px;
            width: 22px;
            height: 22px;
            background: rgba(0,0,0,0.6);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            cursor: pointer;
        }
        .photo-thumb-delete:active {
            background: rgba(231, 76, 60, 0.9);
        }
        .photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
        .photo-thumb-date {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(0,0,0,0.7);
            color: #fff;
            font-size: 9px;
            text-align: center;
            padding: 3px;
        }
        .btn-bar {
            position: fixed;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 100%;
            max-width: 500px;
            padding: 12px;
            padding-bottom: calc(12px + var(--safe-bottom));
            background: #fff;
            box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
            display: flex;
            gap: 10px;
            z-index: 90;
        }
        .btn {
            flex: 1;
            padding: 16px;
            border: none;
            border-radius: 14px;
            font-size: 15px;
            font-weight: 600;
            cursor: pointer;
            text-align: center;
            position: relative;
            z-index: 10;
            display: block;
            -webkit-tap-highlight-color: rgba(0,0,0,0.1);
        }
        .btn * { pointer-events: none; }
        .btn-primary { background: var(--green); color: #fff; }
        .btn-primary:active { background: var(--green-dark); }
        .btn-secondary { background: var(--gray-bg); color: var(--dark); }
        .fab {
            position: fixed;
            bottom: calc(24px + var(--safe-bottom));
            right: 24px;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: var(--green);
            color: #fff;
            font-size: 32px;
            border: none;
            box-shadow: 0 4px 20px rgba(74, 124, 89, 0.4);
            cursor: pointer;
            z-index: 90;
        }
        .fab:active { transform: scale(0.95); }
        .fab-group {
            position: fixed;
            bottom: calc(24px + var(--safe-bottom));
            right: 24px;
            display: flex;
            flex-direction: column;
            gap: 12px;
            align-items: center;
            z-index: 90;
        }
        .fab-group .fab {
            position: static;
        }
        .fab-secondary {
            background: var(--gray-bg);
            color: var(--dark);
            font-size: 20px;
            width: 50px;
            height: 50px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.15);
        }
        /* Batch mode styles */
        .batch-photo-preview {
            width: 100%;
            height: 200px;
            border-radius: 12px;
            overflow: hidden;
            margin-bottom: 15px;
            background: var(--gray-bg);
        }
        .batch-photo-preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .batch-progress {
            text-align: center;
            padding: 10px;
            background: var(--green-light);
            border-radius: 8px;
            margin-bottom: 15px;
            font-size: 14px;
            color: var(--green);
            font-weight: 500;
        }
        .batch-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 15px;
        }
        .batch-option {
            border: 3px solid #eee;
            border-radius: 12px;
            overflow: hidden;
            cursor: pointer;
            transition: all 0.2s;
        }
        .batch-option:active, .batch-option.selected {
            border-color: var(--green);
            background: var(--green-light);
        }
        .batch-option img {
            width: 100%;
            height: 80px;
            object-fit: cover;
        }
        .batch-option-info {
            padding: 8px;
            text-align: center;
        }
        .batch-option-name {
            font-size: 12px;
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .batch-option-score {
            font-size: 11px;
            color: var(--green);
        }
        .batch-option-manual {
            height: 80px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--gray-bg);
            font-size: 24px;
        }
        .batch-actions {
            display: flex;
            gap: 10px;
            margin-top: 15px;
        }
        .batch-actions .btn {
            flex: 1;
        }
        /* Onboarding styles */
        .onboarding-container {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            padding: 40px 30px;
        }
        .onboarding-slides {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            max-width: 400px;
        }
        .onboarding-slide {
            display: none;
            text-align: center;
            color: #fff;
            animation: fadeIn 0.3s ease;
        }
        .onboarding-slide.active {
            display: block;
        }
        @keyframes fadeIn {
            from { opacity: 0; transform: translateY(20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .onboarding-emoji {
            font-size: 80px;
            margin-bottom: 30px;
        }
        .onboarding-slide h2 {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 16px;
        }
        .onboarding-slide p {
            font-size: 16px;
            opacity: 0.8;
            line-height: 1.5;
        }
        .onboarding-dots {
            display: flex;
            gap: 10px;
            margin: 40px 0;
        }
        .onboarding-dots .dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: rgba(255,255,255,0.3);
            transition: all 0.3s;
        }
        .onboarding-dots .dot.active {
            background: #fff;
            width: 24px;
            border-radius: 5px;
        }
        .onboarding-buttons {
            display: flex;
            gap: 16px;
            width: 100%;
            max-width: 400px;
        }
        .onboarding-skip {
            flex: 1;
            padding: 16px;
            border: none;
            border-radius: 14px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            background: rgba(255,255,255,0.1);
            color: rgba(255,255,255,0.7);
        }
        .onboarding-next {
            flex: 2;
            padding: 16px;
            border: none;
            border-radius: 14px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            background: var(--green);
            color: #fff;
        }
        .onboarding-next:active {
            background: var(--green-dark);
        }
        .modal {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.5);
            z-index: 200;
            align-items: flex-end;
            justify-content: center;
        }
        .modal.active { display: flex; }
        .modal-content {
            background: #fff;
            width: 100%;
            max-width: 500px;
            border-radius: 20px 20px 0 0;
            padding: 20px;
            padding-bottom: calc(20px + var(--safe-bottom));
            max-height: 90vh;
            overflow-y: auto;
        }
        .modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
        }
        .modal-title { font-size: 18px; font-weight: 600; }
        .modal-close { font-size: 24px; color: var(--gray-text); cursor: pointer; }
        .form-group { margin-bottom: 18px; }
        .form-label { display: block; font-size: 13px; font-weight: 500; color: var(--gray-text); margin-bottom: 8px; }
        .form-input, .form-select {
            width: 100%;
            padding: 14px 16px;
            border: 2px solid #eee;
            border-radius: 12px;
            font-size: 16px;
            background: #fff;
        }
        .form-input:focus, .form-select:focus { outline: none; border-color: var(--green); }
        .form-row { display: flex; gap: 10px; }
        .form-row .form-group { flex: 1; }
        .photo-upload {
            width: 100%;
            height: 180px;
            border: 2px dashed #ddd;
            border-radius: 16px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            background: #fafafa;
            overflow: hidden;
            position: relative;
        }
        .photo-upload.has-photo { border: none; }
        .photo-upload img { width: 100%; height: 100%; object-fit: cover; }
        .photo-upload-icon { font-size: 48px; margin-bottom: 10px; }
        .photo-upload-text { color: var(--gray-text); font-size: 14px; }
        .photo-upload-badge {
            position: absolute;
            top: 10px;
            right: 10px;
            background: var(--green);
            color: #fff;
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600;
        }
        .empty { text-align: center; padding: 60px 30px; }
        .empty-icon { font-size: 72px; margin-bottom: 16px; }
        .empty h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
        .empty p { color: var(--gray-text); font-size: 14px; }
        .toast {
            position: fixed;
            bottom: calc(100px + var(--safe-bottom));
            left: 50%;
            transform: translateX(-50%) translateY(100px);
            background: var(--dark);
            color: #fff;
            padding: 14px 24px;
            border-radius: 12px;
            font-size: 14px;
            opacity: 0;
            transition: all 0.3s;
            z-index: 400;
            max-width: 90%;
            text-align: center;
        }
        .toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
        .loader-overlay {
            display: none;
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.7);
            z-index: 500;
            align-items: center;
            justify-content: center;
        }
        .loader-overlay.show { display: flex; }
        .loader-box {
            background: #fff;
            padding: 30px 40px;
            border-radius: 20px;
            text-align: center;
            min-width: 220px;
        }
        .loader-spinner {
            width: 50px;
            height: 50px;
            border: 4px solid var(--green-light);
            border-top-color: var(--green);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin: 0 auto 16px;
        }
        @keyframes spin { to { transform: rotate(360deg); } }
        .loader-text { font-size: 15px; color: var(--dark); font-weight: 500; }
        .loader-cancel-btn {
            display: none;
            margin-top: 16px;
            padding: 10px 30px;
            background: var(--red);
            color: #fff;
            border: none;
            border-radius: 12px;
            font-size: 15px;
            font-weight: 500;
            cursor: pointer;
            min-height: 44px;
        }
        .loader-cancel-btn:active { transform: scale(0.95); }
        .recognition-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            margin-bottom: 15px;
        }
        .recognition-card {
            border: 3px solid #eee;
            border-radius: 12px;
            overflow: hidden;
            cursor: pointer;
            transition: border-color 0.2s;
        }
        .recognition-card:active, .recognition-card.selected {
            border-color: var(--green);
        }
        .recognition-card img {
            width: 100%;
            height: 120px;
            object-fit: cover;
            display: block;
        }
        .recognition-card-info {
            padding: 8px;
            background: #fff;
        }
        .recognition-card-name {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 2px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .recognition-card-score {
            font-size: 11px;
            color: var(--green);
            font-weight: 600;
        }
        .recognition-card-score.low {
            color: var(--yellow);
        }
        .recognition-list { max-height: 300px; overflow-y: auto; }
        .recognition-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            border: 2px solid #eee;
            border-radius: 12px;
            margin-bottom: 10px;
            cursor: pointer;
        }
        .recognition-item:active, .recognition-item.selected { border-color: var(--green); background: var(--green-light); }
        .recognition-score {
            font-size: 14px;
            font-weight: 700;
            color: var(--green);
            min-width: 50px;
        }
        .recognition-score.low { color: var(--yellow); }
        .recognition-info { flex: 1; }
        .recognition-name { font-size: 15px; font-weight: 600; }
        .recognition-latin { font-size: 12px; color: var(--gray-text); font-style: italic; }
        .wiki-content {
            background: var(--green-light);
            padding: 16px;
            border-radius: 12px;
            margin-top: 10px;
            max-height: 200px;
            overflow-y: auto;
            font-size: 14px;
            line-height: 1.6;
        }
        .position-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            margin-bottom: 10px;
        }
        .position-chip {
            padding: 8px 14px;
            background: var(--gray-bg);
            border-radius: 20px;
            font-size: 13px;
            cursor: pointer;
            border: 2px solid transparent;
        }
        .position-chip:active, .position-chip.selected {
            background: var(--green-light);
            border-color: var(--green);
        }
.auth-version {
    font-size: 12px;
    color: var(--gray-text);
    margin-top: 8px;
}

/* Catalog */
.catalog-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    cursor: pointer;
}
.catalog-card:active { opacity: 0.7; }
.catalog-card-name { font-size: 16px; font-weight: 600; color: var(--dark); margin-bottom: 2px; }
.catalog-card-latin { font-size: 13px; color: var(--gray-text); font-style: italic; margin-bottom: 4px; }
.catalog-card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.catalog-card-life { font-size: 12px; color: var(--gray-text); padding: 2px 8px; background: var(--gray-bg); border-radius: 10px; }
.catalog-card-desc { font-size: 13px; color: var(--gray-text); line-height: 1.4; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.catalog-card { display: flex; gap: 12px; align-items: center; }
.catalog-card-photo { width: 60px; height: 60px; border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.catalog-card-photo img { width: 100%; height: 100%; object-fit: cover; }
.catalog-card-photo-empty { background: var(--green-light); display: flex; align-items: center; justify-content: center; font-size: 28px; }
.catalog-card-body { flex: 1; min-width: 0; }
.wiki-plant-gallery { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; margin-bottom: 12px; }
.wiki-plant-gallery-img { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; cursor: pointer; flex-shrink: 0; }
.wiki-plant-gallery-img:active { transform: scale(0.95); }

/* Wiki plant modal */
.wiki-plant-name { font-size: 20px; font-weight: 700; color: var(--dark); margin-bottom: 4px; }
.wiki-plant-latin { font-size: 14px; color: var(--gray-text); font-style: italic; margin-bottom: 4px; }
.wiki-plant-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.wiki-plant-section { margin-top: 14px; }
.wiki-plant-section h4 { font-size: 13px; color: var(--gray-text); font-weight: 600; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.wiki-plant-section p { font-size: 14px; color: var(--dark); line-height: 1.5; }

/* Note editor */
.note-btn {
    font-size: 24px;
    background: none;
    border: 2px solid #eee;
    border-radius: 12px;
    padding: 10px 16px;
    cursor: pointer;
    opacity: 0.5;
    min-width: 56px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.note-btn:active {
    transform: scale(0.95);
}
.note-editor-textarea {
    width: 100%;
    min-height: 200px;
    padding: 14px;
    border: 2px solid #eee;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}
.note-editor-textarea:focus {
    outline: none;
    border-color: var(--green);
}

/* Location picker label */
.location-picker-label {
    font-size: 14px;
    color: var(--gray-text);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Detail Screen Redesign v0.6.9 ===== */

/* Main photo carousel */
.detail-carousel {
    position: relative;
    width: 100%;
    height: 300px;
    background: var(--green-light);
    overflow: hidden;
}
.detail-carousel-track {
    width: 100%;
    height: 100%;
    position: relative;
}
.detail-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s;
    cursor: pointer;
}
.detail-carousel-slide.active {
    opacity: 1;
}
.detail-carousel-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 100px;
}
.detail-carousel-prev,
.detail-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.4);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.detail-carousel-prev { left: 12px; }
.detail-carousel-next { right: 12px; }
.detail-carousel-prev:active,
.detail-carousel-next:active {
    background: rgba(0,0,0,0.7);
    transform: translateY(-50%) scale(0.95);
}
.detail-carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}
.detail-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background 0.2s;
}
.detail-carousel-dot.active {
    background: white;
}

/* Photo gallery (editable) */
.detail-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #fafafa;
    border-radius: 12px;
    margin: 0 12px;
}
.detail-gallery-item {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #ddd;
    flex-shrink: 0;
}
.detail-gallery-item.is-main {
    border-color: var(--green);
}
.detail-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}
.detail-gallery-star {
    position: absolute;
    top: 2px;
    left: 2px;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.detail-gallery-star.active {
    background: rgba(255,193,7,0.9);
}
.detail-gallery-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    background: rgba(220,53,69,0.8);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.detail-gallery-add {
    width: 72px;
    height: 72px;
    border: 2px dashed #ccc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 28px;
    color: #999;
    flex-shrink: 0;
}
.detail-gallery-add:active {
    background: #f0f0f0;
    transform: scale(0.95);
}

/* Bottom action bar */
.detail-action-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 16px;
    padding-bottom: calc(12px + var(--safe-bottom));
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    z-index: 100;
}
.detail-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.15s, transform 0.15s;
}
.detail-action-btn:active {
    background: var(--green-light);
    transform: scale(0.95);
}
.detail-action-btn-icon {
    font-size: 24px;
}
.detail-action-btn-label {
    font-size: 11px;
    color: var(--gray-text);
    font-weight: 500;
}

/* Photo fullscreen overlay */
.photo-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}
.photo-fullscreen-wrap {
    position: relative;
    max-width: 95%;
    max-height: 90%;
}
.photo-fullscreen-wrap img {
    display: block;
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}
.photo-fullscreen-close {
    position: absolute;
    top: -12px;
    right: -12px;
    background: rgba(255,255,255,0.9);
    border: none;
    color: #333;
    font-size: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.photo-fullscreen-close:active {
    background: white;
    transform: scale(0.95);
}
.photo-fullscreen-top-actions {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 8px;
    z-index: 2;
}

        .lang-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 9999; display: flex; align-items: center; justify-content: center; flex-direction: column; }
        .lang-overlay-flag { font-size: 80px; animation: langPulse 0.8s infinite; }
        @keyframes langPulse {
            0%, 100% { transform: scale(1); }
            50% { transform: scale(1.2); }
        }
    </style>
</head>
<body>
