* { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: 'Nunito', sans-serif; background: #f5f5f5; }

        .diagnose-spinner {
            display: inline-block;
            width: 18px;
            height: 18px;
            border: 3px solid #c8e0c8;
            border-top-color: #2d6a2d;
            border-radius: 50%;
            animation: diagnose-spin 0.8s linear infinite;
            vertical-align: middle;
        }
        @keyframes diagnose-spin {
            to { transform: rotate(360deg); }
        }

        .schemes-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 20px;
        }
        
        .schemes-header {
            text-align: center;
            margin-bottom: 30px;
        }
        
        .schemes-header h1 {
            font-family: 'Playfair Display', serif;
            font-size: 2.5rem;
            color: var(--green);
            margin-bottom: 10px;
        }
        
        /* Категорії */
        .category-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }
        
        .category-card {
            background: var(--white);
            border-radius: var(--r-md);
            padding: 20px;
            cursor: pointer;
            transition: all 0.3s;
            border-left: 5px solid var(--green);
            box-shadow: var(--sh-1);
        }

        .category-card:hover {
            transform: translateY(-5px);
            box-shadow: var(--sh-3);
        }

        .category-icon { font-size: 2.5rem; margin-bottom: 10px; }
        .category-name { font-size: 1.1rem; font-weight: 700; color: var(--green); margin-bottom: 5px; }
        .category-cultures { font-size: 0.85rem; color: var(--text-mute); }

        .btn-back {
            display: none;
            background: var(--green);
            color: var(--white);
            padding: 12px 24px;
            border: none;
            border-radius: var(--r);
            cursor: pointer;
            font-weight: 600;
            position: fixed;
            top: 20px;
            left: 20px;
            z-index: 9999;
            box-shadow: var(--sh-2);
        }

        .btn-back.active {
            display: inline-block;
            animation: slideDown 0.3s ease-out;
        }

        @keyframes slideDown {
            from { opacity: 0; transform: translateY(-20px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .btn-back:hover {
            background: var(--green-d);
            box-shadow: 0 6px 16px rgba(0,0,0,0.25);
        }

        .scheme-item {
            background: var(--white);
            border-radius: var(--r-md);
            padding: 25px;
            margin-bottom: 20px;
            box-shadow: var(--sh-1);
        }
        
        .scheme-header {
            margin-bottom: 20px;
            padding-bottom: 15px;
            border-bottom: 2px solid #f0f0f0;
        }
        
        .scheme-title { font-size: 1.3rem; font-weight: 700; color: var(--green); }
        .scheme-timing { display: inline-block; background: var(--gp); padding: 8px 16px; border-radius: var(--r-lg); font-size: 0.9rem; color: var(--green); font-weight: 600; margin-top: 10px; }

        .treatments-list { display: flex; flex-direction: column; gap: 15px; }

        .treatment {
            background: linear-gradient(135deg, #f8f8f8 0%, #fff 100%);
            border-left: 4px solid var(--green-l);
            padding: 15px;
            border-radius: var(--r);
        }
        
        .treatment-stage { font-weight: 700; color: var(--green); margin-bottom: 8px; }
        .treatment-date { display: inline-block; background: #d4edda; padding: 4px 10px; border-radius: 12px; font-size: 0.8rem; color: #155724; margin-bottom: 10px; font-weight: 600; }
        
        .treatment-problem {
            background: #ffe8e8;
            border-left: 3px solid #d9534f;
            padding: 10px;
            border-radius: 6px;
            margin: 10px 0;
            font-size: 0.9rem;
        }
        
        .treatment-prep-type {
            background: #e3f2fd;
            border-left: 3px solid #2196f3;
            padding: 10px;
            border-radius: 6px;
            margin: 10px 0;
            font-size: 0.9rem;
            color: #1976d2;
        }
        
        .products-section {
            background: #f0f8f0;
            border: 2px solid var(--green-l);
            border-radius: var(--r);
            padding: 15px;
            margin-top: 15px;
        }

        .products-title { font-weight: 700; color: var(--green); margin-bottom: 12px; }
        .products-list { display: flex; flex-direction: column; gap: 10px; }

        .product-item {
            background: var(--white);
            border-radius: 10px;
            padding: 10px 14px 10px 10px;
            display: flex;
            align-items: center;
            gap: 12px;
            box-shadow: 0 1px 4px rgba(0,0,0,0.07);
            transition: box-shadow .15s, transform .15s, border-color .15s;
            cursor: pointer;
            border: 1.5px solid transparent;
            user-select: none;
        }
        .product-item:hover {
            box-shadow: 0 4px 14px rgba(45,106,45,0.18);
            transform: translateY(-2px);
            border-color: var(--green-l);
        }
        .product-item:active {
            transform: translateY(0);
            box-shadow: 0 1px 4px rgba(0,0,0,0.07);
        }
        .product-item.added {
            border-color: var(--green);
            background: #f0f8f0;
        }

        .product-photo {
            width: 58px; height: 58px;
            border-radius: 8px;
            object-fit: contain;
            background: #f5f5f5;
            flex-shrink: 0;
            border: 1px solid #eee;
        }
        .product-photo-placeholder {
            width: 58px; height: 58px;
            border-radius: 8px;
            background: #eef5ee;
            display: flex; align-items: center; justify-content: center;
            font-size: 1.5rem;
            flex-shrink: 0;
            border: 1px solid #d5e8d5;
        }

        .product-info { flex: 1; min-width: 0; }
        .product-name { font-weight: 600; color: #1a2e1a; font-size: 0.88rem; line-height: 1.3; }
        .product-brand { font-size: 0.75rem; color: #aaa; margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }

        .product-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
        .product-item::after { content: "›"; font-size: 1.4rem; color: #b0ccb0; align-self: center; margin-left: 2px; flex-shrink: 0; transition: color .2s, transform .2s; }
        .product-item:hover::after { color: var(--green); transform: translateX(3px); }
        .product-price { font-weight: 700; color: var(--green); font-size: 1.05rem; white-space: nowrap; }

        .product-stock {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 0.7rem;
            font-weight: 600;
            white-space: nowrap;
        }
        .product-stock.in-stock { background: #d4edda; color: #155724; }
        .product-stock.out-of-stock { background: #f8d7da; color: #721c24; }

        .btn-add-to-cart {
            background: var(--green);
            color: var(--white);
            border: none;
            padding: 7px 14px;
            border-radius: 7px;
            cursor: pointer;
            font-weight: 700;
            font-size: 0.8rem;
            font-family: 'Nunito', sans-serif;
            transition: background .15s;
            white-space: nowrap;
        }
        .btn-add-to-cart:hover { background: var(--green-d); }

        .no-products { color: #999; font-size: 0.85rem; font-style: italic; }

        @media (max-width: 520px) {
            .product-item { gap: 8px; padding: 8px 10px 8px 8px; }
            .product-photo, .product-photo-placeholder { width: 44px; height: 44px; font-size: 1.1rem; }
            .product-name { font-size: 0.82rem; }
            .product-price { font-size: 0.95rem; }
            .btn-add-to-cart { padding: 6px 10px; font-size: 0.75rem; }
        }
        

        /* ── Головні вкладки сторінки ── */
        .main-tabs {
            display: flex; gap: 6px; margin-bottom: 24px; flex-wrap: wrap;
        }
        .main-tab {
            padding: 10px 20px; border-radius: 10px; border: 2px solid var(--green-l);
            background: #fff; color: var(--green); font-size: .95rem; font-weight: 700;
            cursor: pointer; transition: all .15s; font-family: 'Nunito', sans-serif;
        }
        .main-tab.active { background: var(--green); color: #fff; border-color: var(--green); }
        .main-tab:hover:not(.active) { background: #e8f5e9; }
        .main-section { display: none; }
        .main-section.active { display: block; }

        /* ── Хвороби і шкідники ── */
        .dp-wrap { padding: 0; }
        .dp-group-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
        .dp-gtab { padding: 4px 12px; border: 0.5px solid #ccc; border-radius: 8px; font-size: 12px;
                   cursor: pointer; background: #fff; color: #555; transition: all .15s; }
        .dp-gtab.active { background: #e8f5e9; color: #1a5c1a; border-color: #2d6a2d; font-weight: 600; }
        .dp-crop-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 1rem; }
        .dp-ctab { padding: 5px 13px; border: 0.5px solid #ccc; border-radius: 8px; font-size: 13px;
                   cursor: pointer; background: #fff; color: #555; transition: all .15s; }
        .dp-ctab.active { background: #e8f5e9; color: #1a5c1a; border-color: #2d6a2d; font-weight: 600; }
        .dp-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: .75rem; }
        .dp-leg-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #777; }
        .dp-leg-line { width: 14px; height: 3px; border-radius: 2px; }
        .dp-section-label { font-size: 11px; font-weight: 600; text-transform: uppercase;
                            letter-spacing: .05em; color: #999; margin: 1rem 0 5px; }
        .dp-dlist { display: flex; flex-direction: column; gap: 7px; }
        .dp-card { border: 0.5px solid #e0e0e0; border-radius: 10px; overflow: hidden; }
        .dp-card.disease .dp-hdr { border-left: 3px solid #1D9E75; }
        .dp-card.pest .dp-hdr { border-left: 3px solid #378ADD; }
        .dp-hdr { display: flex; align-items: center; gap: 8px; padding: 8px 13px;
                  cursor: pointer; background: #f8f8f8; }
        .dp-dname { font-size: 13px; font-weight: 600; color: #1a1a1a; flex: 1; }
        .dp-badge { font-size: 11px; padding: 2px 7px; border-radius: 8px; background: #fff;
                    border: 0.5px solid #ddd; color: #777; white-space: nowrap; }
        .dp-chev { font-size: 15px; color: #aaa; transition: transform .2s; }
        .dp-chev.open { transform: rotate(180deg); }
        .dp-body { display: none; padding: 9px 13px; border-top: 0.5px solid #eee; background: #fff; }
        .dp-body.open { display: block; }
        .dp-ptable { width: 100%; border-collapse: collapse; font-size: 12px; }
        .dp-ptable th { text-align: left; color: #888; font-weight: 500; padding: 3px 7px 5px;
                        border-bottom: 0.5px solid #eee; }
        .dp-ptable td { padding: 5px 7px; border-bottom: 0.5px solid #f0f0f0;
                        color: #222; vertical-align: middle; }
        .dp-ptable tr:last-child td { border-bottom: none; }
        .dp-ptable tr:hover td { background: #f8fdf8; }
        .dp-ptable td.dp-prod-name { cursor: pointer; color: var(--green); font-weight: 600; }
        .dp-ptable td.dp-prod-name:hover { text-decoration: underline; }
        .dp-tb { font-size: 11px; padding: 2px 6px; border-radius: 6px; white-space: nowrap; }
        .dp-tb-f { background: #E1F5EE; color: #085041; }
        .dp-tb-i { background: #E6F1FB; color: #0C447C; }
        .dp-tb-a { background: #FAEEDA; color: #633806; }
        .dp-note { font-size: 11px; color: #aaa; margin-top: 7px; padding-top: 7px;
                   border-top: 0.5px solid #eee; }

        /* ── Гербіциди ── */
        .hb-wrap { padding: 0; }
        .hb-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 1.25rem; }
        .hb-tab { padding: 6px 13px; border-radius: 8px; border: 0.5px solid #ccc;
                  background: #fff; color: #555; font-size: 13px; cursor: pointer; transition: all .15s; }
        .hb-tab.active { background: #dceefb; color: #0C447C; border-color: #378ADD; font-weight: 600; }
        .hb-tab:hover:not(.active) { background: #f0f0f0; }
        .hb-panel { display: none; } .hb-panel.active { display: block; }
        .hb-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
        @media(max-width:560px) { .hb-two-col { grid-template-columns: 1fr; } }
        .hb-card { background: #fff; border: 0.5px solid #e0e0e0; border-radius: 10px; padding: 1rem 1.25rem; }
        .hb-card h3 { font-size: 12px; font-weight: 500; color: #888; text-transform: uppercase;
                      letter-spacing: .04em; margin-bottom: .75rem; }
        .hb-ptitle { font-size: 16px; font-weight: 600; color: #1a1a1a; margin-bottom: 1rem;
                     display: flex; align-items: center; gap: 8px; }
        .hb-weed-list { list-style: none; }
        .hb-weed-list li { font-size: 13px; color: #333; padding: 3px 0;
                           border-bottom: 0.5px solid #f0f0f0; display: flex; align-items: flex-start; gap: 6px; }
        .hb-weed-list li:last-child { border-bottom: none; }
        .hb-weed-list li::before { content: "•"; color: #bbb; flex-shrink: 0; }
        .hb-hi { padding: 6px 0; border-bottom: 0.5px solid #f0f0f0; }
        .hb-hi:last-child { border-bottom: none; }
        .hb-hn { font-size: 13px; font-weight: 600; color: var(--green); cursor: pointer; }
        .hb-hn:hover { text-decoration: underline; }
        .hb-hd { font-size: 12px; color: #666; margin-top: 1px; }
        .hb-ht { font-size: 11px; color: #aaa; margin-top: 2px; }
        .hb-badge { display: inline-block; font-size: 11px; padding: 2px 7px; border-radius: 6px; margin-right: 4px; }
        .hb-bm { background: #e8f5e9; color: #2e7d32; }
        .hb-bd { background: #fff8e1; color: #f57f17; }
        .hb-bu { background: #e3f2fd; color: #0d47a1; }
        .hb-bs { background: #fce4ec; color: #880e4f; }
        .additives-section {
            background: #fff8e1;
            border: 2px solid #f9a825;
            border-radius: 8px;
            padding: 15px;
            margin-top: 12px;
        }
        
        .additives-title { font-weight: 700; color: #e65100; margin-bottom: 12px; }
        
        .additives-tip {
            background: #fff3cd;
            border-left: 3px solid #f9a825;
            padding: 8px 12px;
            border-radius: 4px;
            font-size: 0.82rem;
            color: #856404;
            margin-bottom: 10px;
            line-height: 1.5;
        }
        

        /* Вибір культури (схеми) */
        .scheme-tabs {
            display: flex;
            gap: 12px;
            flex-wrap: wrap;
            margin-bottom: 24px;
        }

        .scheme-tab {
            background: var(--white);
            border: 2px solid var(--green);
            color: var(--green);
            padding: 12px 24px;
            border-radius: 10px;
            cursor: pointer;
            font-weight: 700;
            font-size: 1rem;
            font-family: 'Nunito', sans-serif;
            transition: all var(--t);
        }

        .scheme-tab:hover, .scheme-tab.active {
            background: var(--green);
            color: var(--white);
        }

        /* Вибір етапу */
        .stage-tabs {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 24px;
            padding: 16px;
            background: var(--white);
            border-radius: var(--r-md);
            box-shadow: var(--sh-1);
        }

        .stage-tab {
            background: #f0f8f0;
            border: 2px solid var(--green-l);
            color: var(--green);
            padding: 8px 16px;
            border-radius: var(--r-lg);
            cursor: pointer;
            font-weight: 600;
            font-size: 0.85rem;
            font-family: 'Nunito', sans-serif;
            transition: all var(--t);
            white-space: nowrap;
        }

        .stage-tab:hover, .stage-tab.active {
            background: var(--green);
            color: var(--white);
            border-color: var(--green);
        }

        /* Деталі етапу */
        .stage-detail {
            animation: fadeIn 0.25s ease;
        }

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

        @media (max-width: 768px) {
            .schemes-header h1 { font-size: 1.8rem; }
            .category-grid { grid-template-columns: 1fr; }
            .product-item { flex-direction: column; align-items: flex-start; gap: 8px; }
        }
